Hello all,

I'm working on a final studies project and i'm facing some issue on the Xpress Solver.

The versions i'm using are Xpress-IVE Version 1.24.00 64bit, Xpress Mosel Version 3.4.2 and Xpress Optimizer Version 24.01.04

When i'm running the following model, Xpress return 0 on all variables, ignoring the constraints "Neighborhood" and the last of "Non overlaping" (red lines) without giving me any error message.

What is even weirder is : when i help it finding the good solution giving it x(1)=0 (not defining it as a commentary anymore, green line), it is able to return the good solution respecting all the constraints.

Here is the code i'm using :

model ModelName

uses "mmxnlp";

declarations

NC=2

I=1..NC

J=0..NC

L : array(I) of integer

x : array(J) of mpvar

Right: array(I,I) of mpvar

Left : array(I,I) of mpvar

V : array(J,J) of integer

Lc=3

R=0.5

Objective:linctr

end-declarations

L::[2,1]

V::[0, 1,-1,

1, 0,-1,

-1,-1, 0]

x(0)=0

!Expected results

!x(1)=0

!x(2)=2

!Form constraint

forall(i in I, j in I) Right(i,j)is_binary

forall(i in I, j in I) Left(i,j)is_binary

forall(i in I) x(i) is_integer

!Positionning

forall(i in I, j in I | j <> i) x(j)+(100*(1-Right(i,j))) >= x(i)+L(i)

forall(i in I, j in I | j <> i) x(i)+L(i)+(100* Right(i,j)) >= x(j) +0.1

forall(i in I, j in I | j <> i) x(i)+(100*(1- Left(i,j))) >= x(j)+L(j)

forall(i in I, j in I | j <> i) x(j)+L(j)+(100* Left(i,j)) >= x(i) +0.1

!Non overlaping

forall(i in I, j in I | j <> i) Right(i,j)*(x(j)-(x(i)+L(i)))>=0;

forall(i in I, j in I | j <> i) Left(i,j)*(x(i)-(x(j)+L(j)))>=0;

forall(i in I, j in I | j <> i) Right(i,j)+ Left(i,j)>=1

!Neighborhood constraint

forall(i in J, j in J) V(i,j)*R >= V(i,j)*sqrt(((x(i)-x(j))^2))

!Capacity constraint

forall(i in I) x(i)+L(i)<=Lc

minimize (sum(i in I) sqrt(x(i)^2))

writeln("x=")

forall(i in I) writeln(getsol(x(i)))

writeln("Right=")

forall(i in I, j in I) writeln(getsol(Right(i,j)))

writeln("Left=")

forall(i in I, j in I) writeln(getsol(Left(i,j)))

end-model

I'm looking for what might have caused that and an eventual solution.

Thank you for reading and for your attention.

Hi,

Modelling a binary variable as x*(x-1) often makes the problem impossible to solve with a local solver as it will get stuck in a locally infeasible solution; probably the reason why the solution appears to be infeasible. There is a similar problem with using the round function, which will also make the problem non-differentiable.

At the technology level, Xpress approaches a binary restriction x in {0,1} fundamentally differently then x*(x-1) = 0: the first one is treated as a MIP entity that will most likely be branched on (unless it can be fixed by implication or it happens to be 0 or 1 at the local optimal solutions) while the nonlinear constraint version is treated as a traditional problem constraint (which is not branched on in a local solver if it is converged to an infeasible point).