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

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

Fundamentals of Integer Programming

AMPL Network Optimization

Foundations of Operations Research Introduction to AMPL and Modellisation

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

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

Programming in OOP/C++

Math 464 (Spring 2007) Introduction to AMPL

Introduction to AMPL (Math 464, Spring 2018)

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

COMP9334: Capacity Planning of Computer Systems and Networks

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

NOTATION AND TERMINOLOGY

Algorithms for Decision Support. Integer linear programming models

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

Introduction to Mosel and Xpress

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

Contents. Introduction

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

MASSACHUSETTS INSTITUTE OF TECHNOLOGY

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

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

Columnwise Formulations

The MIP-Solving-Framework SCIP

Solving Linear and Integer Programs

The Ascendance of the Dual Simplex Method: A Geometric View

TIM 206 Lecture Notes Integer Programming

Graph Optimization - Lab 1

5.3 Cutting plane methods and Gomory fractional cuts

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

A hard integer program made easy by lexicography

V. Solving Integer Linear Programs

OPTIMIZAÇÃO E DECISÃO 09/10

Resource Allocation (p. 254)

Free modelling languages for linear and integer programming

Optimization Methods in Management Science

Math Introduction to Operations Research

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

Building Optimization-Enabled Applications Using AMPL API

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

Algebra 2 Notes Systems of Equations and Inequalities Unit 03b. Optimization with Linear Programming

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

Modelling of LP-problems (2WO09)

Advanced Use of GAMS Solver Links

CSE 101- Winter 18 Discussion Section Week 8

Algorithms. Abdelghani Bellaachia, CSCI 1121 Page: 1

Mathematical programming formulations using AMPL

Programming for Problem Solving 105A L T P Credit Major Minor Total Time

Unit.9 Integer Programming

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

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748

Developing Optimization Algorithms for Real-World Applications

Computer Laboratories: Mathematical Formulation and Implementation in GAMS. S. Vitali Charles University. 3/15/2017 Copyright 2017 S.

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

Column Generation: Cutting Stock

Algorithms for Integer Programming

Practice Final Exam 1

Primal Heuristics in SCIP

Foundations of Operations Research Introduction to AMPL and Modellisation

LINEAR PROGRAMMING INTRODUCTION 12.1 LINEAR PROGRAMMING. Three Classical Linear Programming Problems (L.P.P.)

Notes on the IFPRI Spatial Production Allocation NLP Model

Integer Programming Chapter 9

AMPL in the Cloud Using Online Services to Develop and Deploy Optimization Applications through Algebraic Modeling

FOUNDATIONS OF OPERATIONS RESEARCH

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

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

Chapter 15 Introduction to Linear Programming

CMPSCI611: Approximating SET-COVER Lecture 21

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

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

Math Models of OR: The Simplex Algorithm: Practical Considerations

Design and Analysis of Algorithms (V)

Vocabulary: Bits and Pieces III

3 INTEGER LINEAR PROGRAMMING

Column Generation Method for an Agent Scheduling Problem

Using COIN-OR to Solve the Uncapacitated Facility Location Problem

Arrays Structured data Arrays What is an array?

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

Benders in a nutshell Matteo Fischetti, University of Padova

Graph Coloring via Constraint Programming-based Column Generation

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

9.4 SOME CHARACTERISTICS OF INTEGER PROGRAMS A SAMPLE PROBLEM

Solutions for Operations Research Final Exam

Online Facility Location

Network Optimization

First one needs to download AMPL-SE zip-package from and extract it to a local directory. Follow the link in Figure 1!

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

Enhanced Genetic Algorithm for Solving the School Timetabling Problem

Reg. No. : Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, JANUARY First Semester GE 6151 COMPUTER PROGRAMMING

Linear & Integer Programming: A Decade of Computation

Linear Programming CISC4080, Computer Algorithms CIS, Fordham Univ. Linear Programming

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

A Nonlinear Presolve Algorithm in AIMMS

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

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

[AMPLNET] Object library description. This document is intended to provide information for users of the AMPLNET library.

Using AMPL/MINOS. 1 Applicability

Learning Packet THIS BOX FOR INSTRUCTOR GRADING USE ONLY. Mini-Lesson is complete and information presented is as found on media links (0 5 pts)

International Journal of Advance Research in Computer Science and Management Studies

Modern Benders (in a nutshell)

Transcription:

AMPL Integer Linear Programming ORLAB Operations Research Laboratory Borzou Rostami Politecnico di Milano, Italy January 18, 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 sets,..., U. 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.

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.

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/lab/lab5como.pdf