Title: A CostApproach to Adaptivity in Literary Hypertext
1A Cost-Based Approach to Adaptivity in Literary
Hypertext
2Fiction
Recreation of events that never happened with the
intention to produce in the reader mental states
ranging from pure entertainment to profound
existential meditation. It is considered the
supreme art, since it requires a carefully
crafted construction (language) plus reasoning.
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
3Specialized FictionA Novel By Postmodernists
In the works of Fellini, a predominant concept is
the distinction between within and without. If
capitalist desituationism holds, the works of
Fellini are reminiscent of Joyce. "Sexuality is
fundamentally a legal fiction," says Lyotard.
Therefore, the subject is contextualised into a
dialectic postcapitalist theory that includes
culture as a paradox. Sontag uses the term
'capitalist desituationism' to denote the bridge
between sexual identity and class. However, the
futility, and some would say the fatal flaw, of
dialectic postcapitalist theory prevalent in
Fellini's La Dolce Vita is also evident in
Satyricon, although in a more mythopoetical
sense. The subject is interpolated into a
capitalist desituationism that includes
consciousness as a whole. Those were the
thoughts in Mirandas mind while she paid for a
coffee in the Postmodern Café. For the first
time in her life she had a blind date.
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
4Mathematical Fiction The syntax approach
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
5Mathematical Fiction The semantics approach
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
6Lexicographic Hypertext
nding
eginning
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
7Build your own adventure
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
8Adaptive Fiction
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
9Mathematical Fiction A functional approach
(reader)
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
10Mathematical Model
Your mission, if you decide to accept it,
is Come up with an idea to model this system!!!
MISSION IMPOSSIBLE???
11Adaptive FictionBehind Scenes
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
12Shortest Path (solutions)
Several solutions have been found to find the
shortest path in a graph G with m edges and n
vertices Bellman-Ford (1958) Dijkstra
(1959) Floyd-Warshall (1962) Gomory-Hu
(1961!!!)
O(mn) from i to j. O(mn2) from i to every j.
O(mn3) from every i to every j O(n2) from i
to every j. O(n3) from every i to every
j. O(mlog(n)) if an inverted heap is
used O(n3) to find from every i to every
j. O(n3) to find from every i to every j plus a
tag matrix (very useful as we shall see).
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
13Gomory-Hu Algorithm (Definition)
For i 1 To n For j 1 To n For k
1 To n If CMR(i, k) gt CMR(i, j)
CMR(j, k) Then CMR(i, k)
CMR(i, j) CMR(j, k) Next k Next
j Next i
Requires the distance matrix. Returns the global
distance matrix and all the minimum paths in a
tag matrix. Gomory-Hu is better than optimized
Dijsktra if the graph is dense (not-sparse),
which will be usually the case in fiction.
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
14Hypertextual Attractors
Those pages that disrupt the narrative continuity
by repetition. Let cij denote the cost between
the origin page i and the destination page j. Let
N represent the total number of pages. Let Aj be
the hypertextual attraction of page j. Let K1 be
a normalization constant. Then,
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
15Hypertextual Friction
The probability of loosing readers' attention
during a navigation event. Let cij denote the
cost between the origin page i and the
destination page j. Let rij denote read pages.
Let N represent the total number of pages. Let
Dij be the hypertextual friction between pages i
and j. Let K2 be a normalization constant. Then,
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
16Dynamical System
Let I be the readers interest. Let F be the
hypertextual friction. Let A be the hypertextual
attraction. Let R represent the total pages read.
Then, an adaptive literary hypertext can be
modeled as
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
17Dynamical System
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
18Optimization Problem
Maximize I (readers interest). Minimize F
(hypertextual friction). Recalculate every time
the reader makes a selection.
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
19An implementation
http//www.literatronic.com
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
20Questions? Comments?
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
21What is a graph? Some math
A graph consists on two finite sets (having
finitely many elements), a set V of point called
vertices and A set of connecting lines called
edges, such that each edge connects two vertices
called the end points of the edge. We write G
(V,E) When the edges have direction, we talk
about a digraph (directed graph).
Sparse graphs are graphs with few edges (far
fewer than the maximum possible number n(n-1)/2,
where n is the number of edges). In our example
maximum24.5 e10 not sparse! (or dense)
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
22Graph Representation (I)
A graph can be represented with an adjacency
matrix
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
23Graph Representation (II)
A graph can be represented with a distance matrix
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
24Shortest Path (from i to j)
How to find the shortest path between any pair of
vertices?
A graph can have different types of paths
(remember, mathematicians need to be very
precise) Walk Trail Path Cycle
Move between vertices without restriction. Each
edge must occur at most once. Each vertex must
occur at most once. Closed path.
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
25First Computational Complexity
To count the number of vertices, requires n
operations (n of vertices).
O(n) O(n2)
To create the adjacency matrix, requires n time n
operations n2.
Complexity of an algorithm is a metric that
serves to describe the difficulty of a problem.
The lower the better!
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
26Gomory-Hu Algorithm (Example)
1. Local Distance Matrix
2. Global Distance Matrix
3. Path Tag Matrix
Problem Definition ? Mathematical Model ?
Implementation ? Discussion
27Dynamic Programming
Question How can such an elemental algorithm
accomplish so much?
Answer Bellmans optimality principle (or
minimality principle) If P1,2, i,j is a
shortest path from 1 to j, then P1? i is a
shortest path as well.
Bellmans optimality principle for laymen Solve
the small sub-cases (simple cases). Combine the
solutions to obtain bigger sub-cases until you
reach the full size of the problem.
Problem Definition ? Mathematical Model ?
Implementation ? Discussion