Python script which repeatedly requests random pages from Wikipedia, and generates a graph of their path (if one exists) back to the Philosophy Wikipedia page.
This project is a fork of David Muller's getting_to_philosophy, allowing me to re-use his code for getting the first non-italisicised link in a Wikipedia page.
- Optimize to check for an existing path from current node to end node when making hops
- Generate some statistics
- Average number of hops
- Minimum number of hops
- Maximum number of hop
- Common convergence points
- Percentage of pages for which a path was not found
- BeautifulSoup4
- GraphViz | pip install pygraphviz
Here is an output image for 100 random Wikipedia pages (~4Mb PNG)
The following image shows the tree generated for 5 randomly selected Wikipedia pages