ILOG CPLEX 11.0 User's Manual
Total Page:16
File Type:pdf, Size:1020Kb
ILOG CPLEX 11.0 User’s Manual September 2007 COPYRIGHT NOTICE Copyright © 1987-2007, by ILOG S.A. and ILOG, Inc. All rights reserved. General Use Restrictions This document and the software described in this document are the property of ILOG and are protected as ILOG trade secrets. They are furnished under a license or nondisclosure agreement, and may be used or copied only within the terms of such license or nondisclosure agreement. No part of this work may be reproduced or disseminated in any form or by any means, without the prior written permission of ILOG S.A, or ILOG, Inc. Trademarks ILOG, the ILOG design, CPLEX, and all other logos and product and service names of ILOG are registered trademarks or trademarks of ILOG in France, the U.S. and/or other countries. All other company and product names are trademarks or registered trademarks of their respective holders. Java and all Java-based marks are either trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Microsoft and Windows are either trademarks or registered trademarks of Microsoft Corporation in the United States and other countries. document version 11.0 CO N T E N T S Table of Contents ILOG CPLEX 11.0 User’s Manual Preface Meet ILOG CPLEX. 27 What Is ILOG CPLEX? . .28 What Does ILOG CPLEX Do? . .28 What You Need to Know . .30 In This Manual . .30 Examples Online . .34 Notation in This Manual . .36 Related Documentation. .37 Announcements and Updates . .39 Further Reading . .39 Part I Languages and APIs . 41 Chapter 1 ILOG Concert Technology for C++ Users. 43 Architecture of a CPLEX C++ Application . .44 Licenses . .44 Compiling and Linking . .45 Creating a C++ Application with Concert Technology . .45 Modeling an Optimization Problem with Concert Technology . .45 ILOG CPLEX 11.0 — USER’ S MANUAL 3 Modeling Classes. .46 Creating the Environment: IloEnv. .46 Defining Variables and Expressions: IloNumVar . .46 Declaring the Objective: IloObjective . .47 Adding Constraints: IloConstraint and IloRange . .48 Formulating a Problem: IloModel . .48 Data Management Classes . .49 Solving the Model . .50 Extracting a Model . .51 Invoking a Solver . .52 Choosing an Optimizer. .53 Controlling the Optimizers . .55 Accessing Solution Information. .57 Accessing Solution Status . .57 Querying Solution Data . .58 Accessing Basis Information . .59 Performing Sensitivity Analysis . .59 Analyzing Infeasible Problems. .59 Solution Quality . .60 Modifying a Model . .61 Deleting and Removing Modeling Objects. .61 Changing Variable Type. .62 Handling Errors . .63 Example: Optimizing the Diet Problem in C++ . .65 Problem Representation . .65 Creating a Model Row by Row. .65 Creating a Model Column by Column . .66 Application Description. .67 Creating Multi-Dimensional Arrays with IloArray . .67 Using Arrays for Input/Output. .67 Building the Model by Row. .68 4 ILOG CPLEX 11.0 — USER’ S MANUAL Building the Model by Column . .68 Solving the Model with IloCplex . .69 Complete Program. .70 Chapter 2 ILOG Concert Technology for Java Users . 71 Architecture of a CPLEX Java Application . .72 Licenses in a Java Application. .73 Compiling and Linking a Java Application . .73 Creating a Java Application with Concert Technology . .73 Modeling an Optimization Problem with Concert Technology . .74 Using IloModeler . .76 Modeling Variables. .76 Expressions . .76 Ranged Constraints . .77 Objective Functions . .78 The Active Model . .78 Building the Model. .79 Solving the Model . ..