Wikipedia's Philosophy Game


This was a pretty interesting project, and I'm sure there's a lot more to explore, but I'm pretty satisfied to where I got. The initial goal of this project was to find a way to play the Philosophy game automagically. Then, as I automated more and more of the process, it became clear that the overall structure would best be represented by a directed graph.

My first attempts were mostly using the Wikipedia API, both with the python wrapper and without, with which I was vaguely familiar with from trying to build a bot that plays the WikiGame. However, it was just generally pretty slow. I know I could have done more parallel requests, but I also wanted more control over the data.


I then downloaded a Wikipedia Dump and attempted to parse the large XML file by myself. This provided a few challenges such as MemoryErrors, and the exceptions that I had to catch myself rather than using the API.


The rest was some simple data wrangling as I experimented with different libraries for packaging my data structure JSON file to a graph data type and then exporting to an industry standard file type which I could then open in a graph viewer. I ended up using igraph for its speed.


The resulting GraphML file was then opened in Graphia. The pictures below are from 10000 Wikipedia articles. The ones on the side either contain unsupported articles, such as files and automatically generated articles. There are also self contained loops that do not connect to the main graph.


If you want to download the 10000 articles, the GraphML file is available on the download page.