How to add Lazy Constraints and Callbacks in MATLAB?
回答済みHow can I add Lazy Constraints and Callbacks to a Gurobi model in MATLAB? The specific problem is subtour elimination in Traveling Salesman Problem.
I understand the Python example (https://gurobi.github.io/modeling-examples/traveling_salesman/tsp.html) but unsure how to implement this in MALTAB with callbacks.
-
正式なコメント
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?. -
The MATLAB API does not support callbacks. If you want to solve the TSP this way, you would have to use another API like Python, C, C++, Java, or .NET.
In MATLAB, you can specify certain constraints to be lazy constraints by setting the Lazy constraint attribute (see here). This unfortunately won't help you solve the TSP, because these lazy constraints must be added to the model before solving.
0 -
Thank you for the answer!
0
投稿コメントは受け付けていません。
コメント
3件のコメント