How to Use CPLEX                              last update: 2006.1.22


1.  Log on to one of the teaching machines,  http://www.cs.mcgill.ca/socsinfo/labs/

2. Just type "cplex-10" and you should get the CPLEX> prompt.

3. If not, make sure your search path include /usr/local/bin.
   Also, you may need to set an environment variable:

In tcsh or csh:
      setenv ILOG_LICENSE_FILE /usr/local/pkgs/ilog/licdir/access_1.ilm

In bash:
      setenv ILOG_LICENSE_FILE=/usr/local/pkgs/ilog/licdir/access_1.ilm
      export ILOG_LICENSE_FILE

4. If access is still denied, there may be a licence problem, contact help@cs.mcgill.ca

5. Our licence only allows 10 users at any one time.

6. Complete documentation is available from the course TA.

7. A few sample cplex input files are contained in http://cgm.cs.mcgill.ca/~avis/courses/566/cplex

8. Here is a sample session  for the 5 queens problem:


[lab6-10.cs.mcgill.ca]  setenv ILOG_LICENSE_FILE /usr/local/pkgs/ilog/licdir/access_1.ilm

[lab6-10.cs.mcgill.ca] cplex-10

Welcome to CPLEX Linear Optimizer 6.0.1
  with Mixed Integer & Barrier Solvers
Copyright (c) ILOG 1997-1998
CPLEX is a registered trademark of ILOG

Type 'help' for a list of available commands.
Type 'help' followed by a command name for more
information on commands.

CPLEX> read 5queens.lp
Problem '5queens.lp' read.
Read time =    0.00 sec.
CPLEX> mipopt
Tried aggregator 1 time.
MIP Presolve modified 4 coefficients.
Reduced MIP has 20 rows, 25 columns, and 96 nonzeros.
Presolve time =    0.00 sec.
Clique table members: 20.
MIP emphasis: balance optimality and feasibility.
Root relaxation solution time =    0.00 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer     Best Node    ItCnt     Gap

      0     0        5.0000    12                      5.0000       28        
*     0+    0                   0        5.0000        5.0000       28    0.00%

MIP - Integer optimal solution:  Objective =  5.0000000000e+00
Solution time =    0.00 sec.  Iterations = 28  Nodes = 0

CPLEX> di so va -
Variable Name           Solution Value
x11                           1.000000
x23                           1.000000
x35                           1.000000
x42                           1.000000
x54                           1.000000
All other variables in the range 1-25 are 0.

CPLEX> quit
[lab6-10.cs.mcgill.ca]