Updated response based on OP's clarifications
Something interesting is going on. When I solve the exact same IP that you posted above, all the constraints are being met.
Value of objective function: 532.00000000
Actual values of the variables:
x0 0
x1 0
x2 0
x3 0
x45 0
x54 0
x63 0
x32 0
x40 0
x48 1
x56 0
x33 0
x41 0
x49 0
x57 1
The good news is that the Obj function value is the same. Here's what you can try and you will catch what's going on. Your problem is highly degenerate.
Somehow lp_solve
is not seeing your x45=0 constraint.
Diagnose using the -stat option
Here's how can see what's going on: create two LP files.
- The original lp (say original.lp)
- Another file with the c1: added. (say namedconstraint.lp)
Now try this: From the command line mode
lp_solve -stat original.lp
lp_solve -stat namedconstraint.lp
If you compare the two outputs, you will see what is going on.
In my case, when I run lp_solve -stat
I get
Constraints: 74
Variables : 64
Integers : 64
Semi-cont : 0
SOS : 0
Non-zeros : 190 density=4.011824%
Then you can keep tweaking the original.lp file until you see why this is happening.
Further things to try:
Based on your additional remarks below, lp_solve is not seeing the constraint, unless you give the constraint a name. Try this next: 1. Move that constraint to be the very first, or the very last constraint in your model. Does that change anything? 2. I suspect that there are some strange characters in the line (or constraint) prior to the line where you have type x45=0. See if it helps if you delete that line.
Unfortunately, I am unable to replicate the problem, so I cannot debug it myself. Hence these suggestions.