An visual demonstration of the four color theorem / map solver, powered by ProcessingJS.
For more information and a demo see this blog post.
The algorithm in action:
First, the user draws on the canvas. Once finished, the process could be as follows:
- Find areas/nodes using flood fill (BFS)
- Find neighbors/edges using "marginal points" for each area and comparing distances
- Build inner graph representation
- Solve graph with Welsh-Powell and if this fails, try backtracking
- Display results on canvas