Solver|Debug



In the ideal world, all models would return an optimal solution. Unfortunately, this is not the case. Sooner or later, you are bound to run across either an infeasible or unbounded model. This is particularly true in the development phase of a project when the model will tend to suffer from typographical errors.

Tracking down an error in a large model can prove to be a daunting task. The Debug command is useful in narrowing the search for problems in both infeasible and unbounded linear programs. A small portion of the original model is isolated as the source of the problem. This allows you to focus your attention on a subsection of the model in search of formulation or data entry errors.

The Debug command identifies two types of sets: sufficient and necessary. Removing any sufficient set object from the model is sufficient to fix the entire model. Not all models will have a sufficient set. In which case, they will have a necessary set with the property that removing any object from this set fixes the remaining objects within that set.

As an example, suppose you have an infeasible model. If the complete model would be feasible except for a bug in a single row, that row will be listed as part of the sufficient set. If the model has a necessary set, then, as long as all of them are present, the model will remain infeasible.

The following example illustrates. The coefficient .55 in row 4 should have been 5.5:

page163axp2

When we attempt to solve this formulation, we get the following error:

page163bxp3

Next, if we run the Solver|Debug command, we are presented with the following report:

page163cxp2

The Debug command has correctly identified that the erroneous ROW4, when eliminated, is sufficient to make the entire model feasible.

Debug operates in a similar manner for unbounded models. In the following example, we introduced an error by placing a minus sign instead of a plus sign in front of variable Z3 in ROW3. A look at ROW3 reveals that Z3 can be increased indefinitely, leading to an unbounded objective.

page163dxp2

The resulting model is unbounded and, when issuing the Solver|Solve command, we receive the unbounded error message:

page163exp2

Issuing the Debug command, we receive the following breakdown:

page163fxp

The Debug command has successfully determined that bounding Z3 is sufficient to bound the entire model.

Typically, the Debug command helps to substantially reduce the search effort. The first version of this feature was implemented in response to a user who had an infeasible model. The user had spent a day searching for a bug in a model with 400 constraints. The debug feature quickly found a necessary set with 55 constraints, as well as one sufficient set constraint. The user immediately noticed that the right-hand side of the sufficient set constraint was incorrect.

Note:Prior to release 10.0 of LINGO, the debugger was only capable of processing linear models.  Starting with release 10.0, all classes of models (LP, QP, IP and NLP) may now be debugged.