custom search constraints and symmetry breaking with cp/sat

466 views
Skip to first unread message

Waseh Ahmad

unread,
Feb 11, 2019, 1:39:06 AM2/11/19
to or-tools-discuss
Although its recommended to use the cp/sat solver instead of the original cp solver, I cant seem to find as much flexibility in the cp/sat solver such as
1. Defining custom constraints
2. Symmetry breaking (apart from setting constraints)

Is there any resolution to the two issues above? im currently making a solver for heavy density graph_coloring problems and wanted to redefine the search to branch off the vertix with the highest degree, and also to break symmetries such as 2 0 1 1 --> same as 0 1 2 2

thank you!

Laurent Perron

unread,
Feb 11, 2019, 2:58:04 AM2/11/19
to or-tools-discuss
1) Writing custom constraints it too complex. But I believe that with literals, Boolean logic, and reified constraints + allowedAssignments, we can encode most of the missing constraints.
For instance, the reservoir constraint is fully expanded at the start of the search and does not exists internally.

2) This is ongoing, unfortunately, we did not have time to work on this lately. It will happen.. eventually.
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.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Ivan Dotu

unread,
Feb 11, 2019, 7:30:36 AM2/11/19
to or-tools-discuss
Hi Waseh,
in terms of ordering the nodes you can use AddDecisionStrategy. Just add the node variables in the order of their degree and use SELECT_FIRST.

ivan

Waseh Ahmad

unread,
Feb 11, 2019, 11:03:02 PM2/11/19
to or-tools-discuss
ah okay, thank you for your help to the both of you!
yup, ordering does improve the results
I'll dig a bit deeper on how to break symmetries for this problem using constraints
Reply all
Reply to author
Forward
0 new messages