Linear Programming and CPLEX Ting-Yuan Wang Advisor: Charlie C. Chen Department of Electrical and Computer Engineering University of Wisconsin-Madison.

Slides:



Advertisements
Similar presentations
Chapter 5: Linear Programming: The Simplex Method
Advertisements

1 LP Duality Lecture 13: Feb Min-Max Theorems In bipartite graph, Maximum matching = Minimum Vertex Cover In every graph, Maximum Flow = Minimum.
Solving LP Models Improving Search Special Form of Improving Search
Standard Minimization Problems with the Dual
Understanding optimum solution
Linear programming: lp_solve, max flow, dual CSC 282 Fall 2013.
SCIP Optimization Suite
Operation Research Chapter 3 Simplex Method.
What is GAMS?. While they are not NLP solvers, per se, attention should be given to modeling languages like: GAMS- AIMMS-
Introduction to Algorithms
Sections 4.1 and 4.2 The Simplex Method: Solving Maximization and Minimization Problems.
SOLVING LINEAR PROGRAMS USING EXCEL Dr. Ron Lembke.
Operations Management Linear Programming Module B - Part 2
EE 553 Integer Programming
Linear & Integer Programming: A Decade of Computation Robert E. Bixby ILOG, Inc. and Rice University Co-Authors Mary Fenelon, Zongao Gu, Irv Lustig, Ed.
GAMS/GAMSIDE AGEC 641 Lab, Fall 2011 Mario Andres Fernandez Based on material written by Gillig and McCarl and improved upon by previous lab instructors.
ISM 206 Lecture 4 Duality and Sensitivity Analysis.
1 Introduction to Linear and Integer Programming Lecture 9: Feb 14.
Linear Programming Excel Solver. MAX8X 1 + 5X 2 s.t.2X 1 + 1X 2 ≤ 1000 (Plastic) 3X 1 + 4X 2 ≤ 2400 (Prod. Time) X 1 + X 2 ≤ 700 (Total Prod.) X 1 - X.
Duality Dual problem Duality Theorem Complementary Slackness
Solving the Protein Threading Problem in Parallel Nocola Yanev, Rumen Andonov Indrajit Bhattacharya CMSC 838T Presentation.
ISM 206 Lecture 4 Duality and Sensitivity Analysis.
Problem Set # 4 Maximize f(x) = 3x1 + 2 x2 subject to x1 ≤ 4 x1 + 3 x2 ≤ 15 2x1 + x2 ≤ 10 Problem 1 Solve these problems using the simplex tableau. Maximize.
Linear Programming – Max Flow – Min Cut Orgad Keller.
Computational Methods for Management and Economics Carla Gomes Module 4 Displaying and Solving LP Models on a Spreadsheet.
AMPL Presentation 1 By Raymond Kleinberg Outline AMPL - Ugh! - What is it good for? Basics Starting a Problem Running the Problem Example.
MIT and James Orlin © Chapter 3. The simplex algorithm Putting Linear Programs into standard form Introduction to Simplex Algorithm.
START EXCEL BUILD OR RETRIEVE YOUR OPTIMIZATION MODEL SAVE YOUR WORKBOOK!! CHOOSE “Solver…” IN THE “Tools” MENU SPECIFY IN SOLVER DIALOG BOX: 1.CELL TO.
Network Models II Shortest Path Cross Docking Enhance Modeling Skills Modeling with AMPL Spring 03 Vande Vate.
AGIFORS Res and YM Study Group Conference, NYC, Operations Research: Optimization, Heuristics, Simulation, and Forecasting Judy Pastor Continental.
ILOG CPLEX CPLEX is a product developed by ILOG to solve LPs MIPs QPs
GAMS Anwendung Nutzeroberfläche eigene Programme Modellierungs- System GAMS AMPL ILOG Studio … Solver CPLEX, CONOPT, MINOS, COIN, BARON,...
ILOG CPLEX introduction Presenter: Meng-yen Li. Outline Introduction Using the interactive interface Read problem from file LP format Demo with FS problem.
ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March
1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.
Chapter 6 Supplement Linear Programming.
Duality Theory  Every LP problem (called the ‘Primal’) has associated with another problem called the ‘Dual’.  The ‘Dual’ problem is an LP defined directly.
1 ILOG CPLEX CPLEX is a product developed by ILOG to solve  LPs  MIPs  QPs  MIQPs  Network Flow problems CPLEX technologies  CPLEX callable library.
A model consisting of linear relationships representing a firm’s objective and resource constraints Linear Programming (LP) LP is a mathematical modeling.
Goal Seek and Solver. Goal seeking helps you n Find a specific value for a target cell by adjusting the value of one other cell whose value is allowed.
Chapter 6 Simplex-Based Sensitivity Analysis and Duality
 Minimization Problem  First Approach  Introduce the basis variable  To solve minimization problem we simple reverse the rule that is we select the.
EE/Econ 458 Duality J. McCalley.
1 1 Slide © 2005 Thomson/South-Western Simplex-Based Sensitivity Analysis and Duality n Sensitivity Analysis with the Simplex Tableau n Duality.
Gomory Cuts Updated 25 March Example ILP Example taken from “Operations Research: An Introduction” by Hamdy A. Taha (8 th Edition)“Operations Research:
FATCOP: A Mixed Integer Program Solver Michael FerrisQun Chen Department of Computer Sciences University of Wisconsin-Madison Jeff Linderoth, Argonne.
FATCOP: A Mixed Integer Program Solver Michael FerrisQun Chen University of Wisconsin-Madison Jeffrey Linderoth Argonne National Laboratories.
Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. Linear Programming: An Algebraic Approach 4 The Simplex Method with Standard Maximization.
The minimum cost flow problem. Solving the minimum cost flow problem.
Use duality theory to check if the solution implied by the dictionary is correct. Maximize x x x 3 subject to 1 x x x 3 ≤ 5 1 x.
Decision Support Systems INF421 & IS Simplex: a linear-programming algorithm that can solve problems having more than two decision variables.
Production systems LP and MILP models. Introduction  Linear programing (LP) is a base tool in optimization  George B. Dantzig developed the simplex.
1 ILOG CPLEX CPLEX is a product developed by ILOG to solve  LPs  MIPs  QPs  MIQPs  Network Flow problems. CPLEX technologies  CPLEX callable library.
Excel’s Solver Use Excel’s Solver as a tool to assist the decision maker in identifying the optimal solution for a business decision. Business decisions.
Cplex: Advanced Example
Stat 261 Two phase method.
Chap 10. Sensitivity Analysis
Excel Solver IE 469 Spring 2017.
The minimum cost flow problem
The CPLEX Library: Mixed Integer Programming
10CS661 OPERATION RESEARCH Engineered for Tomorrow.
MBA 651 Quantitative Methods for Decision Making
Chapter 4 Linear Programming: The Simplex Method
به نام خدا آشنایی با LINDO Software استاد :‌ راحله خاندوزی.
The Simplex Method: Standard Minimization Problems
MIP Tools Branch and Cut with Callbacks Lazy Constraint Callback
Excel Solver IE 469 Fall 2018.
Using the ODH-CPLEX Python Interface
Presentation transcript:

Linear Programming and CPLEX Ting-Yuan Wang Advisor: Charlie C. Chen Department of Electrical and Computer Engineering University of Wisconsin-Madison Feb

CPLEX Optimization Options: Primal, Dual Simplex Methods Network Flow Problems MIPs (Mixed Integer Linear Programming ) Problems Barrier Method Quadratic Programming Problems

CPLEX: Data Entry Options Using interactive Base System to enter Problem Line by Line Using the CPLEX Callable Library to write C/C++ codes Reading Data from Formatted Files

CPLEX File Formats Input file format: MPS (Mathematical Programming System) –Industry standard ASCII-text file format LP ( Linear Programming ) –CPLEX specific file format Output file format: TXT – ASCII text file for solutions

LP File Format Minimize / Maximize ( or Maximum/MAX/Minimum/MIN) // Objective function (LP): Obj: x1 + 2x2 + 3x3 + x4 + x5 //Quadratic programming problems Obj:x1 + x2 + [ x1^2 + 4x1*x2 + 7xx^2 ] Subject To( or such that, st, S.T., ST ) //Constraints: C1: -x1 + x2 + x3 + 10x4 + x5 <= 20 C2: x1 –3x2 + x3 - 7x5 <= 30 C3: x2 - 4x4 <= 0 Continues

Bounds( or bound ) // default lower bound is 0, default upper bound is +  // In this example, 0 <= x2 <=  // +  : +infinity, +inf; -  : -infinity, -inf // x5 free: -inf <= x5 <= +inf 0 <= x1 <= 40 0 <= x4 <= 3 x5 free // Mixed Integer Linear Programming Problems General ( or Generals, GEN ) // x4={0,1,2,3} x4 Binary ( or Binaries, BIN ) // x3={0,1} x3 End

Running CPLEX Sun-66> cplex Welcome to CPLEX Linear Optimizer with Mixed Integer & Barrier Solvers Copyright (c) ILOG 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>

CPLEX> help add add constraints to the problem baropt solve using barrier algorithm change change the problem display display problem, solution, or parameter settings enter enter a new problem help provide information on CPLEX commands mipopt solve a mixed integer program netopt solve the problem using network method primopt solve using the primal method quit leave CPLEX read read problem or basis information from a file set set parameters tranopt solve using the dual method write write problem or solution info. to a file xecute execute a command from the operating system Enter enough characters to uniquely identify commands & options. Commands may be executed in either of two formats: 1. Incremental entry--enter the command name, and CPLEX will prompt you for additional required information. 2. Single-line entry--CPLEX accepts single-line command strings, provided simple syntax rules are observed.

CPLEX> read o10x10.lp // Read data file filename.lp Problem ‘o10x10.lp' read. Read time = 0.48 sec. CPLEX> primopt ( or netopt, mipopt, tranopt ) // Choose one optimizer Tried aggregator 1 time. LP Presolve eliminated 32 rows and 4 columns. Reduced LP has 890 rows, 137 columns, and 2536 nonzeros. Presolve time = 0.07 sec. Iteration log... Iteration: 1 Scaled infeas = Iteration: 64 Scaled infeas = Switched to devex. Iteration: 142 Scaled infeas = Iteration: 212 Objective = Iteration: 287 Objective = Iteration: 349 Objective = Iteration: 411 Objective = Iteration: 473 Objective = Iteration: 543 Objective = Removing shift (12). Iteration: 571 Scaled infeas = Iteration: 574 Objective = Primal - Optimal: Objective = e-005 // Optimal value of the objective function Solution time = 2.25 sec. Iterations = 598 (214)// Running time

CPLEX> write output_file.sol txt // Write out solution Solution written to file 'output_file.sol'. CPLEX> quit // Quit CPLEX interactive System Sun-66> cat output_file.sol PROBLEM NAME o10x10.lp DATA NAME OBJECTIVE VALUE E-005 STATUS OPTIMAL SOLN ITERATION 598 OBJECTIVE obj (MIN) RHS RANGES BOUNDS SECTION 1 - ROWS NUMBER......ROW AT...ACTIVITY... SLACK ACTIVITY..LOWER LIMIT...UPPER LIMIT..DUAL ACTIVITY 1 obj BS E E-005 NONE NONE 1 2 c1 EQ E c2 EQ E c3 EQ E c4 EQ E-006 SECTION 2 - COLUMNS NUMBER.....COLUMN..... AT...ACTIVITY.....INPUT COST....LOWER LIMIT...UPPER LIMIT..REDUCED COST. 924 V1 BS E NONE V2 BS E NONE V3 BS E NONE 0