About this simulation

Written by MySimulator Team · Reviewed by MySimulator Editorial Review

Last updated: 5 July 2026

This simulation visualises PageRank, the algorithm Google's founders used to rank web pages by importance. You build a directed graph of pages and links, then watch the rank scores converge either through power iteration (repeatedly applying the PageRank formula to the whole vector at once) or through a random surfer who clicks links and occasionally teleports. A damping factor d (default 0.85) controls how much rank flows along links versus how much "leaks" out as random teleportation, and dangling nodes (pages with no outgoing links) redistribute their rank uniformly so the total always sums to 1.

🔬 What it shows

Each node is a page whose rank p is repeatedly updated by p ← (1−d)/N + d·Mp, where M encodes the link structure and N is the number of pages. The node's radius grows with its rank, dangling nodes are drawn in red, and a convergence inset plots the log of the L1 change per iteration so you can see the process settle toward a stationary distribution.

🎮 How to use

Choose a preset (Textbook, Rank sink, Brin–Page example, Star graph) or build your own with the Add node, Draw edge and Delete tools; drag nodes to rearrange the layout. Switch between Power iteration and Random surfer mode, adjust the Damping slider (0.5–0.95) and Speed, then press Step for one iteration or Auto-run to watch it converge. The stats panel reports node/edge counts, current damping, iteration count, L1 change, the rank sum, the top-ranked page and how many dangling nodes exist.

💡 Did you know?

PageRank is mathematically a Markov chain: the random surfer's long-run visit frequency to each page is exactly its PageRank score. That's why the two modes in this simulation — power iteration on the rank vector and simulating an actual random walker — converge to the same numbers.

Frequently asked questions

What is PageRank and why was it important?

PageRank is the algorithm developed by Larry Page and Sergey Brin that scored web pages by treating a link from page A to page B as a "vote" for B, weighted by A's own importance. It let Google rank search results by a page's position in the overall link structure of the web rather than just keyword matching, which was a major reason its results felt more relevant than earlier search engines.

How does the damping factor d work?

The damping factor, usually set to 0.85, is the probability that a random surfer keeps following links rather than jumping to a random page. In the update formula p ← (1−d)/N + d·Mp, the (1−d)/N term spreads a small baseline rank to every page (the "teleportation"), while the d·Mp term carries rank along the actual links. Without damping, rank could get trapped forever in loops or sinks; with it, the process is guaranteed to converge.

What is power iteration and why does it converge?

Power iteration repeatedly multiplies the rank vector by the link matrix (with damping and teleportation mixed in) until the vector stops changing much. This works because the update is a linear operator with a unique dominant eigenvector — the stationary PageRank distribution — so repeated application drives any starting vector toward it. The simulation's L1 change readout and convergence graph show this shrinking difference between successive iterations.

What happens with dangling nodes or rank sinks?

A dangling node is a page with no outgoing links, so it would otherwise "trap" whatever rank flows into it. The simulation handles this by taking the total rank held by all dangling nodes and redistributing it evenly across every page each iteration, which keeps the total rank equal to 1 and prevents rank from silently disappearing. The "Rank sink" preset demonstrates a small cluster of pages that would otherwise absorb rank without damping.

How does the random surfer relate to power iteration?

The random surfer model simulates an actual walker who, at each step, follows a random outgoing link with probability d or teleports to a uniformly random page with probability 1−d. Over many steps, the fraction of time spent at each page converges to the same distribution that power iteration computes analytically, because both are describing the same underlying Markov chain. This simulation lets you compare the two: power iteration converges in a handful of steps, while the random surfer needs many more visits before its empirical frequencies stabilise.