Hello

When trying to solve my job shop scheduling problem, Gurobi 8.11 says its solved [Status: Solved

Optimal value (cvx_optval): +0] but optimal value is 0 while cvx supplied Gurobi 7.52 [Status: Infeasible

Optimal value (cvx_optval): +Inf] says the model is infeasible. I have formulated the exact same problem in AMPL and solved using CPLEX. Likely there is something wrong with the formulation, but I went through each and every constraint and loop that I could to check what is going on but could not find any errors (likely my MATLAB understanding has failed me) using my debugging techniques. I tried using other bundled solvers but they failed as well. I am attaching a reproducible codes without any comments but I can provide comments and expansions (or what the constraints should actually look like) in case that is needed.

{

P = 32;

S = 5;

M = 2;

J = 4;

DemandCharge = [10];

RollingWindow = [1];

ProcTime = [10 9 10 9];

TA{1} = [1 2];

TA{2} = [2 3 4];

TA{3} = [3 4 5];

TA{4} = [3 4 5];

TA{5} = [1 5];

ProcState = [4];

TransitionStates = [2 5];

OffState = [1 5];

TransitionTime = [0 5 0 0 1];

EnergyPrice = [0.034 0.027 0.032 0.035 0.035 0.037 0.036 0.039 0.039 0.040 0.052 0.074 0.050 0.094 0.100 0.084 0.090 0.074 0.094 0.084 0.027 0.091 0.045 0.048 0.045 0.040 0.031 0.039 0.070 0.027 0.080 0.092];

EnergyDemand = [0 5 2 6 1];

cvx_begin

variable W(M,S,P) binary;

variable X(M,J,P) binary;

variable Y(M,J,P) binary ;

variable Z(M,S,P) binary;

variable d Nonnegative;

variable DemandCost Nonnegative;

variable MainCost Nonnegative;

```
minimize ((DemandCost) + (MainCost);
subject to
DemandCost == DemandCharge * d;
for i = 1:M
for s = 1:S
for p = 1:P
MainCost == sum(sum(sum(W(i,s,p) .* EnergyDemand(s) .* EnergyPrice(p))));
end
end
end
for i = 1:M
for s = ProcState
for p = 1:P
sum(X(:,j,:)) == sum(W(:,ProcState,:));
end
end
end
for i = 1:M
for p = 1:P
for s = 1:S
sum (W(:,s,:)) == 1;
end
end
end
for i = 1:M
W(i,1,1) == 1;
end
for i = 1:M
for p = 1:P-1
for s = 1:S
for k = TA{s}
W(:,:,:) <= sum (W(:,k,p+1));
end
end
end
end
for i = 1:M
for p = 1:P
for j = 1:J
sum (X(:,j,:)) <= 1;
end
end
end
for j = 1:J
sum(sum(Y(i,:,p))) == 1;
end
for i = 1:M
for j = 1:J
for p = 1:P - ProcTime(j)
for k = p:p + ProcTime(j)
Y(i,j,p) .* ProcTime(j) <= sum (X(:,:,k));
end
end
end
end
for p = 1:P - RollingWindow
for k = p:p + RollingWindow
(1/RollingWindow) * (sum(sum(sum(W(i,s,k) .* EnergyDemand(s))))) <= d;
end
end
for i = 1:M
for s = TransitionStates
for p = 2:P
W(:,:,p) - W(:,:,p-1) <= Z(:,:,p);
end
end
end
for i = 1:M
for s = TransitionStates
for p = 1: P - TransitionTime(s)
for t = p: p + TransitionTime(s)
TransitionTime(s) .* Z(i,s,p) <= sum (W(:,:,t))
end
end
end
end
for i = 1:M
for k = OffState
for p = P - TransitionTime(5)
sum (W(:,k,:)) == 1;
end
end
end
cvx_end
}
```

Is the problem actually infeasible this way or there is problem with my solver or setup? How can I reformulate it? I have also attached picture of actual mathematical representation of the model.

I would greatly appreciate any input or feedback and even general advice.

Thank you in advance!!