Rotor Router Model, version 1.0


Welcome to this page. We'd like to show off a mathematical model (the Rotor Router Model) using a java applet. If you haven't installed Java on your computer, you can get it here. Please restart your browser after installation.

[a bug] The model involves a bug moving along a directed graph. The nodes of the directed graph are represented by boxes, and the arcs between nodes are represented by arrows (sometimes not shown). The bug itself is represented by a hollow square; a hollow square doesn't look much like a bug, but we chose this symbol because it enables you to see some information that's shown inside the box occupied by the bug.
[a rotor] Each box in the graph contains a rotor that can be in different states. These states are represented by colors and arrows. (The color of a box conveys the same information as the arrow; but as you use the applet in a variety of modes you'll see why this redundancy is helpful.) When a bug arrives at a box, the state of that box changes: the arrow rotates to point in a new direction, and the color changes in a corresponding fashion. Then the bug leaves the box, traveling in the direction indicated by the (new) state of the arrow in that box.

To get started, jump to the Applet and click the step button repeatedly and watch how the bug moves around the graph.

If you are confused, try our walkthrough.

When you start to use the applet, you may find that it is the wrong size for the window. If changing the size of your window doesn't solve the problem, try changing the size of the applet. Allowed sizes are small (default), medium, and large.

If you cannot see the applet, please try the small, medium, or large non-double-buffered version. For more information on this issue, please refer to the Extras section.


The Rotor Router Applet


A description of the Algorithm

The Rotor Router Model is composed of a directed graph (infinite or finite) with a rotor attached to each vertex. The rotor at a given vertex is a pointer to one of the edges that leaves that vertex. In the model, a bug traverses the graph along the edges, following the direction of the rotor at each vertex.

The twist is that each time a bug visits a vertex, she rotates the rotor so that it points to the next edge, before following the rotor.

This is a deterministic system.

This model has two variations: the walk mode and the aggregation mode.

In the walk mode, the bug will traverse the graph until she encounters a sink. A sink is a vertex with no edges leaving it, If there is a sink in the system, it has no rotor on it. If a bug visits a sink, she disappears from the system. After that happens, we put a new bug on some specified vertex, called the source.

In the aggregation mode, all vertices start out empty; once a bug hits an empty vertex, the vertex is filled and it gets a normal rotor on it. Then the bug returns to the source. For this mode to be interesting, we need a graph with an infinite number of empty vertices.


Graphs and Modes



To switch between graphs, choose one from the drop-down menu and hit “Reset”.

Pressing the Step button increments the system by one step. The bug alternates between moving to the next vertex and moving a rotor each step.

The Stage button increments the system until a bug hits a sink (or, in the case of aggregation, a new site becomes occupied). A stage is made of many steps.

The Reset button resets the system to the initial state and zeros out any counters.

The Pause/Unpause button controls the automated iterations. If the applet is unpaused, the system will increment by steps or stages, according to the Skip Each variable.



  1. James Propp, “Random walk and random aggregation, derandomized” (Talk given at Microsoft Research). video:
  2. James Propp, “Rotor-Router Automata” (An early write-up of derandomized aggregation).
  3. James Propp, “Rotor Router Walk” (Email-log of some messages sent out about derandomized walk).
  4. Lionel Levine, “The Rotor-Router Model” (undergraduate thesis).
  5. Lionel Levine, “The Rotor-Router Model” (slides from a talk).
  6. Lionel Levine and Adam Kampff. “Rotor-router aggregation blob after 270,000 particles have aggregated” (Image).
  7. Lionel Levine and Adam Kampff. “Two close-ups of that same picture” (Image).
  8. Ed Pegg. “The rotor-router blob after 750,000 particles have aggregated” (Image).
  9. Ander Holroyd. “The rotor-router blob after 1,000,000 particles have aggregated” (Image).
  10. Vishal Sanwalani. “The state achieved by the abelian sandpile model when sixty thousand grains have been added” (Image).


Known Bugs

  1. There is a display bug with Apple JVM 1.4, used by current versions of the Safari Browser. If you experience this issue, please use the non-double-buffered version of this applet:

    Normal: small | medium | large.
    No Double Buffer: small | medium | large.

  2. You may notice another display bug when switching between the applet and other applications on Mac machines. We recommend staying on this page until you are done.

  3. Because different browsers render the applet differently, in some cases the pull-down box after the "Skip Each:" label may get pushed down to the next row. You can still choose the step level from the pull-down box.

  4. There are built-in limits to how big the 2-D systems can become. When they hit that limit, they will stop, even if the stage is not done. For more information, read the code.

System Requirements

The applet as designed with Java 1.1 in mind, so all browsers back to 1998 should be supported. But we cannot make any guarantees. You may want to maximize your browser window if you want to see the whole applet.


This work was written by Hal Canary and Francis Wong. It was supported by the University of Wisconsin-Madison.

This work comes with ABSOLUTELY NO WARRANTY. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation.

Source: tarball and zipfile. Programmer's documentation. Readme file.

Valid html?

Give us feedback! Send mail to Hal Canary «hal at ups dot physics dot wisc dot edu», Francis Wong «yutai at cae dot wisc dot edu, and Jim Propp «propp at math dot wisc dot edu».