### Lone Wolf story graph

**Update 2018/06:**added GEXF export for exploring the graph with other tools, added Side-by-Side reading of the text and graph

Few days ago Joe Daver of the Lone Wolf fame passed away, what a pity, it was an enjoyable type of book when I was a child. Since several years Project Aon is freely publishing his works in a browsable way.

Project Aon provides a graph representation of the books (e.g. here) but I wanted to have my twist as remembrance.

I have prepared a browsable story graph of the first 7 books, highlighting deaths, combats, quiz nodes,

**looping edges and death probability**. In particular I have create also one single view with all these 7 books that gives an impression of the flow at glance.

### Legenda

Click on the nodes to get to the page.Nodes:

- Orange octagons are fighting situations.
- Red cut circles are deadly situations.
- Sommerswerd mention is in magenta
- Start and End are in green

Edges:

- Looping edges have special arrow
- Edges are colored by death probability (only DAG graphs)
- Edge label is the death probability (only DAG graphs)
- Bold edge means shortest path
- Dashed edges means subject to random pick

### Graphs

In side-by-side it is possible to sync the book view with the graph and vice-versa. It works only on Chrome.

#### Separate books

- Flight from the Dark (side-by-side, PDF, SVG, book, GEXF)
- Fire on the Water (side-by-side, PDF, SVG, book, GEXF) - initial part structured
- The Caverns of Kalte (side-by-side, PDF, SVG, book, GEXF) - loopy, two ending branches
- The Chasm of Doom (side-by-side, PDF, SVG, book, GEXF) - long simple structure
- Shadow on the Sand (side-by-side, PDF, SVG, book, GEXF) - two large shortcuts
- The Kingdoms of Terror (side-by-side, PDF, SVG, book, GEXF) - simple structure
- Castle Death (side-by-side, PDF, SVG, book, GEXF) - branches, articulated structure

### Graph Processing

Graph computing can be used for some statistics:- Loopy edges
- Shortest path - Dijkstra
- Total number of paths, only if the are able to remove all loops. There are issues with books 2 and 6 for which they have been fixed manually. The algorithms requires topological sort

Note that the

Random based edges have been excluded from shortest path computation. If there is no possibility of shortest path we have highlighted with a negative sign.

**shortest is path**is purely topological and there is no verification that is had conflicting dependencies (e.g. disciplines) or it has major side effects (e.g. loss and not recovery of the inventory).Random based edges have been excluded from shortest path computation. If there is no possibility of shortest path we have highlighted with a negative sign.

Book | Shortest Path | Total Paths |
---|---|---|

1 | 30 | 7023366699464 |

2 | 71 (R) | 384775507967329330790400 |

3 | 36 (R) | 8821161258410880000 |

4 | 55 (R) | 95368579164278784000 |

5 | 66 (R) | 542718250726171907017716793344000 |

6 | 75 | 380805460076762077593600000 |

7 | 41 | 5960660788645334323200 |

Given the DAG version of the story it is possible to compute the death probability of a path by starting from the tails (0 for winning, 1 for death). We propagate the death probability up based on the possibility of taking a path: we consider uniform possibility for regular path, and instead interval probability for the random paths. In addition if we pass by a node we make sure that probability is at least 50%. Finally the probability is colored with a colormap "cool".

We can combine shortest path and death probability to understand how death probabilities goes in the shortest path. The asterisk is a combat situation.

Some notes about structure as it emerges from graph and from memories of reading:

- In book 1 there is a path without fight nor random
- Book 3 is the only one with a failing end without death. There is a full branch of many nodes that gives this outcome.
- Book 5 has a quiz, needed to add a custom connection between sections

### Code

The code for extraction and generation is on github. It's based on Python with graphviz and networkx. You are welcome to reuse it.The concept is that we first extract graph structure and semantics from the HTML files, then apply graph processing techniques and then generate the visualizations.

### Ideas

- associate event to nodes with icons
- track magic items acquisition and use
- use lightbox with page content instead of new page

Ideas for graph theory analysis:

- weight nodes by fight relevance / other events and perform other path search
- if the resolution always has a random path, then compute multiple shortest path by split the graph in parts and look from start to random page and then to end
- highlight VIP nodes
- prune edges based on conditions (e.g. disciplines, or objects)
- identify connected components (sub-stories)
- solve the removal of cycle problem that prevents the computation of total paths

### Graphs and Research

While this is just for fun, I worked on graph analysis applied to Technology Trajectories based on citations among patents.

**Ruffaldi Emanuele**,

*Sani Elisabetta*& Bergamasco Massimo (2010). Visualizing perspectives and trends in robotics based on patent mining. In

*Robotics and Automation (ICRA), 2010 IEEE International Conference on*(pp. 4340-4347) 10.1109/ROBOT.2010.5509648 (PDF)

## Comments