How to implement callback with 2 constraints
進行中Hello,
I desperatly try to implement a callback with 2 lazy constraints in one algorithm. If I drop one of them the algorithm works fine but with both in the callback the solution doesn't satisfy any of them.
Alternatively it would be enough if I could use 2 callbacks but this doesn't seem to be intended by Gurobi.
What I actually want to do is that certain pairs of points are connected (first constraint):
But from each pair one node has to be connected with other nodes such that this set of coonnected points has the same number of blue and red vertices (2nd constraint):
(the red in the middle doesn't count since it is the partner of the one below)
But using both constraints togehter give me:
This is kind of a mix of both constraint and at least the first isn't fulfilled but I also have examples where the 2nd isn't fulfilled.
I hope someone can help me.
Best regard,
Niklas
-
正式なコメント
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi Niklas,
That sounds weird, but I'm afraid without seeing any actual code, we cannot really help you out. Please try to share a minimal reproducible example.
Cheers,
Matthias0 -
Hi Matthias,
thank you for having a look on my problem.
I just noticed that the problem was on a different point where a Gurobi integer variable was 0.999 but i just tested if it is >=1. After fixing this rounding issue the program works as it should.
Sadly this never occured on instances where I just used one callback so I thought thats the issue.
Have a great day,
Niklas
0
投稿コメントは受け付けていません。
コメント
3件のコメント