Java examples
These examples in Java use Concert Technology.
The following examples are delivered with CPLEX in IBM ILOG CPLEX Optimization Studio.
| AdMIPex1.java | uses node and branch callbacks to optimize a MIP. |
| AdMIPex2.java | uses a heuristic callback to optimize a MIP. |
| AdMIPex3.java | uses a branch callback on a MIP with special ordered sets (SOSs). |
| AdMIPex4.java | demonstrates how to add lazy constraints and user cuts. |
| AdMIPex5.java | adds cuts through the legacy cut callback for a MIP. |
| AdMIPex6.java | starts a MIP optimization from an LP solution. |
| AdMIPex8.java | demonstrates how to add lazy constraints and user cuts with the generic callback. |
| AdMIPex9.java | uses a generic callback invoking a heuristic. |
Benders.java |
demonstrates a Benders decomposition. |
BendersATSP.java |
demonstrates lazy constraint callbacks to separate integer feasible LP solutions and user cut callbacks to separate fractional infeasible LP solutions in a do-it-yourself Benders decomposition of an asymmetric traveling salesperson problem. |
| Blend.java | solves a blending problem. |
ConflictEx1.java |
demonstrates how to use the conflict refiner. |
| CplexServer.java | shows you how to write an optimization server that accepts a pure Java model by taking advantage of the class IloCplexModeler in a native J2EE client application. |
| CutStock.java | is a cutting stock model, illustrating column generation. |
| Diet.java | is an implementation in Java of the classic diet problem; 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.java | demonstrates how to read in and optimize a multiobjective problem. |
| Etsp.java | is an implementation in Java of a scheduling problem with costs for earliness and tardiness. |
| Facility.java | solves a warehouse-location problem. Optionally, the example can apply a Benders decomposition. |
| FixCost1.java | solves a production planning problem with fixed costs. |
| FixNet.java | uses indicator constraints to avoid numeric difficulty in a fixed-charge network flow problem. |
| FoodManufact.java | implements a solution to the food production planning problem, well known from the modeling textbook of H. P. Williams. |
| GenericBranch.java | demonstrates how to perform customized branching using the generic callback. |
| GlobalQPex1.java | shows how to read a convex or nonconvex quadratic programming model (QP) or mixed integer quadratic programming model (MIQP) and solve it for a first order or global optimum. |
| Goalex1.java | uses the goal API for branching. |
| Goalex2.java | uses the goal API to add cuts. |
| Goalex3.java | uses the goal API to add node evaluators; it derives from Goalex1.java. |
IndefQPex1.java |
enters and solves an indefinite quadratic program (nonPSD QP) to a local optimum. |
| InOut1.java | is a production model. |
| InOut3.java | is another production model. |
| LPex1.java | is a basic linear programming model illustrating data population techniques. |
| LPex2.java | is a basic linear programming model with data coming from files. |
| LPex3.java | shows how to add rows to a model and re-optimize. |
| LPex4.java | illustrates callbacks. |
| LPex6.java | shows how to load a basis. |
| LPex7.java | shows how to access names of columns. |
| MIPex1.java | is a basic MIP model. |
| MIPex2.java | is another basic MIP model. |
| MIPex3.java | includes special ordered sets (SOSs) in a MIP model. |
| MIPex4.java | shows how to create and use an informational callback to log, to limit number of nodes, and to interrupt optimization; also shows how to terminate optimization; also shows how to use time stamps. |
| MIQPex1.java | is a mixed integer quadratic programming model; it includes a quadratic objective in a MIP. |
| MixBlend.java | is a MIP blending model. |
| Populate.java | shows how to generate and keep multiple solutions in the solution pool. |
| QPex1.java | includes a quadratic objective in an LP. |
| QPex2.java | is another model with a quadratic objective. |
| QPex3.java | uses the Concert Technology interface for quadratic expressions to enter and to modify a model with quadratic expressions in the objective function. |
| Rates.java | solves a planning problem with semi-continuous variables. |
| SocpEx1.java | shows how to access dual values and reduced costs in SOCP models. |
| QCPDual.java | shows how to access dual values and reduced costs in quadratically constrained programming models (QCP). |
| Steel.java | solves a production planning problem illustrating
ways to build a model; based on steelT.mod from
the AMPL modeling book by Fourer, Gay, and Kernighan. |
| Transport.java | uses a piecewise linear cost function. |
| TuneSet.java | analyzes a set of models and suggests nondefault parameter settings for better performance. |
| Warehouse.java | is a warehouse-location problem; it uses goals. |
| InputDataReader.java | is used by several of the examples to read data. |