An interactive tool for exploring graph coloring reconfiguration — the study of how one valid graph coloring can be transformed into another through a sequence of single-vertex recolorings, each maintaining validity at every step.
A proper
Given a graph
-
Vertices: all proper
$k$ -colorings of$G$ -
Edges: two colorings
$\alpha$ and$\beta$ are adjacent in$\mathcal{C}_k(G)$ if and only if they differ on exactly one vertex
Two colorings
Given two proper
$k$ -colorings$\alpha$ and$\beta$ of$G$ , are$\alpha$ and$\beta$ Kempe equivalent — i.e., does a path exist in$\mathcal{C}_k(G)$ from$\alpha$ to$\beta$ ?
Equivalently: can
This problem is PSPACE-complete in general (Bonsma & Cereceda, 2009), even when
A proper
A graph
An
| Result | Statement |
|---|---|
| Cereceda's Conjecture (2007) | For |
| Cereceda–van den Heuvel–Johnson (2011) | For |
| Bonsma–Cereceda (2009) | Deciding reachability in |
| Bipartite graphs |
|
| Trees |
|
| Chordal graphs |
|
The gap between
This app provides a hands-on environment for experimenting with these ideas on small graphs:
- Build any graph — place vertices and connect them with edges
- Color vertices from a palette of 6 colors, with real-time validity checking (no two adjacent vertices may share a color)
- Record recoloring sequences — log each step as you navigate from one coloring to another, with validity status at every intermediate state
- Detect frozen states — if no single recoloring keeps the graph valid, you have reached a frozen coloring
- Export sessions — save the full recoloring path (initial coloring → sequence → final coloring) to a text file
This makes it practical to:
- Manually search for a path between two colorings in
$\mathcal{C}_k(G)$ - Construct examples of frozen colorings
- Verify whether a small graph is
$k$ -mixing for specific values of$k$ - Develop intuition for why more colors make reconfiguration easier
- Node.js 18+
- npm or pnpm
git clone https://github.com/your-username/Graph-Recoloring.git
cd Graph-Recoloring/frontend
npm install
npm run devOpen http://localhost:5173 in your browser.
| Key | Mode | Action |
|---|---|---|
A |
Add Node | Click canvas to place a vertex |
E |
Add Edge | Click two vertices to connect them |
C |
Color Node | Select a color, then click a vertex |
D |
Delete | Click a vertex or edge to remove it |
- Graph stats — live count of vertices, edges, and colors in use
-
Validity badge — shows whether the current coloring is a proper
$k$ -coloring and which$k$ -
Color palette — 6 colors (mapped to abstract color classes
$1$ –$6$) -
Recoloring log — records each step; the recording can only start and stop from valid colorings so the log always represents a valid path in some
$\mathcal{C}_k(G)$
Build the 5-cycle
Build any tree and give it a proper 3-coloring. Because
Take a graph
Pick two colors
Graph-Recoloring/
├── frontend/
│ ├── src/
│ │ ├── App.jsx # State management, validity checking, session logging
│ │ ├── components/
│ │ │ ├── Board.jsx # Canvas rendering and pointer interaction
│ │ │ └── SideBar.jsx # Controls, palette, log display
│ │ └── colors.js # Color palette (6 colors)
│ └── package.json
└── backend/
└── main.go # Go backend (planned)
- Bonsma, P. & Cereceda, L. (2009). Finding paths between graph colourings: PSPACE-completeness and superpolynomial distances. Theoretical Computer Science, 410(50), 5215–5226.
- Cereceda, L., van den Heuvel, J. & Johnson, M. (2011). Mixing 3-colourings in bipartite graphs. European Journal of Combinatorics, 32(2), 265–274.
- Cranston, D.W. & Mahmoud, R. (2022). In most 6-regular toroidal graphs all 5-colorings are Kempe equivalent. arXiv:2102.07948.
- Cranston, D.W. & Mahmoud, R. (2024). Kempe equivalent list colorings. Combinatorica.
- Cranston, D.W., Feghali, C. & Mahmoud, R. (2022). List recoloring of sparse graphs. arXiv:2201.05133.
- Nishimura, N. (2018). Introduction to Reconfiguration. Algorithms, 11(4), 52. (accessible survey)
- van den Heuvel, J. (2013). The complexity of change. In Surveys in Combinatorics 2013, Cambridge University Press.
MIT