Open brucelit opened 1 month ago
Hi Bruce,
Happy to hear you found the crate useful! I'm not sure I would be able to work on this soon. But if you need it, it should not be too much work to include it, you can already call the direct C bindings using the ffi
module and the raw
feature. If you decide to contribute an add_cons_disjunction
method you should take a look at the other add_cons_*
methods for inspiration :)
Hi Mr. Ghannam,
thank you for your reply and hints. I will try to solve it myself and hopefully contribute to this repo.
Hi again :) First of all, please not so formal. Just Mo works π
Thinking about this again I realized it's not as simple as I first thought. One would need first to create methods that create a constraint but not add it to the model. Then use these constraints to add them to a disjunction constraint.
Hi Mo,
you are right. Actually, I found a way to bypass using disjunctive constraints by introducing additional decision variables and then using Big-M method.
Best regards,
Bruce
You could also achieve the same I think with binary variables and indicator constraints (to skip figuring out what the right M is π). Take a look at add_cons_indicator
Hi @brucelit, as an alternative approach if finding a tight big-M value is hard for your problem, indicators have received more attention and smart tricks than disjunctions, even though they are more or less equivalent: https://scipopt.org/doc/html/cons__indicator_8h.php You just need an additional binary variable mentioning whether a constraint should be active
Dear Mo and Mathieu,
thank you very much for the indicator idea. I am not an expert in linear programming, so your suggestion on this helped me greatly!
Hi Mr. Ghannam,
Thank you for this wonderful crate. I wonder whether you plan to support the disjunctive constraints of SCIP (https://scipopt.org/doc/html/cons__disjunction_8h.php) soon?
My LP problem requires satisfying at least one of the constraints, and I hope to implement a solution in Rust. For now, SCIP seems to be the only available choice.
A disjunction constraint πΆ is a constraint of the form
πΆ=πΆ1β¨β―β¨πΆπ
where all the πΆπ are individual constraints themselves.
Best regards,
Bruce