Callable Library examples using cplex.h
These examples in C use the Callable Library.
The following examples are delivered with CPLEX. They demonstrate how to
include features of the header file cplex.h.
| benders.c | demonstrates a Benders decomposition. |
| bendersatsp.c | demonstrates legacy lazy constraint callbacks to separate integer feasible LP solutions and legacy user cut callbacks to separate fractional infeasible LP solutions in a do-it-yourself Benders decomposition of an asymmetric traveling salesperson problem. |
| bendersatsp2.c | demonstrates generic callbacks in the context of lazy constraints to separate integer feasible LP solutions and generic callbacks in the context of user cuts to separate fractional infeasible LP solutions in a do-it-yourself Benders decomposition of an asymmetric traveling salesperson problem. |
| check.c | contains routines to check data that will be passed to Callable Library routines. |
conflictex1.c |
demonstrates how to use the conflict refiner. |
| diet.c | is a linear program that can be generated by columns (add foods to the diet) or by rows (add requirements to the diet); optionally, demonstrates how to model a multiobjective problem by creating a second objective. |
| multiobjex1.c | demonstrates how to read in and optimize a multiobjective problem. |
| foodmanu.c | implements a solution to the food production planning problem, well known from the modeling textbook of H. P. Williams; this implementation uses indicator constraints and semi-continuous variables. |
| genericbranch.c | demonstrates how to perform customized branching using the generic callback. |
| transport.c | demonstrates piecewise linear (PWL) cost coeffients in a logistics problem. |
| tuneset.c | analyzes a set of models and suggests nondefault parameter settings to improve performance. |
| lpex1.c | is a basic linear programming example, illustrating data population techniques. |
| lpex2.c | is a basic linear programming example with data coming from files. |
| lpex3.c | demonstrates how to add rows to a problem and re-optimize. |
| lpex4.c | illustrates CPLEX callback functions; it is derived from lpex1.c. |
| lpex5.c | illustrates CPLEX message handler; it is derived from lpex1.c. |
| lpex6.c | illustrates loading of bases; it is derived from lpex1.c. |
| lpex7.c | shows how to get column names; it is derived from lpex2.c. |
| lpex8.c | shows another way to build a problem; it is derived from lpex1.c. |
| mipex1.c | is a basic mixed integer programming example, derived from lpex8.c. |
| mipex2.c | is a basic mixed integer programming example, derived from lpex2.c. |
| mipex3.c | illustrates SOS sets and priority orders; it derives from lpex8.c. |
| mipex4.c | shows how to create and use an informational callback for logging, limiting number of nodes, and interrupting optimization; also shows how to terminate optimization; also shows how to use time stamps. |
| populate.c | shows how to generate and keep multiple solutions in the solution pool. |
| fixnet.c | uses indicator constraints to avoid numeric difficulty in a fixed-charge network flow problem. (It does not use the conventional CPXNET interface.) |
| netex1.c | is a basic network example. |
| netex2.c | is a basic network example, with data coming from files. |
| qpex1.c | is a basic quadratic programming example, derived from lpex8.c. |
| qpex2.c | is a quadratic programming example; it derives from lpex2.c. |
| miqpex1.c | is a mixed integer quadratic programming example; it derives from lpex8.c. |
| globalmiqpex1.c | shows how to read a convex or nonconvex mixed integer quadratic programming model (MIQP) and solve it for a global optimum. |
| globalqpex1.c | shows how to read a convex or nonconvex quadratic programming model (QP) and solve it for a first order or global optimum. |
| indefqpex1.c | shows how to solve an indefinite quadratic programming model (QP), whether convex or nonconvex, to a local optimum. |
| adpreex1.c | uses advanced presolve to re-optimize with a secondary objective, using two steps; the first optimization is on product cost and revenue, and then a secondary objective minimizes inventory level. |
| admipex1.c | uses node and branch callbacks to optimize a MIP. |
| admipex2.c | uses a heuristic callback to optimize a MIP. |
| admipex3.c | uses a branch callback on a MIP with special ordered sets (SOSs). |
| admipex4.c | demonstrates how to add lazy constraints and user cuts. |
| admipex5.c | adds cuts through the legacy cut callback for a MIP. |
| admipex6.c | starts a MIP optimization from an LP solution. |
| admipex7.c | uses a legacy solve callback using barrier and dual optimizers. |
| admipex8.c | demonstrates how to add lazy constraints and user cuts with the generic callback. |
| admipex9.c | uses a generic callback invoking a heuristic. |
| socpex1.c | shows how to access dual values and reduced costs in SOCP models. |
| qcpdual.c | shows how to access dual values and reduced costs in quadratically constrained programming models (QCP). |
| steel.c | is based on the model steelT.mod from
the AMPL modeling book by Fourer, Gay, and Kernighan. |