Understanding Fundamental Differences Between MIP and CP Solvers in or-tools Context

224 views
Skip to first unread message

Shanwen Pu

unread,
Jan 20, 2024, 12:21:07 PM1/20/24
to or-tools-discuss
I was using MIP solver like GUROBI, COPT, CPLEX a lot and recently I'm turning to or-tools to solve some difficult VRPTW problems. 
I find that MIP solver and CP solver (including or-tools) have a lot in common and MIP solver is better for problems with continuous variables, however, CP solver is better for problems with complex constraints that can't be formulated into linear constraints, etc.

However, during MiniZinc challenges, I observed distinct differences in problem-solving capabilities between these solvers. I want to know when I should choose a MIP solver andwhen I should choose a CP solver.

BR,
SW

Laurent Perron

unread,
Jan 20, 2024, 1:08:07 PM1/20/24
to or-tools-discuss
Have you checked cp-sat on minizinc ?

--
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/fb185024-733e-4e9b-9896-2a5976e884c4n%40googlegroups.com.

SW.P

unread,
Jan 20, 2024, 1:15:52 PM1/20/24
to or-tools-discuss
Yes. I know or-tools is the fastest among all the solvers in vrplc benchmark( I assume this's the vrp related benchmark). But I kind of can't understand why it's much faster than other solvers, especially MIP solvers. I come here to wonder whether you have intuition behind when should I use CP-SAT(or-tools) and when should I use gurobi.

Laurent Perron

unread,
Jan 20, 2024, 2:49:24 PM1/20/24
to or-tools...@googlegroups.com
CP-SAT is a CP and a (non-mixed) integer linear programming solver. It has techniques from both world.
It is currently the best CP solver and a very good ILP solver.
It does not support continuous variables (unless they are implied integers). In that case, use Gurobi.

On the minizinc benchmark, I would consider gurobi to be slightly better on pure linear problems, and CP-SAT to be better on all CP problems.

And last but not least, Gurobi is a commercial (and expensive) solver. So for commercial applications. it will matter. 
Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



Shanwen Pu

unread,
Jan 20, 2024, 3:11:05 PM1/20/24
to or-tools...@googlegroups.com
Thanks a lot.

You received this message because you are subscribed to a topic in the Google Groups "or-tools-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/or-tools-discuss/NoGdc_MiXT0/unsubscribe.
To unsubscribe from this group and all its topics, 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/CABcmEeZaN7TSe-zHBnjq1VJ%3DFQR%2BZJrA4ZWwporK7yRXhcw0kw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages