Optimization problems: "maximize (this), then minimize (that)" ie. for equal-(this) solution

64 views
Skip to first unread message

meta_leap

unread,
Nov 22, 2023, 7:28:02 AM11/22/23
to MiniZinc
I guess all of you with any SQL exposure know of the common multiple-order-by usage (ORDER BY foo ASC, bar DESC).

(For the user of course, the latter 'bar' sorting only manifests for result sets with multiple equal 'foo' values.)

In a similar fashion, I'm half-foreseeing the need for users "ranking" their solutions by multiple "priorities" in order of importance, which might translate into the equivalent of eg.

`solve minimize cost, maximize turnover, minimize time` — except that syntax won't work.

Now I'm just curious if there's a well-known already-existent constraint pattern (array of the 3 ints, with maximize turned into minimize and negated values, or some such? haven't tried) or even some built-in syntax/construct/stdlib-helper for this sort of scenario?

Of course, the calling app can always just sort in-streaming solutions itself, so this isn't perhaps too critical of a capability for native/builtin support. I'm just curious if the consideration of this has come up before in the MiniZinc/solver community and how this tends to be "best-practiced" in your experience.

meta_leap

unread,
Nov 22, 2023, 7:31:35 AM11/22/23
to MiniZinc
And now after posting I found the existing thread about this with a fine answer and a neat-enough pattern indeed: https://groups.google.com/g/minizinc/c/z2EiCK-4oFo/m/oZhcc4XnAQAJ

— so that's, well, "sorted" then..

Michael Marte

unread,
Dec 5, 2023, 2:39:56 AM12/5/23
to mini...@googlegroups.com
Hi,

you might want to try Yuck (https://github.com/informarte/yuck) which
supports lexicographic multi-objective optimization.

Best,
Michael
> --
> You received this message because you are subscribed to the Google Groups
> "MiniZinc" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to minizinc+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/minizinc/f9849730-700b-46d3-8a71-53d35657e0a6n%40googlegroups.com
> .

Reply all
Reply to author
Forward
0 new messages