Using COIN-OR to Solve the Uncapacitated Facility Location Problem

Similar documents
Modeling with COIN-OR Tools

COIN-OR: Software Tools for Implementing Custom Solvers

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

sbb COIN-OR Simple Branch-and-Cut

Fundamentals of Integer Programming

sbb COIN-OR Simple Branch-and-Cut

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

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

The SYMPHONY Callable Library for Mixed-Integer Linear Programming

Open Source Tools for Optimization in Python

Integer Programming Chapter 9

Noncommercial Software for Mixed-Integer Linear Programming

An Open Source Solver for Bicriteria Mixed Integer Programs

Algorithms for Decision Support. Integer linear programming models

3 INTEGER LINEAR PROGRAMMING

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

Experiments On General Disjunctions

Advanced Use of GAMS Solver Links

A Generic Separation Algorithm and Its Application to the Vehicle Routing Problem

Experience with CGL in the PICO Mixed- Integer Programming Solver

lpsymphony - Integer Linear Programming in R

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

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

5.3 Cutting plane methods and Gomory fractional cuts

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

Source Code Not Required: Using the COIN-OR Binaries

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

The MIP-Solving-Framework SCIP

Exploiting Degeneracy in MIP

The SYMPHONY Callable Library for Mixed-Integer Linear Programming

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

Computational Integer Programming. Lecture 12: Branch and Cut. Dr. Ted Ralphs

Solving lexicographic multiobjective MIPs with Branch-Cut-Price

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

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

DIP and DipPy: Towards a Decomposition-based MILP Solver. International Symposium on Mathematical Programming, August 2012

Benders in a nutshell Matteo Fischetti, University of Padova

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

Math Models of OR: The Simplex Algorithm: Practical Considerations

DETERMINISTIC OPERATIONS RESEARCH

The SYMPHONY Callable Library for Mixed-Integer Linear Programming

SYMPHONY 4.0 User s Manual 1

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

Linear & Integer Programming: A Decade of Computation

Welcome to the Webinar. What s New in Gurobi 7.5

The Heuristic (Dark) Side of MIP Solvers. Asja Derviskadic, EPFL Vit Prochazka, NHH Christoph Schaefer, EPFL

2. Modeling AEA 2018/2019. Based on Algorithm Engineering: Bridging the Gap Between Algorithm Theory and Practice - ch. 2

An Improved Algorithm for Solving Biobjective Integer Programs

Parallel Branch & Bound

15-854: Approximations Algorithms Lecturer: Anupam Gupta Topic: Direct Rounding of LP Relaxations Date: 10/31/2005 Scribe: Varun Gupta

Pivot and Gomory Cut. A MIP Feasibility Heuristic NSERC

Cutting Planes for Some Nonconvex Combinatorial Optimization Problems

Mixed Integer Programming Class Library (MIPCL)

Exact Algorithms for Mixed-Integer Bilevel Linear Programming

An Improved Algorithm for Biobjective Integer Programs

Implementing a B&C algorithm for Mixed-Integer Bilevel Linear Programming

The Gurobi Solver V1.0

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

Branch-and-cut implementation of Benders decomposition Matteo Fischetti, University of Padova

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

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

Primal Heuristics in SCIP

COIN-OR Tools for Stochastic Programming

(Duality), Warm Starting, and Sensitivity Analysis for MILP

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

The University of Jordan Department of Mathematics. Branch and Cut

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

A Computational Study of Conflict Graphs and Aggressive Cut Separation in Integer Programming

Progress in Linear Programming-Based Algorithms for Integer Programming: An Exposition

yaposib Documentation

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

15.083J Integer Programming and Combinatorial Optimization Fall Enumerative Methods

TIM 206 Lecture Notes Integer Programming

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

M2 ORO: Advanced Integer Programming. Part IV. Solving MILP (1) easy IP. Outline. Sophie Demassey. October 10, 2011

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

Minimum Weight Constrained Forest Problems. Problem Definition

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

Assessing Performance of Parallel MILP Solvers

Integer Programming: Algorithms - 2

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

Modelling of LP-problems (2WO09)

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

LP-Modelling. dr.ir. C.A.J. Hurkens Technische Universiteit Eindhoven. January 30, 2008

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

Improved Gomory Cuts for Primal Cutting Plane Algorithms

Unit.9 Integer Programming

Modern Benders (in a nutshell)

DIP with CHiPPS: Decomposition Methods for Integer Linear Programming. CSIRO, Melbourne, Australia, 19 December, 2011

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

Facility Location-Routing-Scheduling Problem: LRS

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

Motivation for Heuristics

Decomposition and Dynamic Cut Generation in Integer Linear Programming

Basic Concepts of Constraint Integer Programming

Gurobi Guidelines for Numerical Issues February 2017

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

SCIP Workshop 2014, Berlin, September 30, Introduction to SCIP

Implementing Scalable Parallel Search Algorithms for Data-Intensive Applications

Combinatorial Auctions: A Survey by de Vries and Vohra

Transcription:

Using COIN-OR to Solve the Uncapacitated Facility Location Problem Ted Ralphs 1 Matthew Saltzman 2 Matthew Galati 3 1 COR@L Lab Department of Industrial and Systems Engineering Lehigh University 2 Department of Mathematical Sciences Clemson University 3 Analytical Solutions SAS Institute EURO XXI, July 4, 2006

Outline The Uncapacitated Facility Location Problem 1 The Uncapacitated Facility Location Problem UFL Formulation Cutting Planes 2 3

Input Data The Uncapacitated Facility Location Problem UFL Formulation Cutting Planes The following are the input data needed to describe an instance of the uncapacitated facility location problem (UFL): Data a set of depots N = {1,..., n}, a set of clients M = {1,..., m}, the unit transportation cost c ij to service client i from depot j, the fixed cost f j for using depot j Variables x ij is the amount of the demand for client i satisfied from depot j y j is 1 if the depot is used, 0 otherwise

Mathematical Programming Formulation UFL Formulation Cutting Planes The following is a mathematical programming formulation of the UFL UFL Formulation Minimize subject to X X i M j N c ijx ij + X f jy j (1) j N X x ij = d i i M, (2) j N X x ij i M ( X d i)y j i M j N, (3) y j {0, 1} j N (4) 0 x ij d i i M, j N (5)

UFL Formulation Cutting Planes Dynamically Generated Valid Inequalities The formulation presented on the last slide can be tightened by disaggregating the constraints (3). x ij d jy j 0, i M, j N. Rather than adding the inequalities to the initial formulation, we can generate them dynamically. Given the current LP solution, x, y, we check whether x ij d jy j > ɛ, i M, j N. We can also generate inequalities valid for generic MILPs. If a violation is found, we can iteratively add the constraint to the current LP relaxation.

Tightening the Initial Formulation UFL Formulation Cutting Planes Here is the basic loop for tightening the initial formulation using the dynamically generated inequalities from the previous slide. Solving the LP relaxation 1 Form the initial LP relaxation and solve it to obtain (ˆx, ŷ). 2 Iterate 1 Try to generate a valid inequality violated by (ˆx, ŷ). If none are violated, STOP. 2 Optionally, try to generate an improved feasible solution by rounding ŷ. 3 Solve the current LP relaxation of the initial formulation to obtain (ˆx, ŷ). 4 If (ˆx, ŷ) is feasible, STOP. Otherwise, go to Step 1.

Data Members The Uncapacitated Facility Location Problem C++ Class class UFL { private: OsiSolverInterface * si; double * trans_cost; //c[i][j] -> c[xindex(i,j)] double * fixed_cost; //f[j] double * demand; //d[j] int M; //number of clients (index on i) int N; //number of depots (index in j) double total_demand; //sum{j in N} d[j] int *integer_vars; int xindex(int i, int j) {return i*n + j;} int yindex(int j) {return M*N + j;} };

Methods The Uncapacitated Facility Location Problem C++ Class class UFL { public: UFL(const char* datafile); ~UFL(); void create_initial_model(); double tighten_initial_model(ostream *os = &cout); void solve_model(ostream *os = &cout); };

Open Solver Interface The Uncapacitated Facility Location Problem Uniform API for a variety of solvers: CBC, CLP, CPLEX, DyLP, FortMP, GLPK, Mosek, OSL, Soplex, SYMPHONY, the Volume Algorithm, XPRESS-MP supported to varying degrees. Read input from MPS or CPLEX LP files or construct instances using COIN-OR data structures. Manipulate instances and output to MPS or LP file. Set solver parameters. Calls LP solver for LP or MIP LP relaxation. Manages interaction with dynamic cut and column generators. Calls MIP solver. Returns solution and status information.

Cut Generator Library The Uncapacitated Facility Location Problem A collection of cutting-plane generators and management utilities. Interacts with OSI to inspect problem instance and solution information and get violated cuts. Cuts include: Combinatorial cuts: AllDifferent, Clique, KnapsackCover, OddHole Flow cover cuts Lift-and-project cuts Mixed integer rounding cuts General strengthening: DuplicateRows, Preprocessing, Probing, SimpleRounding

COIN LP Solver The Uncapacitated Facility Location Problem High-quality, efficient LP solver. Simplex and barrier algorithms. QP with barrier algorithm. Interface through OSI or native API. Tight integration with CBC (COIN-OR Branch and Cut MIP solver).

COIN Branch and Cut The Uncapacitated Facility Location Problem State of the art implementation of branch and cut. Tight integration with CLP, but can use other LP solvers through OSI. Uses CGL to generate cutting planes. Interface through OSI or native API. Many customization options.

The initialize_solver() Method Initializing the LP solver #if defined(coin_use_clp) #include "OsiClpSolverInterface.hpp" typedef OsiClpSolverInterface OsiXxxSolverInterface; #elif defined(coin_use_cpx) #include "OsiCpxSolverInterface.hpp" typedef OsiCpxSolverInterface OsiXxxSolverInterface; #endif OsiSolverInterface* UFL::initialize_solver() { OsiXxxSolverInterface* si = new OsiXxxSolverInterface(); return si; }

The create_initial_model() Method Creating Rim Vectors CoinIotaN(integer_vars, N, M * N); CoinFillN(col_lb, n_cols, 0.0); int i, j, index; for (i = 0; i < M; i++) { for (j = 0; j < N; j++) { index = xindex(i,j); objective[index] = trans_cost[index]; col_ub[index] = demand[i]; } } CoinFillN(col_ub + (M*N), N, 1.0); CoinDisjointCopyN(fixed_cost, N, objective + (M * N));

The create_initial_model() Method Creating the Constraint Matrix 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); } for (j=0; j < N; j++) { //linking constraints: CoinPackedVector row; row.insert(yindex(j), -1.0 * total_demand); for (i=0; i < M; i++) row.insert(xindex(i,j),1.0); matrix->appendrow(row); }

Loading and Solving the LP Relaxation Loading the Problem in the Solver si->loadproblem(*matrix, col_lb, col_ub, objective, row_lb, row_ub); Solving the Initial LP Relaxation si->initialsolve();

The tighten_initial_model() Method Tightening the Relaxation Custom Cuts const double* sol = si->getcolsolution(); int newcuts = 0, i, j, xind, yind; for (i = 0; i < M; i++) { for (j = 0; j < N; j++) { xind = xindex(i,j); yind = yindex(j); } } if (sol[xind] - (demand[i] * sol[yind]) > tolerance) { // violated constraint CoinPackedVector cut; cut.insert(xind, 1.0); cut.insert(yind, -1.0 * demand[i]); si->addrow(cut, -1.0 * si->getinfinity(), 0.0); newcuts++; }

The tighten_initial_model() Method Tightening the Relaxation CGL Cuts 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);

The solve_model() Method Calling the Solver (Built-In MIP) si->setinteger(integer_vars, N); si->branchandbound(); if (si->isprovenoptimal()) { const double * solution = si->getcolsolution(); const double * objcoeff = si->getobjcoefficients(); print_solution(solution, objcoeff, os); } else cerr << "B&B failed to find optimal" << endl; return;

The solve_model() Method Calling the Solver (CLP Requires Separate MIP) CbcModel model(*si); model.branchandbound(); if (model.isprovenoptimal()) { const double * solution = model.getcolsolution(); const double * objcoeff = model.getobjcoefficients(); print_solution(solution, objcoeff, os); } else cerr << "B&B failed to find optimal" << endl; return;

Where to go for Help <project> is one of Osi, Cgl, Clp, Cbc, etc. Project home pages: https://projects.coin-or.org/<project> (Trac pages). Documentation: http://www.coin-or.org/doxygen/<project> (Doxygen), http://www.coin-or.org/clp/userguide/, http://www.coin-or.org/cbc/userguide/ Mailing lists: http://list.coin-or.org (see coin-discuss, coin-osi-devel, cgl, coin-lpsolver note lists will be reorganized soon).