Four Color Theorem in Grasshopper

Hello
indeed there was many bugs, but the logic I choose has also a flaw in my algorithm because with Voronoi it doesn’t allow just 4 colors. So when I can’t I put an index = -7 (there is no logic here 4 must be better) .
Here I colorize in White the cell with problem


But it is sometimes possible to fin a seed that doesn’t rise the problem, here 87

Some add in the implementation, still need to play with seed if there are some white cells. With 300 Voronoi cells there is 25 % of case with some bad coloring.
FourColors_Legacy.gh (35.5 KB)
Happy coloring.
And I discovered the Animation menu in Slider, I neither used it since so many years !!!
Frame_

2 Likes