Showing posts with label Coloring. Show all posts
Showing posts with label Coloring. Show all posts

Wednesday, July 12, 2023

Coloring edges of a grid

This is a little coloring problem from [1]:

Given an m * n grid, each edge must be colored. However, there are 2 constraints:

  1. Entire grid must use only 3 unique colors
  2. Each square in the grid must be colored using exactly 2 colors (2 edges per color)


Let's try to build a GAMS model for this. The question itself is not so interesting, but the modeling for setting up these grids is.