ILOG CPLEX 10.1 User's Manual > Infeasibility and Unboundedness > Diagnosing Infeasibility by Refining Conflicts > Meet the Conflict Refiner in the Interactive Optimizer

You can get acquainted with the conflict refiner in the Interactive Optimizer. Certain features of the conflict refiner, namely, preferences and groups, are available only through an application of the Callable Library or Concert Technology. Those additional features are introduced in Using the Conflict Refiner in an Application.

A Model for the Conflict Refiner

Here's a simplified resource allocation problem to use as a model in the Interactive Optimizer. Either you can create a file containing these lines and read the file into the Interactive Optimizer by means of this command:

read filename

or you can use the enter command, followed by a name for the problem, followed by these lines:

Minimize
 obj: cost
Subject To
 c1:  - cost + 80 x1 + 60 x2 + 55 x3 + 30 x4 + 25 x5 + 80 x6 + 60 x7 + 35 x8
      + 80 x9 + 55 x10  = 0
 c2:  x1 + x2 + 0.8 x3 + 0.6 x4 + 0.4 x5 >= 2.1
 c3:  x6 + 0.9 x7 + 0.5 x8 >= 1.2
 c4:  x9 + 0.9 x10 >= 0.8
 c5:  0.2 x2 + x3 + 0.5 x4 + 0.5 x5 + 0.2 x7 + 0.5 x8 + x10 - service  = 0
 c6:  x1 + x6 + x9 >= 1
 c7:  x1 + x2 + x3 + x6 + x7 + x9 >= 2
 c8:  x2 + x3 + x4 + x5 <= 0
 c9:  x4 + x5 + x8 <= 1
 c10: x1 + x10 <= 1
Bounds
 service >= 3.2
Binaries
 x1  x2  x3  x4  x5  x6  x7  x8  x9  x10
End

This simple model, for example, might represent a project-staffing problem. In that case, the ten binary variables could represent employees who could be assigned to duty.

The first constraint defines the cost function. In this example, the objective is to minimize the cost of salaries. The next three constraints (c2, c3, c4) represent three nonoverlapping skills that the employees must cover to varying degrees of ability. The fifth constraint represents some additional quality metric (perhaps hard to measure) that most or all of the employees can contribute to. It is called customer service in this example. That variable has a lower bound to make sure of a certain predefined minimum level of 3.2.

The remaining constraints represent various work rules that reflect either policy that must be followed or practical guidance based on experience with this work force. Constraint c6, for example, dictates that at least one person with managerial authority be present. Constraint c7 requires at least two senior personnel be present. Constraint c8 indicates that several people are scheduled for off-site training during this period. Constraint c9 recognizes that three individuals are not productive together. Constraint c10 prevents two employees who are married to each other from working in this group in the same period, since one is a manager.

Optimizing the Example

If you apply the optimize command to this example, you will see these results:

Row 'c8' infeasible, all entries at implied bounds.
Presolve time =    0.00 sec.  
MIP -- Integer infeasible.
Current MIP best bound is infinite.
Solution time =    0.00 sec.  Iterations = 0  Nodes = 0

Interpreting the Results and Detecting Conflict

The declaration of infeasibility comes from presolve. In fact, presolve has already performed various reductions by the time it detects the unresolvable infeasibility in constraint c8. This information by itself is unlikely to provide any useful insights about the source of the infeasibility, so try the conflict refiner, by entering this command:

conflict

Then you will see results like these:

Refine conflict on 14 members...  
 Iteration  Max Members  Min Members
         1           11            0
         2            9            0
         3            7            0
         4            2            0
         5            2            1
         6            2            2 
Minimal conflict:    2 linear constraint(s)
                     0 lower bound(s)
                     0 upper bound(s)
Conflict computation time =    0.00 sec.  Iterations = 6

The first line of output mentions 14 members; this total represents constraints, lower bounds, and upper bounds that may be part of the conflict. There are ten constraints in this model; there are two continuous variables with lower and upper bounds that represent the other four members to be considered. Because binary variables are not reasonable candidates for bound analysis, the Interactive Optimizer treats the bounds of only the variables cost and service as potential members of the conflict. If you want all bounds to be candidates, you could instead declare the binary variables to be general integer variables with bounds of [0,1]. (Making that change in this model would likely result in the conflict refiner suggesting that one of the binary variables should take a negative value.) On some models, allowing so much latitude in the bounds may cause the conflict refiner to take far longer to arrive at a minimal conflict.

Displaying a Conflict

As you can see in the log displayed on the screen, the conflict refiner works to narrow the choices until it arrives at a conflict containing only two members. Since the conflict is small in this simplified example, you can see it in its entirety by entering this command:

display conflict all

Minimize
 obj:
Subject To
 c2: x1 + x2 + 0.8 x3 + 0.6 x4 + 0.4 x5 >= 2.1
 c8: x2 + x3 + x4 + x5 <= 0
Bounds
 0 <= x1 <= 1
 0 <= x2 <= 1
 0 <= x3 <= 1
 0 <= x4 <= 1
 0 <= x5 <= 1
Binaries
 x1  x2  x3  x4  x5

In a larger conflict, you can selectively display constraints or bounds on variables by using these commands to specify a range of rows or columns:

display conflict constraints

display conflict variables

You can also write the entire conflict to a file in LP-format to browse later by using the command (where modelname is the name you gave the problem):

write modelname.clp

Interpreting Conflict

In those results, you can see that c8, the constraint mentioned by presolve, is indeed a fundamental part of the infeasibility, as it directly conflicts with one of the skill constraints. In this example, with so many people away at training, the skill set in c2 cannot be covered. Perhaps it would be up to the judgment of the modeler or management to decide whether to relax the skill constraint or to reduce the number of people who will be away at training during this period, but something must be done for this model to have a feasible solution.

Deleting a Constraint

For the sake of explanation, assume that a decision is made to cancel the training in this period. To implement that decision, try entering this command:

change delete constraint c8

Now re-optimize. Unfortunately, even removing c8 does not make it possible to reach an optimum, as you can see from these results of optimization:

Constraints 'c5' and 'c9' are inconsistent.
Presolve time =    0.00 sec.  
MIP -- Integer infeasible.
Current MIP best bound is infinite.
Solution time =    0.00 sec.  Iterations = 0  Nodes = 0

Perhaps presolve has identified a source of infeasibility, but if you run the conflict command again, you will see these results:

Refine conflict on 13 members...  
 Iteration  Max Members  Min Members
         1           12            0
         2            9            0
         3            6            0
         4            4            0
         5            3            0
         6            3            1
         7            3            2
         8            3            3 
Minimal conflict:    2 linear constraint(s)
                     1 lower bound(s)
                     0 upper bound(s)
Conflict computation time =    0.00 sec.  Iterations = 8

Now view the entire conflict with this command:

display conflict all

Minimize
 obj:
Subject To
 c5:     0.2 x2 + x3 + 0.5 x4 + 0.5 x5 + 0.2 x7 + 0.5 x8 + x10 - service = 0
 c                   x4 +   x5 +           x8            <= 1
 sum_eq: 0.2 x2 + x3 + 0.5 x4 + 0.5 x5 + 0.2 x7 + 0.5 x8 + x10 - service = 0
Bounds
 0 <= x2 <= 1
 0 <= x3 <= 1
 0 <= x4 <= 1
 0 <= x5 <= 1
 0 <= x7 <= 1
 0 <= x8 <= 1
 0 <= x10 <= 1
      service >= 3.2
Binaries
 x2  x3  x4  x5  x7  x8  x10

Understanding a Conflict Report

The constraints mentioned by presolve are part of the minimal conflict detected by the conflict refiner. The additional information provided by this conflict is that the lower bound on service quality could also be considered for modification to achieve feasibility: with only one among employees 4, 5, and 8 permitted, any of whom contribute 0.5 to the quality metric, the lower bound on service can not be achieved. Unlike a binary variable, where it would make little sense to adjust either of its bounds to achieve feasibility, the bounds on a continuous variable like service may be worth scrutiny.

The other information this Conflict provides is that no change of the upper bound on service, currently infinity, could aid toward feasibility; perhaps that is already obvious, but even a finite upper bound would not be part of this conflict (as long as it is larger than the lower bound of 3.2).

Summing Equality Constraints

Note the additional constraint provided in this conflict: sum_eq. It is a sum of all the equality constraints in the conflict. In this case, there is only one such constraint; sometimes when there are more, an imbalance will become quickly apparent when positive and negative terms cancel.

Changing a Bound

Again, for the sake of the example, assume that it is decided after consultation with management to repair the infeasibility by reducing the minimum on the service metric, on the grounds that it is a somewhat arbitrary metric anyway. A minimal conflict does not directly tell you the magnitude of change needed, but in this case it can be quickly determined by examination of the minimal conflict that a new lower bound of 2.9 could be achievable; select 2.8, to be safe. Modify the model by entering this command:

change bound service lower 2.8

and re-optimize. Now at last the model delivers an optimum:

Tried aggregator 1 time.
MIP Presolve eliminated 9 rows and 12 columns.
MIP Presolve modified 16 coefficients.
All rows and columns eliminated.
Presolve time =    0.00 sec.  
Integer optimal solution:  Objective =    3.3500000000e+02
Solution time =    0.00 sec.  Iterations = 0  Nodes = 0

Displaying the solution indicates that employees {2,3,5,6,7,10} are used in the optimal solution.

Adding a Constraint

A natural question is why so many employees are needed. Look for an answer by adding a constraint limiting employees to five or fewer, like this:

add
x1+x2+x3+x4+x5+x6+x7+x8+x9+x10 <= 5
end
optimize

As you might expect, the output from the optimizer indicates the current solution is incompatible with this new constraint, and indeed no solution to this what-if scenario exists at all:

Warning:  MIP start values are infeasible.
Retaining MIP start values for possible repair.
Row 'c11' infeasible, all entries at implied bounds.
Presolve time =    0.00 sec.  
MIP -- Integer infeasible.
Current MIP best bound is infinite.
Solution time =    0.00 sec.  Iterations = 0  Nodes = 0

Constraint c11, flagged by presolve, is the newly added constraint, not revealing very much. To learn more about why c11 causes trouble, run conflict again, and view the minimal conflict with the following command again:

display conflict all

You will see the following conflict:

Minimize
 obj:
Subject To
 c2:  x1 + x2 + 0.8 x3 + 0.6 x4 + 0.4 x5 >= 2.1
 c3:  x6 + 0.9 x7 + 0.5 x8 >= 1.2
 c4:  x9 + 0.9 x10 >= 0.8
 c11: x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10 <= 5
  (omitting the listing of binary variables' bounds)

The constraints in conflict with this new limitation are all of the skill requirements. When viewed in this light, the inconsistency is easy to spot: one employee is obviously needed for constraint c4, two are needed for c3, and a simple calculation reveals that three are needed for c2. Since there is no overlap in the skill sets, five employees are too few.

Unless management or the formulator of the model is willing to compromise about the skills, (for example, to relax the righthand side of any of these constraints), constraint c11 needs to be taken out again, since it is unrealistic to get by with only five employees:

change delete constraint c11

This change results in a model with an optimal cost of 335, using six employees.

Changing Bounds on Cost

No better cost is possible in this formulation. Still, you may wonder, "Why not?" To try yet another scenario, instead of limiting the number of employees, try focusing on the cost by changing the upper bound of the cost to 330, like this:

change bound cost upper 330
optimize
conflict
display conflict all

This series of commands again renders the model infeasible and shows a minimal conflict:

Subject To
 c1:         - cost + 80 x1 + 60 x2 + 55 x3 + 30 x4 + 25 x5 + 80 x6 + 60 x7
             + 35 x8 + 80 x9 + 55 x10  = 0
 c2:         x1 + x2 + 0.8 x3 + 0.6 x4 + 0.4 x5 >= 2.1
 c3:         x6 + 0.9 x7 + 0.5 x8 >= 1.2
 c5:         0.2 x2 + x3 + 0.5 x4 + 0.5 x5 + 0.2 x7 + 0.5 x8 + x10 - service
              = 0
 c9:         x4 + x5 + x8 <= 1
Bounds
 -Inf <= cost <= 330
      service >= 2.9

The upper bound on cost is, of course, expected to be in the conflict, so relaxing it would merely put the scenario back the way it was. The constraint c1 defines cost, so unless there is some unexpected latitude in setting salaries, no relief will be found there. Constraints c2 and c3 represent two skill requirements, previously judged beyond negotiation, and constraint c5 represents service quality, already compromised a bit. That rough analysis leaves c9, the requirement not to use three particular employees together.

Relaxing a Constraint

How much is it costing to maintain this rule? Consider asking them to work productively pairwise, if not all three, and relax the upper limit of this constraint, like this:

change rhs c9 2
optimize

The model is now restored to feasibility, and the new optimum has an overall cost of 310, a tangible improvement of 25 over the previous optimum, using employees {2,3,5,6,8,10}; employee 7 has been removed in favor of employee 8. Is that enough monetary benefit to offset whatever reasons there were for separating employees 4 and 8? That is not a decision that can be made here; but at least this model provides some quantitative basis toward making that decision. Additionally, a check of the service variable shows that its solution value is back up to 3.2, a further benefit from relaxing constraint c9. Perhaps this decision should have been made sooner, the first time constraint c9 appeared in a conflict.

The solution of 310 could be investigated further by changing the upper bound of cost to be 305, for example. The conflict resulting from this change consists of the skills constraint plus the constraint requiring at least one manager on duty. At this point, the analysis has reached a conclusion, unless management or the model formulator wishes to challenge the policy.