Here is the problem example ilolpex3 solves:
Minimize | c*x | |||
subject to | Hx = d Ax = b 1 | |||
where | H = | d = | ||
A = | b = | |||
c = | ||||
l = | ||||
u = |
The constraints Hx=d represent a pure network flow. The example solves this problem in two steps:
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 IloCplex::SimDisplay is set so that the simplex algorithm issues logging information as it executes.
IloCplex provides a variety of parameters that allow you to control the solution process. They can be categorized into boolean, integer, numerical and string parameters and are represented by the enumeration types IloCplex::BoolParam, IloCplex::IntParam, IloCplex::NumParam, and IloCplex::StringParam, respectively.
Before solving the modified problem, example ilolpex3.cpp sets the optimizer option to IloCplex::Dual, as this is the algorithm that can generally take best advantage of the optimal basis from the previous solve after the addition of constraints.
The complete program follows. You can also view it online in the file ilolpex3.cpp.