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.

Thursday, July 6, 2023

A Julia thingy

 In Julia, we can write 2x instead of 2*x. Not the most earth-shattering. But a bit special nonetheless.



The expression in the last cell is interpreted as a function call.

Sunday, July 2, 2023

Some confusion here

Sometimes you end up visiting strange sites. This is a question & answer site. The question is:



Obviously, this is not a good question. It is something like "what is the difference between a ham sandwich and butter?".

The answers are not so good either.