Minzinc: recursive objective function

26 Views Asked by At

I have a formula like this: Formula

The problem I'm trying to model is to find the path among different paths that has the maximum value of a function (I'm not specifying more because I don't think it is necessary).

The main problem I'm facing is that this function is like a recursive one. To compute the final value I will need the value of the previous step. To compute the value of this previous step I will need the value of the step before... And so on. To give an idea, using the formula I get the deltaY that becomes the deltaX in the next step.

My variables are two arrays which are the indexes in a matrix where I can find the values of x and y in the formula. Each tuple of values in this two arrays are the coordinates in this matrix. Such that, for example, for step 1: x = matrix[a[1], b[1]], y = matrix[b[1], a[1]] The first value of deltaX is a problem input.

How can I write such a function in Minizinc?

0

There are 0 best solutions below