Introduction To Problem Solving in Cplex

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 15

Introduction to problem solving

in CPLEX
Operations Research Lab
Department of Industrial & Systems
Engineering
IIT Kharagpur
by
Dr. Krishna Kumar
Step 1
Open the Cplex IDE
Step 2
Create a new workspace (click “OK” on the dialog box)
Step 3
Create a new OPL project (File>new>new OPL project)
Cplex windows
Alternative to create configuration and
model file
Linear Programming Problem

Maximize Z=3x1  5 x2 Objective function

x1  4
2 x2  12 “can be atmost”
constraints
3 x1  2 x2  18

“Must be atleast”
3 x1  5 x2  15 constraint

x1  0
Non-Negativity
x2  0 Constraints
Write the code
How to run?
Right click on “Configuration 1”and press “Run this”
Check for errors
Results
Exercise problem
Maximize Z=2x1  4 x2  3x3

s.t.
x1  3 x2  2 x3  30
x1  x2  x3  24
3 x1  5 x2  3 x3  60

x1 , x2 , x3  0

You might also like