Hi Everybody!

I'm fairly new to Xpress and had to develop an ILP for my thesis and calculate it with Xpress.

Now I am stuck on a formula I don't know how to express within the Mosel language. Maybe you guys can help me.

It's about assigning referees to the right matches within a soccer season

the formula:

1/Tr (forall m in M) ∑ d(r,m) + x(r,m) - 1/T^r (forall m in M) ∑ d(^r,m) + x(^r,m) <= dmax for all r, ^r in R

Tr is a target value and is given

d(r,m) is the distance between referee r and match m

dmax is the maximum difference each referee is allowed to have to each other

x(r,m) is the wanted variable if referee r is assigned to match m or not

M and R are just the sets - 180 Matches, 10 Referees (Austria, small country )

I don't know how to compare each referee with each other referee within the Mosel system...

any ideas?

You would need a declaration like

declarations

Tr, Thatr, dmax: real

M,R: set of string

x: array (R,M) of mpvar

d: array (R,M) of real

my_constraint: array(R,R) of linctr

end-declarations

Then you need to read/assign the data and your constraints would look like

forall(r,hatr in R) do

my_constraint(r,hatr):= 1/Tr * sum(m in M) d(r,m)*x(r,m) - 1/Thatr * sum(m in M) d(hatr,m)*x(hatr,m) <= dmax

end-do

I assume you would want * in between the d(r,m) and the x(r,m) instead of +