This tool allows you to explore partitions of grids and measure the number
of cut edges of each partition.
Instructions:
Grid Setup: The first set of inputs controls the dimensions of the grid and the number of colors to use.
Initial Coloring: The next set controls the choice of initial coloring. Random, stripes, and empty are reasonably self-explanatory. If you select "Input Your Own" the coloring will start with
the labels you input in the "Initial Coloring" box, otherwise this is ignored. I put together a nice starting example for the 5x5 to start you off.
Color Choice: Whenever you change the settings above, a new random list of colors is generated. You can enter your own choices by replacing any of the ones listed in the terminal (particularly if it generated two colors that were too similar) and pressing the enter key. The full list of
allowed color names can be found here.
Changing Assignments: Changing values in the assignments matrix and pushing the submit button will update the colors in the plot and the population and cut edges computations below.
Toggling the "Highlight Cuts" box will display the cut edges in red on the graph.
Exporting Colorings: If you make a coloring you particularly like, you can press the final checkbox to write the labels to the screen. This will allow you to copy this coloring
and paste it into the "Your Matrix" box.
Activity:
Given a fixed grid and number of colors can you find the coloring with the minimum number of cut edges?
The stripes coloring is a usually a good starting place but you can frequently do better.
For example, for the 9x9 grid with three colors, the stripes configuration has 18 cut edges but you can find other colorings with 16.
The matrix for one of these colorings is hidden in the page source.