Tools for Modeling Optimization Problems A Short Course. Algebraic Modeling Systems. Dr. Ted Ralphs

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

Computational Integer Programming. Lecture 5: Algebraic Modeling (Part I) Dr. Ted Ralphs

The COIN-OR Optimization Suite: Open Source Tools for Optimization Part 4: Modeling with COIN

Open Source Tools for Optimization in Python

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

An open-source stochastic programming solver. H.I. Gassmann, Dalhousie University J. Ma, JTechnologies R.K. Martin, The University of Chicago

Computational Integer Programming. Lecture 3: Software. Dr. Ted Ralphs

CoinEasy. Kipp Martin Booth School of Business University of Chicago. November 9, 2010

Optimization Services (OS) Today: open Interface for Hooking Solvers to Modeling Systems

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

Modelling. Christina Burt, Stephen J. Maher, Jakob Witzig. 29th September Zuse Institute Berlin Berlin, Germany

NOTATION AND TERMINOLOGY

Free modelling languages for linear and integer programming

Interactions between a Modeling System and Advanced Solvers. GAMS Development Corporation

Recent enhancements in. GAMS Development Corporation

GAMS. General Algebraic Modeling System. EURO 2009 Bonn. Michael Bussieck Jan-Hendrik Jagla

Modeling with COIN-OR Tools

Benchmarking of Optimization Software

NEOS.jl (and other things)

Outline. Modeling. Outline DMP204 SCHEDULING, TIMETABLING AND ROUTING. 1. Models Lecture 5 Mixed Integer Programming Models and Exercises

Linear Programming. Slides by Carl Kingsford. Apr. 14, 2014

Modeling Languages CAS 737 / CES 735. Kristin Davies Olesya Peshko Nael El Shawwa Doron Pearl

Solver Communications: Options and Results

Linking GAMS to Solvers Using COIN-OSI. Michael Bussieck Steve Dirkse GAMS Development Corporation

The Efficient Modelling of Steam Utility Systems

CMSC 451: Linear Programming

StochDynamicProgramming.jl : a Julia package for multistage stochastic optimization.

Optimization Services Instance Language (OSiL) Part I. Jun Ma. Robert Fourer. Jun Ma. Northwestern University Kipp Martin University of Chicago

Recent enhancements in. GAMS Software GmbH GAMS Development Corporation

Algebraic modeling languages. Andrés Ramos Universidad Pontificia Comillas

An extended supporting hyperplane algorithm for convex MINLP problems

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

Rapid Application Development & Grid Computing Using GAMS. Software Demonstration INFORMS San Francisco 2005

Solving Scenarios in the Cloud

Optimization Services: A Framework For Distributed Optimization

Review of Mixed-Integer Nonlinear and Generalized Disjunctive Programming Methods

The Supporting Hyperplane Optimization Toolkit A Polyhedral Outer Approximation Based Convex MINLP Solver Utilizing a Single Branching Tree Approach

Recent Enhancement in GAMS. GAMS Software GmbH GAMS Development Corp.

Optimization Services (OS) Jun Ma. -- A Framework for Optimization Software -- A Computational Infrastructure -- The Next Generation NEOS

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

Using COIN-OR to Solve the Uncapacitated Facility Location Problem

Noncommercial Software for Mixed-Integer Linear Programming

Lecture 14. Resource Allocation involving Continuous Variables (Linear Programming) 1.040/1.401/ESD.018 Project Management.

COMP9334: Capacity Planning of Computer Systems and Networks

An Open Source Solver for Bicriteria Mixed Integer Programs

Developing Optimization Applications Quickly and Effectively with Algebraic Modeling in AMPL

MS&E 318 (CME 338) Large-Scale Numerical Optimization

Recent enhancements in. GAMS Software GmbH GAMS Development Corporation

LPFML: A W3C XML Schema for Linear and Integer Programming. Robert Fourer Northwestern University

What's New In Gurobi 5.0. Dr. Edward Rothberg

Institute on Computational Economics (ICE05) Argonne National Laboratory July 18 22, Problem-Solving Environments for Optimization: NEOS

Agenda. GAMS Development / GAMS Software. GAMS at a Glance. An illustrative Example: The Mean Variance Model. Grid Computing

GAMS. Grid Computing

Optimization Methods in Management Science

The SAS/OR s OPTMODEL Procedure :

LP SCIP NEOS URL. example1.lp 2.1 LP 1. minimize. subject to, bounds, free, general, binary, end. .lp 1 2.2

Design Principles that Make the Difference

Integer Programming ISE 418. Lecture 1. Dr. Ted Ralphs

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

Wireless frequency auctions: Mixed Integer Programs and Dantzig-Wolfe decomposition

Mixed Integer Programming Class Library (MIPCL)

COIN-OR: Software Tools for Implementing Custom Solvers

MS&E 318 (CME 338) Large-Scale Numerical Optimization

Optimization Services Instance Language (OSiL)

GAMS. How can I make this work... arrgghh? GAMS Development Corporation

New Parallel Programming Languages for Optimization Research

The SYMPHONY Callable Library for Mixed-Integer Linear Programming

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

GAMS Striving for Innovation and Compatibility

LPL: Product Description

Python Optimization Modeling Objects (Pyomo)

High-level optimization modeling software in distributed computing environment

Pre Conference Workshop. GAMS Software GmbH GAMS Development Corporation

BACK TO MATH LET S START EASY.

StochDynamicProgramming Documentation

ScaLP: A Light-Weighted (MI)LP Library

Best practices for using the multistart algorithm in AIMMS. Marcel Hunting AIMMS Optimization Specialist

INTERIOR-POINT LINEAR PROGRAMMING SOLVERS

automatic differentiation techniques used in jump

AM 221: Advanced Optimization Spring 2016

An extended supporting hyperplane algorithm for convex MINLP problems

optlang Documentation

Using Linear Programming for Management Decisions

Computational Experience with Parallel Integer Programming using the CHiPPS Framework. INFORMS Annual Conference, San Diego, CA October 12, 2009

The Traveling Salesman Problem with Neighborhoods: MINLP solution

GMO: GAMS Next-Generation Model API. GAMS Development Corporation

First steps to solve MINLP problems with Muriqui Optimizer

Decomposition Methods for Mathematical Programming Problems. GAMS Software GmbH / GAMS Development Corp.

Optimization. Using Analytic Solver Platform REVIEW BASED ON MANAGEMENT SCIENCE

An Introduction to (Student) GAMS and GAMSIDE

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

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

Mathematical Programming and Combinatorial Heuristics

Developing Optimization Applications Quickly and Effectively with Algebraic Modeling

A Survey of Software Packages for Teaching Linear and Integer Programming

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

Rapid Application Prototyping using GAMS

FIS Client Point Getting Started Guide

PySP: modeling and solving stochastic programs in Python

Implementing Custom Applications with CHiPPS. INFORMS Annual Conference, San Diego, CA October 12, 2009

Transcription:

Tools for Modeling Optimization Problems A Short Course Algebraic Modeling Systems Dr. Ted Ralphs

Algebraic Modeling Systems 1 The Modeling Process Generally speaking, we follow a four-step process in modeling. Develop an abstract model. Populate the model with data. Solve the model. Analyze the results. These four steps generally involve different pieces of software working in concert. For mathematical programs, the modeling is often done with an algebraic modeling system. Data can be obtained from a wide range of sources, including spreadsheets. Solution of the model is usually relegated to specialized software, depending on the type of model.

Algebraic Modeling Systems 2 Modeling Software Commercial Systems GAMS MPL AMPL AIMMS SAS (OPT MODEL) Python-based Open Source Modeling Languages and Interfaces Pyomo PuLP/Dippy CyLP (provides API-level interface) yaposib

Algebraic Modeling Systems 3 Modeling Software (cont d) Other Front Ends (mostly open source) FLOPC++ (algebraic modeling in C++) CMPL MathProg.jl (modeling language built in Julia) GMPL (open-source AMPL clone) ZMPL (stand-alone parser) SolverStudio (spreadsheet plug-in: www.opensolver.org) R (RSymphony Plug-in) Matlab (OPTI)

Algebraic Modeling Systems 4 Solver Software: Linear Optimization Commercial solvers CPLEX Gurobi XPRESS-MP MOSEK LINDO Excel SOLVER Open source solvers CLP DYLP GLPK lp solve SOPLEX (free for academic use only)

Algebraic Modeling Systems 5 Computational Infrastructure for Operations Research (COIN-OR) COIN-OR is an open source project dedicated to the development of open source software for solving operations research problems. COIN-OR distributes a free and open source suite of software that can handle all the classes of problems we ll discuss. Clp (LP) Cbc (MILP) Ipopt (NLP) SYMPHONY (MILP, BMILP) Bonmin (Convex MINLP) Couenne (Non-convex MINLP) Optimization Services (Interface) COIN also develops standards and interfaces that allow software components to interoperate. Check out the Web site for the project at http://www.coin-or.org

Algebraic Modeling Systems 6 AMPL AMPL is one of the most commonly used modeling languages, but many other languages, including GAMS, are similar in concept. AMPL has many of the features of a programming language, including loops and conditionals. Most available solvers will work with AMPL. GMPL and ZIMPL are open source languages that implement subsets of AMPL. The Python-based languages to be introduced later have similar functionality, but a more powerful programming environment. AMPL will work with all of the solvers we ve discussed so far. You can also submit AMPL models to the NEOS server. Student versions can be downloaded from www.ampl.com.

Algebraic Modeling Systems 7 How They Interface Although not required, it s useful to know something about how modeling languages interface with solvers. In many cases, modeling languages interface with solvers by writing out an intermediate file that the solver then reads in. It is also possible to generate these intermediate files directly from a custom-developed code. Common file formats MPS format: The original standard developed by IBM in the days of Fortran, not easily human-readable and only supports (integer) linear modeling. LP format: Developed by CPLEX as a human-readable alternative to MPS..nl format: AMPL s intermediate format that also supports non-linear modeling. OSIL: an open, XML-based format used by the Optimization Services framework of COIN-OR.

Algebraic Modeling Systems 8 Example: Simple Bond Portfolio Model (bonds simple.mod) A bond portfolio manager has $100K to allocate to two different bonds. Bond Yield Maturity Rating A 4 3 A (2) B 3 4 Aaa (1) The goal is to maximize total return subject to the following limits. The average rating must be at most 1.5 (lower is better). The average maturity must be at most 3.6 years. Any cash not invested will be kept in a non-interest bearing account and is assumed to have an implicit rating of 0 (no risk).

Algebraic Modeling Systems 9 AMPL Concepts In many ways, AMPL is like any other programming language. Example: Bond Portfolio Model ampl: option solver clp; ampl: var X1; ampl: var X2; ampl: maximize yield: 4*X1 + 3*X2; ampl: subject to cash: X1 + X2 <= 100; ampl: subject to rating: 2*X1 + X2 <= 150; ampl: subject to maturity: 3*X1 + 4*X2 <= 360; ampl: subject to X1_limit: X1 >= 0; ampl: subject to X2_limit: X2 >= 0; ampl: solve;... ampl: display X1; X1 = 50 ampl: display X2; X2 = 50

Algebraic Modeling Systems 10 Storing Commands in a File (bonds simple.run) You can type the commands into a file and then load them. This makes it easy to modify your model later. Example: ampl: option solver clp; ampl: model bonds_simple.mod; ampl: solve;... ampl: display X1; X1 = 50 ampl: display X2; X2 = 50

Algebraic Modeling Systems 11 Generalizing the Model Suppose we don t know ahead of time what bonds we want to include or what the input data describing each bond will be. For this purpose, we can develop an abstract algebraic model without specifying values for the input data. Components of an abstract algebraic model are Data Sets: Lists of stocks and other investment options Parameters: Numerical inputs such as budget restrictions, historical returns, etc. Model Variables: Values in the model that need to be decided upon. Objective Function: A function of the variable values to be maximized or minimized. Constraints: Functions of the variable values that must lie within given bounds.

Algebraic Modeling Systems 12 Example: General Bond Portfolio Model (bonds.mod) set bonds; param yield {bonds}; param rating {bonds}; param maturity {bonds}; param max_rating; param max_maturity; param max_cash; var buy {bonds} >= 0; # bonds available # yields # ratings # maturities # Maximum average rating allowed # Maximum maturity allowed # Maximum available to invest # amount to invest in bond i maximize total_yield : sum {i in bonds} yield[i] * buy[i]; subject to cash_limit : sum {i in bonds} buy[i] <= max_cash; subject to rating_limit : sum {i in bonds} rating[i]*buy[i] <= max_cash*max_rating; subject to maturity_limit : sum {i in bonds} maturity[i]*buy[i] <= max_cash*max_maturity;

Algebraic Modeling Systems 13 Getting the Data (bonds.dat) The data to populate the model can come from a number of sources. AMPL has its own format for specifying the data in the model. set bonds := A B; param : yield rating maturity := A 4 2 3 B 3 1 4; param max_cash := 100; param max_rating 1.5; param max_maturity 3.6;

Algebraic Modeling Systems 14 Solving the Model (bonds.run) ampl: model bonds.mod; ampl: data bonds.dat; ampl: solve;... ampl: display buy; buy [*] := A 50 B 50 ;

Algebraic Modeling Systems 15 Modifying the Data (bonds alt.dat) Suppose we want to increase available production hours by 2000. To resolve from scratch, simply modify the data file and reload. ampl: reset data; ampl: data bonds_alt.dat; ampl: solve;... ampl: display buy; buy [*] := A 30 B 70 ;

Algebraic Modeling Systems 16 Modifying Individual Data Elements Instead of resetting all the data, you can modify one element. ampl: reset data max_cash; ampl: data; ampl data: param max_cash := 150; ampl data: solve;... ampl: display buy; buy [*] := A 45 B 105 ;

Algebraic Modeling Systems 17 Extending the Model (bonds extended.dat) Now suppose we want to add another type of bond. set bonds := A B C; param : yield rating maturity := A 4 2 3 B 3 1 4 C 6 3 2; param max_cash := 100; param max_rating 1.3; param max_maturity 3.8;

Algebraic Modeling Systems 18 Solving the Extended Model ampl: reset data; ampl: data bonds_extended.dat; ampl: solve;.. ampl: display buy; buy [*] := A 0 B 85 C 15 ;

Algebraic Modeling Systems 19 Getting Data from a Spreadsheet (FinancialModels.xlsx:Bonds1-AMPL) Another obvious source of data is a spreadsheet, such as Excel. AMPL has commands for accessing data from a spreadsheet directly from the language. An alternative is to use SolverStudio. SolverStudio allows the model to be composed within Excel and imports the data from an associated sheet. Results can be printed to a window or output to the sheet for further analysis.

Algebraic Modeling Systems 20 Further Generalization (FinancialModels.xlsx:Bonds2-AMPL) Note that in our AMPL model, we essentially had three features of a bond that we wanted to take into account. Maturity Rating Yield We constrained the level of two of these and then optimized the third one. The constraints for the features all have the same basic form. What if we wanted to add another feature? We can make the list of features a set and use the concept of a two-dimensional parameter to create a table of bond data.