AMPL Integer Linear Programming And Sensitivity Analysis for LP. ORLAB Operations Research Laboratory. Borzou Rostami. Politecnico di Milano, Italy

Similar documents
AMPL Integer Linear Programming. ORLAB Operations Research Laboratory. Borzou Rostami. Politecnico di Milano, Italy.

Fundamentals of Integer Programming

Integer Programming. Xi Chen. Department of Management Science and Engineering International Business School Beijing Foreign Studies University

AMPL Network Optimization

The Ascendance of the Dual Simplex Method: A Geometric View

COMP9334: Capacity Planning of Computer Systems and Networks

NOTATION AND TERMINOLOGY

Optimization Methods in Management Science

Section Notes 4. Duality, Sensitivity, and the Dual Simplex Algorithm. Applied Math / Engineering Sciences 121. Week of October 8, 2018

Foundations of Operations Research Introduction to AMPL and Modellisation

V. Solving Integer Linear Programs

Simulation. Lecture O1 Optimization: Linear Programming. Saeed Bastani April 2016

Contents. Introduction

Notes on AMPL for and (Adapted from notes by Sommer Gentry)

Introduction to Mathematical Programming IE496. Final Review. Dr. Ted Ralphs

5.3 Cutting plane methods and Gomory fractional cuts

Ryerson Polytechnic University Department of Mathematics, Physics, and Computer Science Final Examinations, April, 2003

Solving Linear and Integer Programs

Outline. Column Generation: Cutting Stock A very applied method. Introduction to Column Generation. Given an LP problem

Column Generation: Cutting Stock

BCN Decision and Risk Analysis. Syed M. Ahmed, Ph.D.

The MIP-Solving-Framework SCIP

TIM 206 Lecture Notes Integer Programming

Math 464 (Spring 2007) Introduction to AMPL

Algorithms for Decision Support. Integer linear programming models

Programming in OOP/C++

Introduction to AMPL (Math 464, Spring 2018)

MVE165/MMG631 Linear and integer optimization with applications Lecture 7 Discrete optimization models and applications; complexity

Advanced Operations Research Techniques IE316. Lecture 10. Dr. Ted Ralphs

Integer Programming Chapter 9

Modelling of LP-problems (2WO09)

Homework 2: Multi-unit combinatorial auctions (due Nov. 7 before class)

4 LINEAR PROGRAMMING (LP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

Solutions for Operations Research Final Exam

OPTIMIZAÇÃO E DECISÃO 09/10

1. Lecture notes on bipartite matching February 4th,

Math Models of OR: The Simplex Algorithm: Practical Considerations

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Linear Programming. L.W. Dasanayake Department of Economics University of Kelaniya

Introduction. Chapter 15. Optimization Modeling: Applications. Integer Programming. Manufacturing Example. Three Types of ILP Models

MVE165/MMG631 Linear and integer optimization with applications Lecture 9 Discrete optimization: theory and algorithms

Building Optimization-Enabled Applications Using AMPL API

Unit.9 Integer Programming

MASSACHUSETTS INSTITUTE OF TECHNOLOGY

Cloud Branching MIP workshop, Ohio State University, 23/Jul/2014

Introduction to Mathematical Programming IE406. Lecture 20. Dr. Ted Ralphs

MVE165/MMG630, Applied Optimization Lecture 8 Integer linear programming algorithms. Ann-Brith Strömberg

Integer Programming Explained Through Gomory s Cutting Plane Algorithm and Column Generation

Math Introduction to Operations Research

Gurobi Guidelines for Numerical Issues February 2017

Prepared By. Handaru Jati, Ph.D. Universitas Negeri Yogyakarta.

3 INTEGER LINEAR PROGRAMMING

Introduction to Mosel and Xpress

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Algorithms for Integer Programming

Design and Analysis of Algorithms (V)

Chapter 15 Introduction to Linear Programming

9.4 SOME CHARACTERISTICS OF INTEGER PROGRAMS A SAMPLE PROBLEM

Benders in a nutshell Matteo Fischetti, University of Padova

Mathematical and Algorithmic Foundations Linear Programming and Matchings

February 19, Integer programming. Outline. Problem formulation. Branch-andbound

Working Under Feasible Region Contraction Algorithm (FRCA) Solver Environment

Linear Programming. Course review MS-E2140. v. 1.1

Columnwise Formulations

Chapter 7. Linear Programming Models: Graphical and Computer Methods

5. DUAL LP, SOLUTION INTERPRETATION, AND POST-OPTIMALITY

2 is not feasible if rounded. x =0,x 2

SUBSTITUTING GOMORY CUTTING PLANE METHOD TOWARDS BALAS ALGORITHM FOR SOLVING BINARY LINEAR PROGRAMMING

Lesson 08 Linear Programming

56:272 Integer Programming & Network Flows Final Exam -- December 16, 1997

A hard integer program made easy by lexicography

Math 414 Lecture 30. The greedy algorithm provides the initial transportation matrix.

Column Generation Method for an Agent Scheduling Problem

Econ 172A - Slides from Lecture 2

Agenda. Understanding advanced modeling techniques takes some time and experience No exercises today Ask questions!

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 36

This matrix is not TU since the submatrix shown below has determinant of

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Benders Decomposition

Department of Mathematics Oleg Burdakov of 30 October Consider the following linear programming problem (LP):

SUBSTITUTING GOMORY CUTTING PLANE METHOD TOWARDS BALAS ALGORITHM FOR SOLVING BINARY LINEAR PROGRAMMING

Primal Heuristics in SCIP

Resource Allocation (p. 254)

Integrating Optimization Modeling with General-Purpose Programming for Efficient and Reliable Application Deployment

4 Integer Linear Programming (ILP)

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang

Linear Programming. them such that they

Integer Programming! Using linear programming to solve discrete problems

56:272 Integer Programming & Network Flows Final Examination -- December 14, 1998

The AMPL approach. # used in distributing starting periods

a) Alternative Optima, b) Infeasible(or non existing) solution, c) unbounded solution.

4 Linear Programming (LP) E. Amaldi -- Foundations of Operations Research -- Politecnico di Milano 1

Linear & Integer Programming: A Decade of Computation

1. Lecture notes on bipartite matching

MATHEMATICS II: COLLECTION OF EXERCISES AND PROBLEMS

Mathematical programming formulations using AMPL

Financial Optimization ISE 347/447. Lecture 13. Dr. Ted Ralphs

Approximation Algorithms: The Primal-Dual Method. My T. Thai

Approximation Algorithms

Econ 172A - Slides from Lecture 9

Transcription:

AMPL Integer Linear Programming And Sensitivity Analysis for LP ORLAB Operations Research Laboratory Borzou Rostami Politecnico di Milano, Italy December 6, 2012

Integer Programming: Many linear programming problems require certain variables to have whole number, or integer, values. Such a requirement arises naturally when the variables represent entities like packages or people that cannot be fractionally divided - at least, not in a meaningful way for the situation being modeled. Integer variables also play a role in formulating equation systems that model logical conditions. Integer variables Consider the diet problem in session 2. ampl: model diet.mod; data diet.dat; ampl: solve; CPLEX 11.2.0: optimal solution; objective 3.37 1 dual simplex iterations (0 in phase I) ampl: print{j in J} (j,x[j]); Bread 4 Milk 3 Eggs 1 Meat 1.5000000000000002 Cake 0 We want the foods to be purchased in integral amounts.

By adding the keyword integer to the qualifying phrases of a var declaration, you restrict the declared variables to integer values. (var x{j in J} integer >= 0, <= q[j];) We can then try to re-solve: ampl: model diet.mod; data diet.dat; solve; CPLEX 11.2.0: optimal integer solution; objective 3.62 1 MIP simplex iterations 0 branch-and-bound nodes ampl: print {j in J} (j,x[j]); Bread 2 Milk 3 Eggs 1 Meat 2 Cake 0 Comparing this solution to the previous one, we see a few features typical of integer programming.

The minimum cost has increased from 3.37 to 3.62; because integrality is an additional constraint on the values of the variables, it can only make the objective less favorable. The amounts of the different foods in the diet have also changed. Meat that had fractional amounts in the original optimum, have increased from 1.5000000000000002 to 2. Bread has dropped from the upper limit of 4 to 2. Note: Clearly, you cannot always deduce the integer optimum by rounding the noninteger optimum to the closest integer values.

Binary Variables: Set covering Problem: In the set covering problem, we are given a universe U, such that U = n, and the sets,..., U. Set Cover: A set cover is a collection S of some of the sets from,..., whose union is the entire universe U. Formally, S is a set cover if. If be the cost associated to set e would like to select a set cover S with the minimum cost.

Example: Suppose U= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} and = {1, 2, 3, 8, 9, 10}, = {1, 2, 3, 4, 5}, = {4, 5, 7}, = {5, 6, 7}, and = {6, 7, 8, 9, 10}. Find a set cover with a minimum cost.

{ { Formulation: S.t. { }

AMPL model file (Setcovering.mod)

AMPL data file (Setcovering.dat)

Fixed Cost problem: Gandy Cloth Company is capable of manufacturing three types of clothing: Shirts, shorts, and pants. The manufacture of each type of clothing requires that Gandy have the appropriate type of machinery available. This machinery can be rented at the following rates: shirt machinery, $200/week; shorts machinery, $150/week; pants machinery, $100/week. Each type of clothing requires the amount of cloth and labor given in the table below. The sales price and variable cost are also given in the table. Labor Hours Cloth (sq. m) Sales Price Variable Cost Shirts 3 4 $12 $6 Shorts 2 3 $8 $4 Pants 6 4 $15 $8 Available: 150 hours 160 sq. m Given an integer linear programming formulation for the problem

Formulation: : The quantity of clothing of type j { { }

AMPL data file (Fixedcost.dat)

Assignment Problem: A company has 4 machines available for assignment to 4 tasks. Any machine can be assigned to any task, and each task requires processing by one machine. The time required to set up each machine for the processing of each task is given in the table below. TIME (Hours) Task1 Task2 Task3 Task4 Machine1 13 4 7 6 Machine2 1 11 5 4 Machine3 6 7 2 8 Machine4 1 3 5 9 The company wants to minimize the total setup time needed for the processing of all four tasks.

{ Formulation: S.t. { }

AMPL model file (assignment.mod)

AMPL data file (assignment.dat)

MINOS 5.5: ignoring integrality of 16 variables MINOS 5.5: optimal solution found. 8 iterations, objective 11 ampl: option solver cplex; ampl: solve; CPLEX 11.2.0: optimal integer solution; objective 11 5 MIP simplex iterations 0 branch-and-bound nodes ampl: option omit_zero_rows 1; ampl: display x; x := Machine1 Task2 1 Machine2 Task4 1 Machine3 Task3 1 Machine4 Task1 1 ;

Uncapacitated Facility Location (UFL) Given a set of potential depots and a set of clients (or customers), suppose there is a fixed cost associated with the use of depot j, and a transportation cost if all of client i s order is delivered from depot j. The problem is to decide which depots to open, and which depots serves each client so as to minimize the sum of fixed and transportation cost.

AMPL commands for Sensitivity Analysis -------------------------------------- option presolve 0; option solver cplex; option cplex_options sensitivity presolve=0 ; 1- display <var name>.rc; Displays the reduced cost of the variable named <var name>. 2- display <var name>.down ; Displays, respectively, the lower and upper endpoints of display <var name>.up; the range of the objective-function coefficient of the variable named <var name> for which the current basis remains optimal.

3- display <var name>.current; Displays the current value of the objective-function coefficient of the variable named <var name>. 4- display <constr name>; Displays the shadow price of the constraint <constr name>. 5- display <constr name>.down; Displays, respectively, the lower and upper endpoints of display <constr name>.up; the range of the right-hand-side of the constraint named <constr name> for which the current basis remains feasible, and hence optimal. 6- display <constr name>.current; Displays the current value of the right-hand-side of the constraint named <constr name>.

7- display <constr name>.slack; Displays the slack in the constraint named <constr name>. 8- let <name>:=<value>; Assigns the variable or parameter named <name> the <value>. Useful for making small changes to the LP For larger changes, use "reset data; data <new data-file>;" Remember that the theory of sensitivity analysis is developed only for linear programs. If integer variables are present, it can only be carried out for the corresponding continuous relaxation. In such case, add the command option relax integrality 1 ;

Some useful AMPL commands ------------------------- expand; Displays the current LP model with the instantiated data. Useful for debugging and in sensitivity analysis to know which LP AMPL is really solving. Can also type "expand <name>;", where <name> is the name of a constraint or objective function to display only the given constraint or objective function instantiated with data. show; Displays the names of the sets, parameters, variables, constraints, and objective function of current LP model. Can also type "show <name>;" where <name> is the name of a set, parameter, variable, constraint or objective function.

reset; AMPL always works with a current LP model, and "reset;" resets the current AMPL LP to the empty LP. Useful if you want to solve multiple LPs in the same session. reset data; Resets only the data of the current LP model retaining the model.

Downloading AMPL Student Edition Software http://www.ampl.com/downloads/ My Email Address rostami@elet.polimi.it Lab session web site http://home.dei.polimi.it/rostami/lab2012/lab4como.pdf http://home.dei.polimi.it/rostami/lab2012/lab4como2.pdf