MPQuadraticObjective

85 views
Skip to first unread message

Emmanuel Seve

unread,
Jan 17, 2022, 5:14:59 AM1/17/22
to or-tools-discuss
Hi all,

I'm searching an example in Java with a quadratic objective function.
I didn't found one so far. 

I'm using the MP-solver with the SAT backend.

I wonder if the quadradic objetcive works with the SAT backend since there 
is only integer variables ? I have the possibility to use the GLOP backend (so with only double variable) if needed.

Emmanuel

Laurent Perron

unread,
Jan 17, 2022, 5:28:09 AM1/17/22
to or-tools-discuss
Glop is a linear simplex solver. So no quadratic.
SAT supports quadratic objective, but only discrete variables, but not through the proto API :-(
Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/1d5c27de-ec4b-4577-9650-2e7b5ab95b53n%40googlegroups.com.

Emmanuel Seve

unread,
Jan 17, 2022, 5:44:24 AM1/17/22
to or-tools-discuss
Encore merci Laurent pour cette réponse super rapide

So what is the solution to use MPQuadraticObjective defined here :


?

Laurent Perron

unread,
Jan 18, 2022, 1:50:05 AM1/18/22
to or-tools...@googlegroups.com
option 1: Fill the proto manually. Solve with MPSolver::SolveWithProto(model_request, &response).
It only works with SCIP and Gurobi.

option 2: use the CP-SAT API directly with the AddMultiplicationEquality() method.

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00


Reply all
Reply to author
Forward
0 new messages