# Why getting Infeasibility row despite it is not!?

I have a basic vehicle routing problem (VRP) model that I aim to solve using CPLEX and JuMP. Although I manually verified that the problem configuration(including the number of customers, drivers, locations, and costs) is feasible, the JuMP solver generates an Infeasibility row " `ERROR: syntax: extra token "row" after end of expression`" which corresponds to one of the routing constraints that require every individual to reach their destination, Mathematically

`sum(x[i,j,d] for (i,j,d) if (j==destination[d]) == 1) for all d`.

The output displays an associated equation in JuMP forms is:

`Destination_constraints["6d"] Destination_constraints["6d"]: x[(5, 2,"6d")] + x[(8, 2, "6d")] + x[(11, 2, "6d")] + x[(3, 2, "6d")] == 1.0`
where `"6d"` is the id of the one of the drivers. Clearly, the LHS indicates three decision variables that can take a value of one, and the RHS is one. But it show the error of:

``````julia> Infeasibility row 'Destination_constraints["6d"]':  0  = 1.
ERROR: syntax: extra token "row" after end of expression
Stacktrace:
[1] top-level scope
@ none:1
``````

I ran it for a number of other instances and there was no issue. What could be the problem here , and how can it be resolved?

You are getting a syntax error.

It looks that you are pasting the string `Infeasibility row 'Destination_constraints["6d"]': 0 = 1.` into the Julia REPL. This is not a valid Julia code so you are getting a syntax error.

@barucden I’m almost sure that the code and syntx is a valid one. It’s the following and it has no error with other instances.

``````@constraint(model, Destination_constraints[d in Dset],  sum(x[(i, j, d)] for (i, j, d) in Edge_set[d] if  j==  Destination[d]) ==1)
``````

where the `Edge_set` is a dict that nap every `d` to a list of tuples in form `(i,j,d)`
similarly Destination is a dict that nap every `d` to destination node, and Dset is a list of all of taxi-drivers.

You are mixing two things.

One is that no solution has been found for your optimization task. I don’t know how to solve that, it might be useful to see the whole program.

Another is that you are seeing a syntax error, which has nothing to do with JuMP or your optimization task. Based on your first post:

it appears that you ran an invalid Julia code (`Infeasibility row 'Destination_constraints["6d"]': 0 = 1.`) in the REPL so you see the syntax error. Perhaps you did not mean to do that.

3 Likes

Do you have any suggestion to debug it? I honestly have no idea why for “6d” I cannot see a solution but excluding this one and working with for example “1d”, “2d”,…“205d” has an optimal solution.
What is exaclty confusing for me is that is return `0==1` and by `0` it means the LHS of the relevant constraints which is `Destination_constraints["6d"]` which is the same as `: x[(5, 2,"6d")] + x[(8, 2, "6d")] + x[(11, 2, "6d")] + x[(3, 2, "6d")] ` becomes zero. But Ido not see any conflict between having a value of one for any of the variable above (like `x[(5, 2,"6d")] `) and the rest of the solutions.

Any idea for debug would be appreciated

Can you provide a reproducible example? The `0 == 1` constraint suggests that you have a constraint for which

``````@constraint(model, Destination_constraints[d in Dset],  sum(x[(i, j, d)] for (i, j, d) in Edge_set[d] if  j==  Destination[d]) ==1)
``````

is empty on the left-hand side.

Thanks@odow, I have attempted to create a small, reproducible instance of the problem but have been unsuccessful. Interestingly, in the equation that I was working with, the left-hand-side was not empty. Specifically, it was of the form Destination_constraints[“6d”] Destination_constraints[“6d”]: x[(5, 2,“6d”)] + x[(8, 2, “6d”)] + x[(11, 2, “6d”)] + x[(3, 2, “6d”)] == 1.0.

Not sure but after isolating just “6d” and examination of related constraints, it appears that one of the constraints has an inappropriate Big-M value, which is causing a conflict. But what this has do with non-empty LHS is ambigious part of it.

I have attempted to create a small, reproducible instance of the problem but have been unsuccessful

See the tips here: Debugging · JuMP

The general method is to solve your problem. Double check it’s infeasible. Comment out a constraint. Re-solve. Etc.

For example you could try

``````# @constraint(model, Destination_constraints[d in Dset],  sum(x[(i, j, d)] for (i, j, d) in Edge_set[d] if  j==  Destination[d]) ==1)
@constraint(model, Destination_constraints[d in ["6d"]],  sum(x[(i, j, d)] for (i, j, d) in Edge_set[d] if  j==  Destination[d]) ==1)
``````

It that’s still infeasible, keep going. If not, then the problem is elsewhere, and the error message from CPLEX is misleading.

It might be that CPLEX has presolved out some variables, and the error is coming from the presolved version of the model, not the original model that you input.

2 Likes