Optimization of a colour graph

39 Views Asked by At

Formulate as a discrete optimization problem:

Label each node of the graph with a different non negative integer number, in such a way that the numbers of the nodes of each path composed of the same color edges add the same and the total sum be minimum.

I have all the restrictions except that one that makes the variables take different values. I don't know how to do because it must be a linear equation.

enter image description here

1

There are 1 best solutions below

2
On

EDITED: Take an integer $M \ge 9$ such that you think there is an optimal solution with largest number at most $M$. Define boolean variables $x(i,j)$, where $x(i,j) $ is to be $1$ if node $i$ is assigned integer $j$, otherwise $0$. The constraint $\sum_{j=0}^{M} x(i,j) = 1$ implies that each node $i$ is assigned one integer. The constraint $\sum_{i=1}^{10} x(i,j) \le 1$ implies that each integer is assigned to at most one node.

Note that any solution with largest number $ M$ will have sum at least $0+\ldots+8+M = M + 36$. If your first guess at $M$ allows a solution with sum $S$, and $S > M + 36$, then try again with $M = S - 37$.