# 15.2 Analyzing Infeasible Problems¶

When developing and implementing a new optimization model, the first attempts will often be either infeasible, due to specification of inconsistent constraints, or unbounded, if important constraints have been left out.

In this section we will

- go over an example demonstrating how to locate infeasible constraints using the
**MOSEK**infeasibility report tool, - discuss in more general terms which properties may cause infeasibilities, and
- present the more formal theory of infeasible and unbounded problems.

## 15.2.1 Example: Primal Infeasibility¶

A problem is said to be *primal infeasible* if no solution exists that satisfies all the constraints of the problem.

As an example of a primal infeasible problem consider the problem of minimizing the cost of transportation between a number of production plants and stores: Each plant produces a fixed number of goods, and each store has a fixed demand that must be met. Supply, demand and cost of transportation per unit are given in Fig. 15.1.

The problem represented in Fig. 15.1 is infeasible, since the total demand

exceeds the total supply

If we denote the number of transported goods from plant \(i\) to store \(j\) by \(x_{ij}\) , the problem can be formulated as the LP:

Solving problem (1) using **MOSEK** will result in a solution, a solution status and a problem status. Among the log output from the execution of **MOSEK** on the above problem are the lines:

```
Basic solution
Problem status : PRIMAL_INFEASIBLE
Solution status : PRIMAL_INFEASIBLE_CER
```

The first line indicates that the problem status is primal infeasible. The second line says that a *certificate of the infeasibility* was found. The certificate is returned in place of the solution to the problem.

## 15.2.2 Locating the cause of Primal Infeasibility¶

Usually a primal infeasible problem status is caused by a mistake in formulating the problem and therefore the question arises: *What is the cause of the infeasible status?* When trying to answer this question, it is often advantageous to follow these steps:

- Remove the objective function. This does not change the infeasibility status but simplifies the problem, eliminating any possibility of issues related to the objective function.
- Consider whether your problem has some necessary conditions for feasibility and examine if these are satisfied, e.g. total supply should be greater than or equal to total demand.
- Verify that coefficients and bounds are reasonably sized in your problem.

If the problem is still primal infeasible, some of the constraints must be relaxed or removed completely. The **MOSEK** infeasibility report (Section 15.2.4) may assist you in finding the constraints causing the infeasibility.

Possible ways of relaxing your problem nclude:

- Increasing (decreasing) upper (lower) bounds on variables and constraints.
- Removing suspected constraints from the problem.

Returning to the transportation example, we discover that removing the fifth constraint

makes the problem feasible.

## 15.2.3 Locating the Cause of Dual Infeasibility¶

A problem may also be *dual infeasible*. In this case the primal problem is often unbounded, meaning that feasbile solutions exists such that the objective tends towards infinity. An example of a dual infeasible and primal unbounded problem is:

To resolve a dual infeasibility the primal problem must be made more restricted by

- Adding upper or lower bounds on variables or constraints.
- Removing variables.
- Changing the objective.

### 15.2.3.1 A cautionary note¶

The problem

is clearly infeasible. Moreover, if any one of the constraints is dropped, then the problem becomes feasible.

This illustrates the worst case scenario where all, or at least a significant portion of the constraints are involved in causing infeasibility. Hence, it may not always be easy or possible to pinpoint a few constraints responsible for infeasibility.

## 15.2.4 The Infeasibility Report¶

**MOSEK** includes functionality for diagnosing the cause of a primal or a dual infeasibility. It can be turned on by setting the `iparam.infeas_report_auto`

to `onoffkey.on`

. This causes **MOSEK** to print a report on variables and constraints involved in the infeasibility.

The `iparam.infeas_report_level`

parameter controls the amount of information presented in the infeasibility report. The default value is \(1\).

### 15.2.4.1 Example: Primal Infeasibility¶

We will keep working with the problem (1) written in LP format:

### 15.2.4.2 Example: Dual Infeasibility¶

The following problem is dual to (1) and therefore it is dual infeasible.

This can be verified by proving that

is a certificate of dual infeasibility (see Section 12.1.2.2) as we can see from this report:

```
MOSEK DUAL INFEASIBILITY REPORT.
Problem status: The problem is dual infeasible
The following constraints are involved in the infeasibility.
Index Name Activity Objective Lower bound Upper bound
5 x33 -1.000000e+00 NONE 2.000000e+00
6 x34 -1.000000e+00 NONE 1.000000e+00
The following variables are involved in the infeasibility.
Index Name Activity Objective Lower bound Upper bound
0 y1 -1.000000e+00 2.000000e+02 NONE 0.000000e+00
2 y3 -1.000000e+00 1.000000e+03 NONE 0.000000e+00
3 y4 1.000000e+00 1.100000e+03 NONE NONE
4 y5 1.000000e+00 2.000000e+02 NONE NONE
Interior-point solution summary
Problem status : DUAL_INFEASIBLE
Solution status : DUAL_INFEASIBLE_CER
Primal. obj: 1.0000000000e+02 nrm: 1e+00 Viol. con: 0e+00 var: 0e+00
```

Let \(y^*\) denote the reported primal solution. **MOSEK** states

- that the problem is
*dual infeasible*, - that the reported solution is a certificate of dual infeasibility, and
- that the infeasibility measure for \(y^*\) is approximately zero.

Since the original objective was maximization, we have that \(c^T y^* >0\). See Section 12.1.2 for how to interpret the parameter values in the infeasibility report for a linear program. We see that the variables `y1`

, `y3`

, `y4`

, `y5`

and the constraints `x33`

and `x34`

contribute to infeasibility with non-zero values in the `Activity`

column.

One possible strategy to *fix* the infeasibility is to modify the problem so that the certificate of infeasibility becomes invalid. In this case we could do one the following things:

- Add a lower bound on
`y3`

. This will directly invalidate the certificate of dual infeasibility. - Increase the object coefficient of
`y3`

. Changing the coefficients sufficiently will invalidate the inequality \(c^Ty^*>0\) and thus the certificate. - Add lower bounds on
`x11`

or`x31`

. This will directly invalidate the certificate of infeasibility.

Please note that modifying the problem to invalidate the reported certificate does *not* imply that the problem becomes dual feasible — the reason for infeasibility may simply *move*, resulting a problem that is still infeasible, but for a different reason.

More often, the reported certificate can be used to give a hint about errors or inconsistencies in the model that produced the problem.

## 15.2.5 Theory Concerning Infeasible Problems¶

This section discusses the theory of infeasibility certificates and how **MOSEK** uses a certificate to produce an infeasibility report. In general, **MOSEK** solves the problem

where the corresponding dual problem is

We use the convension that for any bound that is not finite, the corresponding dual variable is fixed at zero (and thus will have no influence on the dual problem). For example

## 15.2.6 The Certificate of Primal Infeasibility¶

A certificate of primal infeasibility is *any* solution to the homogenized dual problem

with a positive objective value. That is, \((s_l^{c*},s_u^{c*},s_l^{x*},s_u^{x*})\) is a certificate of primal infeasibility if

and

The well-known *Farkas Lemma* tells us that (2) is infeasible if and only if a certificate of primal infeasibility exists.

Let \((s_l^{c*},s_u^{c*},s_l^{x*},s_u^{x*})\) be a certificate of primal infeasibility then

implies that the lower (upper) bound on the \(i\) th constraint is important for the infeasibility. Furthermore,

implies that the lower (upper) bound on the \(j\) th variable is important for the infeasibility.

## 15.2.7 The certificate of dual infeasibility¶

A certificate of dual infeasibility is *any* solution to the problem

with negative objective value, where we use the definitions

and

Stated differently, a certificate of dual infeasibility is any \(x^*\) such that

The well-known Farkas Lemma tells us that (3) is infeasible if and only if a certificate of dual infeasibility exists.

Note that if \(x^*\) is a certificate of dual infeasibility then for any \(j\) such that

variable \(j\) is involved in the dual infeasibility.