0

I have a clingo program that comes with multiple soft constraints distributed by different weight.

maximize {1@100, X: constraint1(X)}.
minimize {1@70, X: constraint2(X)}.
.
.
.
minimize {1@1, X: constraintK(X)}.

As the program runs, the optimiser does something like this (Cost of model):

(1,0,0,...,0) => (2,1,0,...,0) => (2,0,0,...,0) => (3,1,1,...,1) => (3,0,1,...,1)

I hope the example is clear. What happens here is that the solver tries to optimise all soft constraints at once. As in, it starts to optimise constraint2 onward before constraint1 is fully optimised. What I would like the program to behave on the other hand is to have the solver to optimize the constraints coming first before moving on to the other constraints. For example:

(1,0,0,...,0) => (2,1,0,...,0) => (3,2,1,...,0) => ... 
=> (99,75,30,...,70) # at this point optimal for constraint 1 is reached
=> (99,70,29,...,70) # start optimising 2nd constraint
=> ...
=> (99,46,19,...,43) # optimal for constraint 2 reached, optimising 3rd constraint etc

Is there anyway to achieve such behavior? Or is it fundamentally against ASP paradigm?

ILoveET
  • 109
  • 1
  • 6
  • From the clingo documentation: "If there are multiple optimization statements or priorities, respectively, clasp or clingo) will report separate optimization values ordered by priority". So you want to optimize one constraint at the time? If so, you can try multi shot and adding one optimization statement at the time, iteratively – damianodamiano Aug 22 '23 at 14:45
  • Thanks for the quick response, I'll revisit the Multishot ASP to understand more about it. It seems like my presumption of "clingo does soft constraints in lexicographical order" is wrong from the beginning. Just putting it down, the way I expected is as follow: if a model yields the score [100] without 2nd SC, the bare minimum of a model with 2nd SC should be [100, 0] (assuming it is trying to maximize the score) where it gets 0 reward upon 2nd SC. The observation is that clingo just tries to optimize both params at once and ends up stuck at something [40, 40] – ILoveET Aug 23 '23 at 05:06

0 Answers0