Lexicographic Constraint in CPSATLP

247 views
Skip to first unread message

Pierre Savéant

unread,
Dec 19, 2023, 4:41:59 AM12/19/23
to or-tools-discuss
Hi,

Is there an equivalence in Python for the MakeLexicalLess constraint proposed in the C++ reference guide of CP-SAT?

Arguments: const std::vector<IntVar*>& left, const std::vector<IntVar*>& right

Creates a constraint that enforces that left is lexicographically less than right.


Thanks


Pierre



Laurent Perron

unread,
Dec 19, 2023, 5:08:51 AM12/19/23
to or-tools-discuss
This is not part of CP-SAT, even in c++.

--
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/cefa8055-f29d-42c1-b18c-40f52e9f4fdcn%40googlegroups.com.

Pierre Savéant

unread,
Dec 19, 2023, 5:11:40 AM12/19/23
to or-tools-discuss
But it is available in MiniZinc and run well with cpsatlp ; It must be decomposed?

Laurent Perron

unread,
Dec 19, 2023, 7:47:02 AM12/19/23
to or-tools...@googlegroups.com
It is. Not a complex constraint. A chain of implications.

It has been done and explained, I think, in this mailing list.
Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



Luca Gangini

unread,
Apr 10, 2025, 6:02:51 AM4/10/25
to or-tools-discuss
Laurent, I read in your message "It has been done and explained, I think, in this mailing list.". Can you please point me to the explanation you are referring to? I did an implementation myself, but it is pretty slow and I think it could be done better.
Reply all
Reply to author
Forward
0 new messages