Open seanlaw opened 2 years ago
Sorry for the late response. Although I can't understand the relationship between the objective and paths on a graph in your problem, I recommend to use an ILP solver like Gurobi for problems constrained by inequalities.
Hi @takemaru! I hope you are well. Can you please help me understand if Graphillion could be used to represent and solve the following toy problem?
Let's say that I have a discrete function that can be described as $2x{0}+3x{1}+5x{2}+5x{3} \ge 7$, where $x{i} \in \set{0,1}$. Once I find all of the combinations of $(x{0}, x{1}, x{2}, x{3})$ that satisfy this constraint, I would like to find the shortest path that minimizes the objective function $2x{0}-3x{1}+4x{2}+6x_{3}$.
For example, $(x{0}, x{1}, x{2}, x{3}) = (0, 1, 1, 0)$ would satisfy the function since $2\cdot0+3\cdot0+5\cdot1+5\cdot1 = 10$, which is greater than or equal to $7$. Next, substituting $(x{0}, x{1}, x{2}, x{3}) = (0, 1, 1, 0)$ into the objective function would result in a path length of $2\cdot0-3\cdot0+4\cdot1+6\cdot1=10$. However, this is only one solution and it is also not the shortest path!
Can you please tell me the best way to:
I'm having some conceptual trouble setting this up using the Graphillion framework. I understand that I could try to enumerate all of combinations of $(x{0}, x{1}, x{2}, x{3})$ but, in my real use case, I may have as many as $(x{0}, x{1}, ..., x{1000})$. Also, $x{i} \in \set{0, ..., 25}$ and so I was hoping that Graphillion may be a good use case.
Any help, suggestions, or code examples using Graphillion would be greatly appreciated!