12.07.2015 Views

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

compute a set of conflicting constraints and column bounds that would be feasible if one ofthem (a constraint or variable) were removed. Such a set is known as a conflict. For moreabout detecting conflicts, see Diagnosing Infeasibility by Refining Conflicts on page 391.Repairing Infeasibility: FeasOptPrevious sections focused on how to diagnose the causes of infeasibility. However, you maywant to go beyond diagnosis to perform automatic correction of your model and thenproceed with delivering a solution. One approach for doing so is to build your model withexplicit slack variables and other modeling constructs, so that an infeasible outcome is nevera possibility. Such techniques for formulating a model are beyond the scope of thisdiscussion, but you should consider them if you want the greatest possible flexibility in yourapplication.In contrast, an automated approach offered in <strong>ILOG</strong> <strong>CPLEX</strong> is known as FeasOpt (forfeasible optimization). FeasOpt attempts to repair an infeasibility by modifying the modelaccording to preferences set by the user. For more about this approach, see RepairingInfeasibilities with FeasOpt on page 409Examples: Using a Starting Basis in an LP ProblemHere is an approach mentioned in the section Tuning LP Performance, which is to start withan advanced basis. The following small example in C++ and in C demonstrates an approachto setting a starting basis by hand. Example ilolpex6.cpp on page 194 is from ConcertTechnology in the C++ API. Example lpex6.c on page 195 is from the Callable Library in C.Example ilolpex6.cppThe example, ilolpex6.cpp, resembles one you may have studied in the <strong>ILOG</strong> <strong>CPLEX</strong>Getting Started manual, ilolpex1.cpp. This example differs from that one in these ways:◆◆◆◆Arrays are constructed using the populatebycolumn method, and thus no commandline arguments are needed to select a construction method.In the main routine, the arrays cstat and rstat set the status of the initial basis.After the problem data has been copied into the problem object, the basis is copied by acall to cplex.setBasisStatuses.After the problem has been optimized, the iteration count is printed. For the given dataand basis, the basis is optimal, so no iterations are required to optimize the problem.The main program starts by declaring the environment and terminates by calling methodend for the environment. The code in between is encapsulated in a try block that catches allConcert Technology exceptions and prints them to the C++ error stream cerr. All other194 <strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!