scipopt / scip

SCIP - Solving Constraint Integer Programs
Other
366 stars 63 forks source link

Adding an example of setting a quadratic objective #57

Closed dhruv-sharma2 closed 2 weeks ago

dhruv-sharma2 commented 12 months ago

The documentation could be served well by adding an example of how one should add a quadratic objective function. While there is documentation for the API reference, it is very difficult to parse through all the possible handlers and find the right one. For instance here: https://www.scipopt.org/doc/html/group__CONSHDLRS.php#gad3707e7f7166bea83b7713cf2e52b0db

Even from here it isnt clear how a quadratic objective function should really be defined.

svigerske commented 12 months ago

SCIP only supports linear objective functions. For any other, you'll have to reformulate as a constraint.

The callable library examples were intended to give some help on how to use constraint handlers, though it is only cons_nonlinear at the moment. Circle packing is one that sets up quadratic constraints.