🕸️

Combinatorics & Graph Theory

Colour any map with 4 colours, solve the Königsberg bridge problem, find the minimum spanning tree — discrete mathematics made tangible through live graph visualisations.

7 simulations Graph Algorithms NP-Hard · Greedy · SA

Simulations

Open any simulation — runs instantly in your browser

🔢
New★☆☆ Beginner
Pascal's Triangle
Interactive Pascal's triangle with binomial coefficients. Explore parity patterns forming Sierpiński fractals, mod-N colorings, Fibonacci diagonals, and triangular number highlights.
BinomialSierpińskiFibonacci
🗺️
Popular★★☆ Moderate
Travelling Salesman Problem
Greedy nearest-neighbour, 2-opt local search and simulated annealing competing to solve TSP. Watch tour length decrease over generations — the quintessential NP-hard graph problem.
NP-HardSA2-opt
🔍
Popular★☆☆ Beginner
Graph Pathfinding — A*, Dijkstra, BFS
Interactive grid where you paint obstacles, set source/target and watch A*, Dijkstra and BFS explore. Compare node visit counts and path quality live.
A*DijkstraHeuristic
🏗️
★☆☆ BeginnerNew
Maze Generation Algorithms
DFS backtracker, Prim's, Kruskal's (random MST) and Wilson's algorithm grow mazes cell by cell. Each generates a different spanning tree of the grid graph.
MSTDFSPrim
🧬
★★☆ Moderate
Genetic Algorithm
Evolve solutions to combinatorial optimisation problems via tournament selection, order crossover (OX) and swap mutation. Fitness histogram updates live.
GAOXEvolution
📊
★☆☆ Beginner
Sorting Algorithm Race
12 comparison-based and non-comparison sorting algorithms race on the same input. Hear each swap as a tone and observe Θ(n²) vs Θ(n log n) scaling.
ComparisonBig-OCanvas
🌀
★☆☆ Beginner
Number Spirals & Combinatorial Patterns
Ulam spiral, Sacks spiral and polar coordinate number sequences reveal prime distribution patterns — a beautiful intersection of combinatorics and geometry.
PrimesSpiralCanvas
🤝
★★☆ Moderate
Network Formation Game Theory
Agents form pairwise links maximising personal utility — equilibrium network structures emerge (stars, cycles, complete graphs) governed by combinatorial stability conditions.
NashGraphAgents
🎨
New★★☆ Moderate
Graph Coloring — Chromatic Number
Greedy, Welsh-Powell and DSatur algorithms colour graph vertices so no two adjacent vertices share a colour. Explore the chromatic number χ(G) on classic graphs: Petersen, K₅, cycle and bipartite.
χ(G)Welsh-PowellDSatur

Related Articles

Related Categories

About Combinatorics & Graph Theory Simulations

Graph traversal, permutations, TSP, Euler paths, and counting — live

Combinatorics and graph theory simulations visualise the structure of discrete mathematical objects and the algorithms that operate on them. Graph-colouring simulations apply greedy and backtracking algorithms to assign colours to graph vertices with no two adjacent vertices sharing a shade, demonstrating the four-colour theorem and NP-completeness. Eulerian and Hamiltonian path finders show the algorithmic difference between traversing every edge once versus every vertex once.

Permutation and subset enumeration visualisers animate the systematic generation of all arrangements and selections from a set, building intuition for n! and 2ⁿ growth rates. The Travelling Salesman Problem simulator compares nearest-neighbour heuristic, 2-opt, and branch-and-bound solutions on random point sets, showing the exponential hardness versus polynomial approximation trade-off. These models serve combinatorics courses, algorithm design students, and competitive programmers.

Each simulation in this category is built with accuracy and interactivity in mind. The underlying mathematical models are the same ones used in academic research and professional engineering — just made accessible through a web browser. Changing parameters in real time and observing the results is one of the most effective ways to build intuition for complex scientific and engineering concepts.

Key Concepts

Topics and algorithms you'll explore in this category

Graph ColoringGreedy and backtracking k-colorability on planar graphs
Travelling SalesmanNearest-neighbour, 2-opt, and simulated annealing TSP
Minimum Spanning TreeKruskal's and Prim's algorithms in real time
Euler / Hamiltonian PathsFleury's algorithm and backtracking search
Network FlowMax-flow / min-cut via Ford-Fulkerson
Permutations & CombinationsCounting principles and combinatorial explosions

Frequently Asked Questions

Common questions about this simulation category

What combinatorics problems can I simulate?
Graph coloring (k-coloring), TSP with heuristics and metaheuristics, minimum spanning trees (Kruskal, Prim), Eulerian and Hamiltonian path finding, and max-flow/min-cut network optimisation.
How does the TSP simulation work?
Nodes are placed on a 2D canvas. You can run nearest-neighbour greedy construction, then improve with 2-opt local search. Simulated annealing adds probabilistic hill-climbing to escape local optima.
Can I add my own graph nodes?
Most simulations let you click to add or drag nodes. Edge weights are computed from Euclidean distances automatically.