Modeling with COIN-OR Tools

Similar documents
Using COIN-OR to Solve the Uncapacitated Facility Location Problem

sbb COIN-OR Simple Branch-and-Cut

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

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

Experience with CGL in the PICO Mixed- Integer Programming Solver

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

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

Integer Programming Chapter 9

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

Optimization Services: A Framework For Distributed Optimization

NEOS.jl (and other things)

Fundamentals of Integer Programming

COIN-OR: Software Tools for Implementing Custom Solvers

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

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

The MIP-Solving-Framework SCIP

Source Code Not Required: Using the COIN-OR Binaries

lpsymphony - Integer Linear Programming in R

SBB: A New Solver for Mixed Integer Nonlinear Programming

The SYMPHONY Callable Library for Mixed-Integer Linear Programming

sbb COIN-OR Simple Branch-and-Cut

Algorithms for Decision Support. Integer linear programming models

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

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

Advanced Use of GAMS Solver Links

The Optimization Services Solver Interface

Building a Custom Solver with the COIN-OR Branch, Cut, and Price Frameworks

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

Modeling Systems and Optimization Services

yaposib Documentation

LaGO. Ivo Nowak and Stefan Vigerske. Humboldt-University Berlin, Department of Mathematics

Contents. Introduction

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

Optimization Methods in Management Science

Noncommercial Software for Mixed-Integer Linear Programming

LaGO - A solver for mixed integer nonlinear programming

3 INTEGER LINEAR PROGRAMMING

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

The Gurobi Solver V1.0

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

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

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

Motivation for Heuristics

LECTURE NOTES Non-Linear Programming

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

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

The SYMPHONY Callable Library for Mixed-Integer Linear Programming

V. Solving Integer Linear Programs

Review of Mixed-Integer Nonlinear and Generalized Disjunctive Programming Methods

COMP9334: Capacity Planning of Computer Systems and Networks

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

An extended supporting hyperplane algorithm for convex MINLP problems

The Optimization Services Project on COIN-OR

FilMINT: An Outer-Approximation-Based Solver for Nonlinear Mixed Integer Programs 1

Doing It in Parallel (DIP) with The COIN-OR High-Performance Parallel Search Framework (CHiPPS)

Heuristics in MILP. Group 1 D. Assouline, N. Molyneaux, B. Morén. Supervisors: Michel Bierlaire, Andrea Lodi. Zinal 2017 Winter School

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

AIMMS Function Reference - GMPInstance Procedures and Functions

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

PySP: modeling and solving stochastic programs in Python

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

Doing It in Parallel (DIP) with The COIN-OR High-Performance Parallel Search Framework (CHiPPS)

Introducton to COIN-OR Tools for Optimization

Benchmarking of Optimization Software

Gurobi Guidelines for Numerical Issues February 2017

Unit.9 Integer Programming

Solver Communications: Options and Results

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

COIN-OR Tools for Stochastic Programming

An extended supporting hyperplane algorithm for convex MINLP problems

Open Source Tools for Optimization in Python

Optimization Services hookup Language (OShL) Jun Ma. -- API for invoking Remote Solver Service

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

Introduction to CPLEX. Some very convenient solvers for most students include those with Excel and Matlab.

Free modelling languages for linear and integer programming

RiverWare Optimization

SCIP. 1 Introduction. 2 Model requirements. Contents. Stefan Vigerske, Humboldt University Berlin, Germany

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Tutorial on CPLEX Linear Programming

DM204 - Scheduling, Timetabling and Routing

Exploiting Degeneracy in MIP

Linear & Integer Programming: A Decade of Computation

Pure Cutting Plane Methods for ILP: a computational perspective

NOTATION AND TERMINOLOGY

Automatic Conference Scheduling with PuLP

BAC : A BCP based Branch-and-Cut Example. François Margot 1

Cutting Planes for Some Nonconvex Combinatorial Optimization Problems

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

Column Generation: Cutting Stock

Using the CoinAll Binaries

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

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

The AIMMS Outer Approximation Algorithm for MINLP

Recent enhancements in. GAMS Development Corporation

A hard integer program made easy by lexicography

COIN-OR: Revving up the Engine

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #16 Loops: Matrix Using Nested for Loop

Package lpsymphony. February 6, 2018

Notes on the IFPRI Spatial Production Allocation NLP Model

The AIMMS Outer Approximation Algorithm for MINLP

Transcription:

July 19, 2006

Simplest example: mps or lp file cbc command line Accessing Coin from AMPL GAMS

Getting help and reading problems in Simplest example: mps or lp file cbc command line The command line tool is fairly spartan. cbc is designed primarily for use as a library. To get help on a command, type the command followed by? Enter? for list of commands or help Coin:import? import : Import model from mps file Coin:import gt2 At line 15 NAME GT2 Problem GT2 has 29 rows, 188 columns and 376 elements Model was imported from./gt2 in -7.92823e-19 seconds Coin:

Solving command and messages Simplest example: mps or lp file cbc command line solve, primalsimplex, dualsimplex, : solves the problem using the desired method. solve does Branch & Bound and provides valuable information Coin:solve Cgl0004I processed model has 28 rows, 173 columns (173 integer) and 346 elements TwoMirCuts was tried 6 times and created 128 cuts of which 8 were active after adding rounds of cuts ( 0.012001 seconds) Result - Finished objective 21166 after 0 nodes and 101 iterations - took 0.380024 seconds

Printing results Use Cases Simplest example: mps or lp file cbc command line solution: prints all nonzero variables to a file or stdout Coin:solu 82 x0309 1 9.7109072e-14 85 x0609 3 1.0425477e-13 176 x1114 2-6.1756156e-16 Coin: solu outputfile Coin:

Coin Support in AMPL Accessing Coin from AMPL GAMS LP & IP cbc has support through its own plugin (driver) SOS, priorities, algorithms, etc. some features supported through suffixes, other through options. NLP IPOPT (continuous), BONMIN (mixed-integer)

Accessing Coin from AMPL GAMS The ampl plugin (driver) system 1. ampl creates a special instance file from a model and invokes the solver as a subprocess, through a plugin (a driver in ampl terminology) 2. The plugin uses a special library to read the instance and populate the solver s data structure 3. The plugin invokes the solver 4. The plugin uses the library to reformat the solver output in a way that ampl can interpret it 5. When the plugin exits, ampl reads another file to populate its data structures Key Point: So long as both the solver and the plugin can be found (i.e., they are on the users path), there should be no problem

Accessing Coin from AMPL GAMS Installing the cbc or ipopt plugin (driver) 1. Get the package (substitute Ipopt or Cbc for Pkg below): svn co https://projects.coin-or.org/svn/pkg/trunk pkg 2. Get the AMPL ASL library. There is a script with the distribution that makes setting up the ASL very convenient: cd cbc/thirdparty/asl./get.asl (for Ipopt, there are other external packages needed) 3. Run configure from the root directory of the source distribution (pkg in this case) and build. cd../.../configure --prefix=/usr/local make make install

Running cbc or ipopt from AMPL Accessing Coin from AMPL GAMS Make sure the executable is on your path. Then simply choose cbc or ipopt as the solver in AMPL: cbc example: ampl: model ablu.mod; data ablu.dat; ampl: option solver cbc; ampl: option cbc_options "cuts=root log=2 feas=on slog=1" ampl: solve; ampl: display x; to see all the possible cbc options accessible from ampl, try on the command line: cbc -verbose 7 -? less to see all the possible ipopt options accessible from ampl, see: http://www.coin-or.org/ipopt/ipopt options.html

Coin Support in GAMS Accessing Coin from AMPL GAMS LP & IP cbc has support out of the box cbc is accessible through its old name (sbb). In GAMS: coinsbb GLPK also accessible via an OSI interface: coinglpk NLP No support as of version 22 of GAMS for any Coin Nonlinear Solver

Running cbc from GAMS Accessing Coin from AMPL GAMS 1. Choose cbc as your default solver at install time LP (Linear Programming) models can be solved by: 3. CoinCbc (demo or student license) 4. CoinGlpk (demo or student license) Enter number for default, or hit enter for previous default of CPLEX: 3 Make similar choices for MIP and RMIP 2. Select cbc on the command-line gams transport.1 lp=coinsbb 3. Select cbc from within your model option lp=coinsbb You can also pass options to cbc using the special variables m.integer1, m.integer2, and m.integer3

Using Coin solvers from FlopC++ via OSI FlopC++ supports OSI natively. There is nothing different to do To select different solvers, simply pass the OsiSolverInteface desired: #include "flopc.hpp" using namespace flopc; #include <OsiCbcSolverInterface.hpp> class Paper : public MP_model { public: MP_set WIDTHS,PATTERNS; Paper(int numwidths) : MP_model(new OsiCbcSolverInterface), WIDTHS(numWidths), PATTERNS(numWidths),

Controlling the solution process Column Generation in FlopC++ Problems can be resolved without being regenerated do { ob = knapsack(numwidths, tabwidth, &Paper.rowPrice[demC.offset], maxwidth, pat); CoinPackedVector Pat; Pat.setFull(numWidths, pat); Paper->addCol(Pat,0,100,1); Paper->resolve(); } while(ob>1.0001);

Using Coin solvers directly via OSI Typically, build your application to a generic solver class UFL { private: OsiSolverInterface * si; Fill in the Coin and Osi data structures with A, rhs, c, etc. CoinPackedMatrix * matrix = new CoinPackedMatrix(false,0,0); matrix->setdimensions(0, n_cols); for (i = 0; i < M; i++) { //demand constraints: CoinPackedVector row; for (j = 0; j < N; j++) row.insert(xindex(i,j), 1.0); matrix->appendrow(row); }

Tighten the formulation si is a pointer to an OsiSolverInterface OsiCuts cutlist; si->setinteger(integer_vars, N); CglGomory * gomory = new CglGomory; gomory->setlimit(100); gomory->generatecuts(*si, cutlist); CglKnapsackCover * knapsack = new CglKnapsackCover; knapsack->generatecuts(*si, cutlist); CglSimpleRounding * rounding = new CglSimpleRounding; rounding->generatecuts(*si, cutlist); CglOddHole * oddhole = new CglOddHole; oddhole->generatecuts(*si, cutlist); CglProbing * probe = new CglProbing; probe->generatecuts(*si, cutlist); si->applycuts(cutlist);

Solve! si is a pointer to an OsiSolverInterface Instantiate the si pointer si = new OsiCbcSolverInterface(); solve! si->branchandbound(); Get Results double *sol = si->getcolsolution();

Access a Coin Solver over a web service Soon to be part of COIN-OR! 1. Generate an OSiL file an XML representation of an instance, and encode solver options into an OSoL file. 2. Invoke the server remotely string osil, osol, osrl; string svc = "128.135.130.17:8080/os/clp/ClpSolverService.jws OSSolverAgent* osagent = new OSSolverAgent(svc); // this is the synchronous solver invocation method. osrl = osagent->solve(osil, osol); // print the result cout << osrl << endl;

projects.coin-or.org/cbc/wiki/faq www.gams.com/gamscoin projects.coin-or.org/flopc++ Ted and Matt s talk @ EURO 06 gsbkip.chicagogsb.edu/ostalks/ostalks.html