WikiGame
Give it any two Wikipedia articles and watch it find a path between them, hopping link to link.
The Wikipedia Game is the old browser dare: start on one article, reach another using only the blue links inside each page, in as few clicks as you can. Playing it by hand is half intuition and half luck: you click toward whatever feels closer to the destination and hope the next page opens a better door. I wanted to watch that intuition run as a program, so I built a solver that makes the same call at every step and shows you the trail it leaves behind.
The honest part of the problem is "closer." A human reads a page and senses which link points roughly the right way; the solver has to turn that hunch into a number. So at each article it pulls the outbound links, reads a little of what each one is about, and measures how much that text overlaps with the destination article's text. The link that overlaps the most wins, and the walk moves on. No backtracking, no lookahead, just the best-looking step, taken over and over until it arrives or gives up.
How it works
- Greedy similarity walk: at each page it scores the outbound links by TF-IDF cosine similarity against the target article and jumps to the best unvisited one, repeating until it lands on the goal.
- Reads before it leaps: for every step it batch-fetches the intro extract of up to 40 candidate links, builds TF-IDF vectors over those intros plus the target, and ranks them, so the choice is based on what each page is actually about.
- Knows when to quit: it caps the run at 30 hops, never revisits a page, and aborts if the best candidate scores below a small threshold, meaning nothing on the page looks meaningfully connected to the target.
- Runs entirely in the browser: every request goes straight to the live public MediaWiki API with CORS, so there's no API key, no backend, and nothing to host beyond static files.
- Shows its reasoning: the path renders as a chain of cards so you can see each hop the walker chose and how the trail got from start to finish.
Stack
Vite · React · TypeScript, talking directly to the MediaWiki API. The TF-IDF tokenizer and sparse cosine similarity are hand-rolled, ported from an earlier Python version of the same idea, and the whole thing ships as a static site on GitHub Pages.
Next a bidirectional walk that searches from both articles at once, for shorter paths on the hard pairs.