Overview

The example ilolpex3.cpp is based on a network flow model.

This example demonstrates:

Here is the problem that example ilolpex3 solves:

The constraints Hx=d represent the flow conservation of a pure network flow. The example solves this problem in two steps:

  1. The CPLEX network optimizer is used to solve

  2. The constraints Ax=b are added to the problem, and the dual simplex optimizer is used to solve the full problem, starting from the optimal basis of the network problem. The dual simplex method is highly effective in such a case because this basis remains dual feasible after the slacks (artificial variables) of the added constraints are initialized as basic.

Notice that the 0 (zero) values in the data are omitted in the example program. CPLEX makes extensive use of sparse matrix methods and, although CPLEX correctly handles any explicit zero coefficients given to it, most programs solving models of more than modest size benefit (in terms of both storage space and speed) if the natural sparsity of the model is exploited from the very start.

Before the model is solved, the network optimizer is selected by setting the RootAlg parameter to the value IloCplex::Network, as shown in example ilolpex2.cpp . The simplex display parameter SimDisplay (documented in the reference manual of CPLEX parameters as simplex iteration information display) is set so that the simplex algorithm issues logging information as it executes.