# Optimization with Gurobi and Python

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 INESC Porto and Universidade do Porto, Portugal Workshop at Universidade dos Açores September 2011

2 Gurobi a one-page explanation Optimization system by Z. Gu, E. Rothberg, and R. Bixby Very high performance, cutting-edge solvers: linear programming quadratic programming mixed-integer programming Advanced presolve methods MILP and MIQP models: cutting planes powerful solution heuristics Free academic license

3 Why Python? Everything can be done after loading a module! Optimization allowed: import gurobipy Use algorithms on graphs: import networkx import matplotlib Allows levitation: import antigravity (?)

4 Python a one-page explanation Simple types: bools, integers, floats, strings (immutable) Complex types: lists: sequences of elements (of any type; mutable) indexed by an integer, from 0 to size-1 A=[1,5,3,7], A.append(5), a=a.pop(), a=a[3], A[4]="abc", A.remove(6), A.sort() tuples: as lists, but immutable may be used as indices T=(1,5,3,7), t=t[3] dictionaries: mappings composed of pairs key, value (mutable) indexed by an integer, from 0 to size-1 D = {}, D[872]=6, D["pi"]= , D[(1,7)]=3 Iteration: lists: for i in A: print i dictionaries: for i in D: print i, D[i] cycles: i = 0 while i < 10: print i i += 1

5 Putting things together import the gurobipy module create a model object add variables add constraints [debug?] solve report solution

6 Hello world example minimize 3000x y subject to: 5x + 6y 10 7x + 5y 5 x, y 0 from gurobipy import * model = Model("hello") x = model.addvar(obj=3000, vtype="c", name="x") y = model.addvar(obj=4000, vtype="c", name="y") model.update() L1 = LinExpr([5,6],[x,y]) model.addconstr(l1,">",10) L2 = LinExpr([7,5],[x,y]) model.addconstr(l2,">",5) model.modelsense = 1 model.optimize() # minimize if model.status == GRB.OPTIMAL: print "Opt. Value=",model.ObjVal print "x* =", x.x print "y* =", y.x

7 The k-median problem facility location problem of min-sum type n customers m positions for facilities (at some customer s coordinates) k maximum open facilities minimize service time summed for all the customers (Euclidean distance, random uniform (x, y) coordinates)

8 The k-median problem formulation n customers, m facilities variables: x ij = 1 if customer i is served by facility j y j = 1 if facility j is open 1 all customers must be served 2 maximum of k open facilities 3 customer i can be served by j only if j is open 4 minimize total, accumulated service time minimize subject to i j c ijx ij j x ij = 1 i j y j = k x ij y j i, j x ij {0, 1} i y j {0, 1} j

9 The k-median problem Python/Gurobi model def kmedian(m, n, c, k): model = Model("k-median") y,x = {}, {} for j in range(m): y[j] = model.addvar(obj=0, vtype="b", name="y[%s]"%j) x[i,j] = model.addvar(obj=c[i,j], vtype="b", name="x[%s,%s]"%(i,j)) model.update() coef = [1 for j in range(m)] var = [x[i,j] for j in range(m)] model.addconstr(linexpr(coef,var), "=", 1, name="assign[%s]"%i) for j in range(m): model.addconstr(x[i,j], "<", y[j], name="strong[%s,%s]"%(i,j)) coef = [1 for j in range(m)] var = [y[j] for j in range(m)] model.addconstr(linexpr(coef,var), "=", rhs=k, name="k_median") model.update() model. data = x,y return model

10 The k-median problem preparing data import math import random def distance(x1, y1, x2, y2): return math.sqrt((x2-x1)**2 + (y2-y1)**2) def make_data(n): x = [random.random() for i in range(n)] y = [random.random() for i in range(n)] c = {} for j in range(n): c[i,j] = distance(x[i],y[i],x[j],y[j]) return c, x, y

11 The k-median problem calling and solving n = 200 c, x_pos, y_pos = make_data(n) m = n k = 20 model = kmedian(m, n, c, k) model.optimize() x,y = model. data edges = [(i,j) for (i,j) in x if x[i,j].x == 1] nodes = [j for j in y if y[j].x == 1] print "Optimal value=", model.objval print "Selected nodes:", nodes print "Edges:", edges

12 The k-median problem plotting import networkx as NX import matplotlib.pyplot as P P.ion() # interactive mode on G = NX.Graph() other = [j for j in y if j not in nodes] G.add_nodes_from(nodes) G.add_nodes_from(other) for (i,j) in edges: G.add_edge(i,j) position = {} position[i]=(x_pos[i],y_pos[i]) NX.draw(G, position, node_color= y, nodelist=nodes) NX.draw(G, position, node_color= g, nodelist=other)

13 The k-median problem solver output Optimize a model with rows, columns and nonzeros Presolve time: 1.67s Presolved: rows, columns, nonzeros Variable types: 0 continuous, integer (40200 binary) Found heuristic solution: objective Root relaxation: objective e+01, 2771 iterations, 0.55 seconds Nodes Current Node Objective Bounds Work Expl Unexpl Obj Depth IntInf Incumbent BestBd Gap It/Node Time % - 2s H % - 2s Cutting planes: Gomory: 1 Zero half: 1 Explored 0 nodes (2771 simplex iterations) in 2.67 seconds Thread count was 1 (of 8 available processors) Optimal solution found (tolerance 1.00e-04) Best objective e+01, best bound e+01, gap % Optimal value= Selected nodes: [7, 22, 31, 33, 37, 40, 53, 73, 85, 86, 88, 96, 97, 106, 108, 110, 116, 142, 151, 197] Edges: [(57, 106), (85, 85), (67, 151), (174, 142), (139, 31), (136, 40), (35, 37), (105, 197), (195, 108), max c:

14 The k-median problem: solution

15 The k-center problem facility location problem of min-max type n customers m positions for facilities (at some customer s coordinates) k maximum open facilities minimize service time for the latest-served customer (Euclidean distance, random uniform (x, y) coordinates)

16 The k-center problem formulation (min-max type) x ij = 1 if customer i is served by facility j y j = 1 if a facility j is open 1 all customers must be served 2 maximum of k open facilities 3 customer i can be served by j only if j is open 4 update service time for the latest-served customer minimize subject to z j x ij = 1 i j y j = k x ij y j i, j c ij x ij z i, j x ij {0, 1} i, j y j {0, 1} j

17 The k-center problem Python/Gurobi model def kcenter(m, n, c, k): model = Model("k-center") z = model.addvar(obj=1, vtype="c", name="z") y, x = {}, {} for j in range(m): y[j] = model.addvar(obj=0, vtype="b", name="y[%s]"%j) x[i,j] = model.addvar(obj=0, vtype="b", name="x[%s,%s]"%(i,j)) model.update() coef = [1 for j in range(m)] var = [x[i,j] for j in range(m)] model.addconstr(linexpr(coef,var), "=", 1, name="assign[%s]"%i) for j in range(m): model.addconstr(x[i,j], "<", y[j], name="strong[%s,%s]"%(i,j)) for j in range(n): model.addconstr(linexpr(c[i,j],x[i,j]), "<", z, name="max_x[%s,%s]"%(i,j)) coef = [1 for j in range(m)] var = [y[j] for j in range(m)] model.addconstr(linexpr(coef,var), "=", rhs=k, name="k_center") model.update() model. data = x,y return model

18 The k-center problem solver output Optimize a model with rows, columns and nonzeros Presolve removed 100 rows and 0 columns Presolve time: 0.35s Presolved: rows, columns, nonzeros Variable types: 1 continuous, integer (10100 binary) Found heuristic solution: objective Found heuristic solution: objective Found heuristic solution: objective Root relaxation: objective e-03, iterations, 1.88 seconds Nodes Current Node Objective Bounds Work Expl Unexpl Obj Depth IntInf Incumbent BestBd Gap It/Node Time % - 3s [...] H % s Cutting planes: Gomory: 1 Zero half: 2 Explored 7 nodes (83542 simplex iterations) in seconds Thread count was 1 (of 8 available processors) Optimal solution found (tolerance 1.00e-04) Best objective e-01, best bound e-01, gap 0.0% Optimal value= Selected nodes: [12, 14, 23, 33, 41, 51, 53, 72, 80, 92] Edges: [(53, 53), (36, 80), (54, 33), (69, 12), (39, 14), (86, 51), (99, 53), (37, 41), (49, 14), (26, 72), (2 max c:

19 CPU usage k-median instance: n = m = 200, k = 20, CPU = 5s k-center instance: n = m = 100, k = 10, CPU = 454s k-center: for an instance that is half size the one solved for k-median, used almost ten times more CPU can we do better?

20 The k-center problem formulation (min type) a ij = 1 if customer i can be served by facility j y j = 1 if a facility j is open ξ i = 1 if customer i cannot be served parameter: distance θ for which a client can be served if c ij < θ then set a ij = 1 else, set a ij = 1 1 either customer i is served or ξ = 1 2 maximum of k open facilities minimize subject to i ξ i j a ijy j + ξ i 1 i j y j = k ξ i {0, 1} i y j {0, 1} j

21 The k-center problem model for binary search def kcenter(m, n, c, k, max_c): model = Model("k-center") z, y, x = {}, {}, {} z[i] = model.addvar(obj=1, vtype="b", name="z[%s]"%i) for j in range(m): y[j] = model.addvar(obj=0, vtype="b", name="y[%s]"%j) x[i,j] = model.addvar(obj=0, vtype="b", name="x[%s,%s]"%(i,j)) model.update() coef = [1 for j in range(m)] var = [x[i,j] for j in range(m)] var.append(z[i]) model.addconstr(linexpr(coef,var), "=", 1, name="assign[%s]"%i) for j in range(m): model.addconstr(x[i,j], "<", y[j], name="strong[%s,%s]"%(i,j)) coef = [1 for j in range(m)] var = [y[j] for j in range(m)] model.addconstr(linexpr(coef,var), "=", rhs=k, name="k_center") model.update() model. data = x,y,z return model

22 The k-center problem binary search def solve_kcenter(m, n, c, k, max_c, delta): model = kcenter(m, n, c, k, max_c) x,y,z = model. data LB = 0 UB = max_c while UB-LB > delta: theta = (UB+LB) / 2. for j in range(m): if c[i,j]>theta: x[i,j].ub = 0 else: x[i,j].ub = 1.0 model.update() model.optimize() infeasibility = sum([z[i].x for i in range(m)]) if infeasibility > 0: LB = theta else: UB = theta nodes = [j for j in y if y[j].x == 1] edges = [(i,j) for (i,j) in x if x[i,j].x == 1] return nodes, edges

23 The k-center problem: CPU usage k-center k-center (bin search) k-median k-median and k-center 60 CPU time Number of nodes

24 The k-center problem: solution

25 The k-median (left) and k-center (right) solutions

### GUROBI OPTIMIZER QUICK START GUIDE. Version 6.0, Copyright c 2014, Gurobi Optimization, Inc.

GUROBI OPTIMIZER QUICK START GUIDE Version 6.0, Copyright c 2014, Gurobi Optimization, Inc. Contents 1 Introduction 4 2 Obtaining a Gurobi License 6 2.1 Creating a new academic license.............................

### 6. Mixed Integer Linear Programming

6. Mixed Integer Linear Programming Javier Larrosa Albert Oliveras Enric Rodríguez-Carbonell Problem Solving and Constraint Programming (RPAR) Session 6 p.1/40 Mixed Integer Linear Programming A mixed

### ! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.

Approximation Algorithms Chapter Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of

### ! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

Approximation Algorithms 11 Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of three

Approximation Algorithms Chapter Approximation Algorithms Q. Suppose I need to solve an NP-hard problem. What should I do? A. Theory says you're unlikely to find a poly-time algorithm. Must sacrifice one

### The Gurobi Optimizer

The Gurobi Optimizer Gurobi History Gurobi Optimization, founded July 2008 Zonghao Gu, Ed Rothberg, Bob Bixby Started code development March 2008 Gurobi Version 1.0 released May 2009 History of rapid,

### 5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1 General Integer Linear Program: (ILP) min c T x Ax b x 0 integer Assumption: A, b integer The integrality condition

### Branch-and-Price Approach to the Vehicle Routing Problem with Time Windows

TECHNISCHE UNIVERSITEIT EINDHOVEN Branch-and-Price Approach to the Vehicle Routing Problem with Time Windows Lloyd A. Fasting May 2014 Supervisors: dr. M. Firat dr.ir. M.A.A. Boon J. van Twist MSc. Contents

### Tutorial on Using Excel Solver to Analyze Spin-Lattice Relaxation Time Data

Tutorial on Using Excel Solver to Analyze Spin-Lattice Relaxation Time Data In the measurement of the Spin-Lattice Relaxation time T 1, a 180 o pulse is followed after a delay time of t with a 90 o pulse,

### Using diversification, communication and parallelism to solve mixed-integer linear programs

Using diversification, communication and parallelism to solve mixed-integer linear programs R. Carvajal a,, S. Ahmed a, G. Nemhauser a, K. Furman b, V. Goel c, Y. Shao c a Industrial and Systems Engineering,

### CMPSCI 119 Python Review Sheet Professor William T. Verts. line break (can contain " or '). N = [1, 2.3, "Hello"]

Variables, Data Types, Computations, and Assignment variable = expression Variable is assigned the value on right, data type of variable becomes data type of value (variables may change type). N = 5 Variable

### The multi-integer set cover and the facility terminal cover problem

The multi-integer set cover and the facility teral cover problem Dorit S. Hochbaum Asaf Levin December 5, 2007 Abstract The facility teral cover problem is a generalization of the vertex cover problem.

### CPLEX Tutorial Handout

CPLEX Tutorial Handout What Is ILOG CPLEX? ILOG CPLEX is a tool for solving linear optimization problems, commonly referred to as Linear Programming (LP) problems, of the form: Maximize (or Minimize) c

### Minimum Makespan Scheduling

Minimum Makespan Scheduling Minimum makespan scheduling: Definition and variants Factor 2 algorithm for identical machines PTAS for identical machines Factor 2 algorithm for unrelated machines Martin Zachariasen,

### Solving Mixed Integer Linear Programs Using Branch and Cut Algorithm

1 Solving Mixed Integer Linear Programs Using Branch and Cut Algorithm by Shon Albert A Project Submitted to the Graduate Faculty of North Carolina State University in Partial Fulfillment of the Requirements

### Solving convex MINLP problems with AIMMS

Solving convex MINLP problems with AIMMS By Marcel Hunting Paragon Decision Technology BV An AIMMS White Paper August, 2012 Abstract This document describes the Quesada and Grossman algorithm that is implemented

### Resource Allocation and Scheduling

Lesson 3: Resource Allocation and Scheduling DEIS, University of Bologna Outline Main Objective: joint resource allocation and scheduling problems In particular, an overview of: Part 1: Introduction and

### Computational advances in solving Mixed Integer Linear Programming problems

Carnegie Mellon University Research Showcase @ CMU Department of Chemical Engineering Carnegie Institute of Technology 2011 Computational advances in solving Mixed Integer Linear Programming problems Ricardo

### Using the Simplex Method in Mixed Integer Linear Programming

Integer Using the Simplex Method in Mixed Integer UTFSM Nancy, 17 december 2015 Using the Simplex Method in Mixed Integer Outline Mathematical Programming Integer 1 Mathematical Programming Optimisation

### Linear Programming. March 14, 2014

Linear Programming March 1, 01 Parts of this introduction to linear programming were adapted from Chapter 9 of Introduction to Algorithms, Second Edition, by Cormen, Leiserson, Rivest and Stein [1]. 1

### Intro to scientific programming (with Python) Pietro Berkes, Brandeis University

Intro to scientific programming (with Python) Pietro Berkes, Brandeis University Next 4 lessons: Outline Scientific programming: best practices Classical learning (Hoepfield network) Probabilistic learning

### A short OPL tutorial

A short OPL tutorial Truls Flatberg January 17, 2009 1 Introduction This note is a short tutorial to the modeling language OPL. The tutorial is by no means complete with regard to all features of OPL.

### Discrete Optimization

Discrete Optimization [Chen, Batson, Dang: Applied integer Programming] Chapter 3 and 4.1-4.3 by Johan Högdahl and Victoria Svedberg Seminar 2, 2015-03-31 Todays presentation Chapter 3 Transforms using

### A numerically adaptive implementation of the simplex method

A numerically adaptive implementation of the simplex method József Smidla, Péter Tar, István Maros Department of Computer Science and Systems Technology University of Pannonia 17th of December 2014. 1

### Lecture 11: 0-1 Quadratic Program and Lower Bounds

Lecture : - Quadratic Program and Lower Bounds (3 units) Outline Problem formulations Reformulation: Linearization & continuous relaxation Branch & Bound Method framework Simple bounds, LP bound and semidefinite

### Lecture 3: Linear Programming Relaxations and Rounding

Lecture 3: Linear Programming Relaxations and Rounding 1 Approximation Algorithms and Linear Relaxations For the time being, suppose we have a minimization problem. Many times, the problem at hand can

### Equilibrium computation: Part 1

Equilibrium computation: Part 1 Nicola Gatti 1 Troels Bjerre Sorensen 2 1 Politecnico di Milano, Italy 2 Duke University, USA Nicola Gatti and Troels Bjerre Sørensen ( Politecnico di Milano, Italy, Equilibrium

### A Constraint Programming based Column Generation Approach to Nurse Rostering Problems

Abstract A Constraint Programming based Column Generation Approach to Nurse Rostering Problems Fang He and Rong Qu The Automated Scheduling, Optimisation and Planning (ASAP) Group School of Computer Science,

### Graphical method. plane. (for max) and down (for min) until it touches the set of feasible solutions. Graphical method

The graphical method of solving linear programming problems can be applied to models with two decision variables. This method consists of two steps (see also the first lecture): 1 Draw the set of feasible

### Noncommercial Software for Mixed-Integer Linear Programming

Noncommercial Software for Mixed-Integer Linear Programming J. T. Linderoth T. K. Ralphs December, 2004. Revised: January, 2005. Abstract We present an overview of noncommercial software tools for the

### Integer programming solution methods - introduction

Integer programming solution methods - introduction J E Beasley Capital budgeting There are four possible projects, which each run for 3 years and have the following characteristics. Capital requirements

### Optimization Modeling for Mining Engineers

Optimization Modeling for Mining Engineers Alexandra M. Newman Division of Economics and Business Slide 1 Colorado School of Mines Seminar Outline Linear Programming Integer Linear Programming Slide 2

### Chapter 13: Binary and Mixed-Integer Programming

Chapter 3: Binary and Mixed-Integer Programming The general branch and bound approach described in the previous chapter can be customized for special situations. This chapter addresses two special situations:

### Identification of Hybrid Systems

Identification of Hybrid Systems Alberto Bemporad Dip. di Ingegneria dell Informazione Università degli Studi di Siena bemporad@dii.unisi.it http://www.dii.unisi.it/~bemporad Goal Sometimes a hybrid model

### Discrete (and Continuous) Optimization Solutions of Exercises 1 WI4 131

Discrete (and Continuous) Optimization Solutions of Exercises 1 WI4 131 Kees Roos Technische Universiteit Delft Faculteit Informatietechnologie en Systemen Afdeling Informatie, Systemen en Algoritmiek

### A new Branch-and-Price Algorithm for the Traveling Tournament Problem (TTP) Column Generation 2008, Aussois, France

A new Branch-and-Price Algorithm for the Traveling Tournament Problem (TTP) Column Generation 2008, Aussois, France Stefan Irnich 1 sirnich@or.rwth-aachen.de RWTH Aachen University Deutsche Post Endowed

### 1 What s done well in CVXPY. Figure 1: Expression tree.

Figure 1: Expression tree. Here are my thoughts on what s done well in CVXPY, what s missing, and what I d like to see in a core CVX library. 1 What s done well in CVXPY The best design decision I made

### Outline. Linear Programming (LP): Simplex Search. Simplex: An Extreme-Point Search Algorithm. Basic Solutions

Outline Linear Programming (LP): Simplex Search Benoît Chachuat McMaster University Department of Chemical Engineering ChE 4G03: Optimization in Chemical Engineering 1 Basic Solutions

### Cloud Branching. Timo Berthold. joint work with Domenico Salvagnin (Università degli Studi di Padova)

Cloud Branching Timo Berthold Zuse Institute Berlin joint work with Domenico Salvagnin (Università degli Studi di Padova) DFG Research Center MATHEON Mathematics for key technologies 21/May/13, CPAIOR

### CPLEX LP format. maximize 2x 1 +3x 2 x 3 x 1 + x 2 1 x 1 + x 2 + x 3 0. Text file example.lp : maximize 2x1 + 3x2 - x3

CPLEX LP format maximize 2x 1 +3x 2 x 3 x 1 + x 2 1 x 1 + x 2 + x 3 0 x 2 2x 3 2 Text file example.lp : maximize 2x1 + 3x2 - x3 subject to x1 + x2

### Machine Learning Big Data using Map Reduce

Machine Learning Big Data using Map Reduce By Michael Bowles, PhD Where Does Big Data Come From? -Web data (web logs, click histories) -e-commerce applications (purchase histories) -Retail purchase histories

### Minimum Caterpillar Trees and Ring-Stars: a branch-and-cut algorithm

Minimum Caterpillar Trees and Ring-Stars: a branch-and-cut algorithm Luidi G. Simonetti Yuri A. M. Frota Cid C. de Souza Institute of Computing University of Campinas Brazil Aussois, January 2010 Cid de

### A stochastic programming approach for supply chain network design under uncertainty

A stochastic programming approach for supply chain network design under uncertainty Tjendera Santoso, Shabbir Ahmed, Marc Goetschalckx, Alexander Shapiro School of Industrial & Systems Engineering, Georgia

### A New Method for Estimating Maximum Power Transfer and Voltage Stability Margins to Mitigate the Risk of Voltage Collapse

A New Method for Estimating Maximum Power Transfer and Voltage Stability Margins to Mitigate the Risk of Voltage Collapse Bernie Lesieutre Dan Molzahn University of Wisconsin-Madison PSERC Webinar, October

### CME 193: Introduction to Scientific Python Lecture 1: Introduction

CME 193: Introduction to Scientific Python Lecture 1: Introduction Sven Schmit stanford.edu/~schmit/cme193 1: Introduction 1-1 Contents Administrivia Introduction Basics Variables Control statements Exercises

### Using EXCEL Solver October, 2000

Using EXCEL Solver October, 2000 2 The Solver option in EXCEL may be used to solve linear and nonlinear optimization problems. Integer restrictions may be placed on the decision variables. Solver may be

### IEOR 4404 Homework #2 Intro OR: Deterministic Models February 14, 2011 Prof. Jay Sethuraman Page 1 of 5. Homework #2

IEOR 4404 Homework # Intro OR: Deterministic Models February 14, 011 Prof. Jay Sethuraman Page 1 of 5 Homework #.1 (a) What is the optimal solution of this problem? Let us consider that x 1, x and x 3

### SBB: A New Solver for Mixed Integer Nonlinear Programming

SBB: A New Solver for Mixed Integer Nonlinear Programming Michael R. Bussieck GAMS Development Corp. Arne S. Drud ARKI Consulting & Development A/S OR2001, Duisburg Overview! SBB = Simple Branch & Bound!

### Unit 3: Day 2: Factoring Polynomial Expressions

Unit 3: Day : Factoring Polynomial Expressions Minds On: 0 Action: 45 Consolidate:10 Total =75 min Learning Goals: Extend knowledge of factoring to factor cubic and quartic expressions that can be factored

### On the effect of forwarding table size on SDN network utilization

IBM Haifa Research Lab On the effect of forwarding table size on SDN network utilization Rami Cohen IBM Haifa Research Lab Liane Lewin Eytan Yahoo Research, Haifa Seffi Naor CS Technion, Israel Danny Raz

### Approximation Algorithms

Approximation Algorithms or: How I Learned to Stop Worrying and Deal with NP-Completeness Ong Jit Sheng, Jonathan (A0073924B) March, 2012 Overview Key Results (I) General techniques: Greedy algorithms

### 11. APPROXIMATION ALGORITHMS

11. APPROXIMATION ALGORITHMS load balancing center selection pricing method: vertex cover LP rounding: vertex cover generalized load balancing knapsack problem Lecture slides by Kevin Wayne Copyright 2005

### CRASH COURSE PYTHON. Het begint met een idee

CRASH COURSE PYTHON nr. Het begint met een idee This talk Not a programming course For data analysts, who want to learn Python For optimizers, who are fed up with Matlab 2 Python Scripting language expensive

### Programming Using Python

Introduction to Computation and Programming Using Python Revised and Expanded Edition John V. Guttag The MIT Press Cambridge, Massachusetts London, England CONTENTS PREFACE xiii ACKNOWLEDGMENTS xv 1 GETTING

### CSCE 110 Programming I Basics of Python: Variables, Expressions, and Input/Output

CSCE 110 Programming Basics of Python: Variables, Expressions, and nput/output Dr. Tiffani L. Williams Department of Computer Science and Engineering Texas A&M University Fall 2011 Python Python was developed

### A Linear Programming Based Method for Job Shop Scheduling

A Linear Programming Based Method for Job Shop Scheduling Kerem Bülbül Sabancı University, Manufacturing Systems and Industrial Engineering, Orhanlı-Tuzla, 34956 Istanbul, Turkey bulbul@sabanciuniv.edu

### [1] Learned how to set up our computer for scripting with python et al. [3] Solved a simple data logistics problem using natural language/pseudocode.

Last time we... [1] Learned how to set up our computer for scripting with python et al. [2] Thought about breaking down a scripting problem into its constituent steps. [3] Solved a simple data logistics

### max cx s.t. Ax c where the matrix A, cost vector c and right hand side b are given and x is a vector of variables. For this example we have x

Linear Programming Linear programming refers to problems stated as maximization or minimization of a linear function subject to constraints that are linear equalities and inequalities. Although the study

### Lecture 3. Linear Programming. 3B1B Optimization Michaelmas 2015 A. Zisserman. Extreme solutions. Simplex method. Interior point method

Lecture 3 3B1B Optimization Michaelmas 2015 A. Zisserman Linear Programming Extreme solutions Simplex method Interior point method Integer programming and relaxation The Optimization Tree Linear Programming

### ON SOLVING THE PROGRESSIVE PARTY PROBLEM AS A MIP

ON SOLVING THE PROGRESSIVE PARTY PROBLEM AS A MIP ERWIN KALVELAGEN Abstract. The Progressive Party Problem [9] has long been considered a problem intractable for branch-and-bound mixed integer solvers.

### Computer Sciences Department

Computer Sciences Department Algorithms and Software for Convex Mixed Integer Nonlinear Programs Pierre Bonami Mustafa Kilinc Jeff Linderoth Technical Report #1664 October 2009 ALGORITHMS AND SOFTWARE

### Reminder: Complexity (1) Parallel Complexity Theory. Reminder: Complexity (2) Complexity-new

Reminder: Complexity (1) Parallel Complexity Theory Lecture 6 Number of steps or memory units required to compute some result In terms of input size Using a single processor O(1) says that regardless of

### Reminder: Complexity (1) Parallel Complexity Theory. Reminder: Complexity (2) Complexity-new GAP (2) Graph Accessibility Problem (GAP) (1)

Reminder: Complexity (1) Parallel Complexity Theory Lecture 6 Number of steps or memory units required to compute some result In terms of input size Using a single processor O(1) says that regardless of

### FlowMergeCluster Documentation

FlowMergeCluster Documentation Description: Author: Clustering of flow cytometry data using the FlowMerge algorithm. Josef Spidlen, jspidlen@bccrc.ca Please see the gp-flowcyt-help Google Group (https://groups.google.com/a/broadinstitute.org/forum/#!forum/gpflowcyt-help)

### Solving NP Hard problems in practice lessons from Computer Vision and Computational Biology

Solving NP Hard problems in practice lessons from Computer Vision and Computational Biology Yair Weiss School of Computer Science and Engineering The Hebrew University of Jerusalem www.cs.huji.ac.il/ yweiss

### Chap 4 The Simplex Method

The Essence of the Simplex Method Recall the Wyndor problem Max Z = 3x 1 + 5x 2 S.T. x 1 4 2x 2 12 3x 1 + 2x 2 18 x 1, x 2 0 Chap 4 The Simplex Method 8 corner point solutions. 5 out of them are CPF solutions.

### Recovery of primal solutions from dual subgradient methods for mixed binary linear programming; a branch-and-bound approach

MASTER S THESIS Recovery of primal solutions from dual subgradient methods for mixed binary linear programming; a branch-and-bound approach PAULINE ALDENVIK MIRJAM SCHIERSCHER Department of Mathematical

### Engineering Problem Solving and Excel. EGN 1006 Introduction to Engineering

Engineering Problem Solving and Excel EGN 1006 Introduction to Engineering Mathematical Solution Procedures Commonly Used in Engineering Analysis Data Analysis Techniques (Statistics) Curve Fitting techniques

### Some Optimization Fundamentals

ISyE 3133B Engineering Optimization Some Optimization Fundamentals Shabbir Ahmed E-mail: sahmed@isye.gatech.edu Homepage: www.isye.gatech.edu/~sahmed Basic Building Blocks min or max s.t. objective as

### Optimal Scheduling for Dependent Details Processing Using MS Excel Solver

BULGARIAN ACADEMY OF SCIENCES CYBERNETICS AND INFORMATION TECHNOLOGIES Volume 8, No 2 Sofia 2008 Optimal Scheduling for Dependent Details Processing Using MS Excel Solver Daniela Borissova Institute of

### 3 Does the Simplex Algorithm Work?

Does the Simplex Algorithm Work? In this section we carefully examine the simplex algorithm introduced in the previous chapter. Our goal is to either prove that it works, or to determine those circumstances

### Graphs, Networks and Python: The Power of Interconnection. Lachlan Blackhall - lachlan@repositpower.com

Graphs, Networks and Python: The Power of Interconnection Lachlan Blackhall - lachlan@repositpower.com A little about me Graphs Graph, G = (V, E) V = Vertices / Nodes E = Edges NetworkX Native graph

### William E. Hart Carl Laird Jean-Paul Watson David L. Woodruff. Pyomo Optimization. Modeling in Python. ^ Springer

William E Hart Carl Laird Jean-Paul Watson David L Woodruff Pyomo Optimization Modeling in Python ^ Springer Contents 1 Introduction 1 11 Mathematical Modeling 1 12 Modeling Languages for Optimization

### Modeling and Solving the Capacitated Vehicle Routing Problem on Trees

in The Vehicle Routing Problem: Latest Advances and New Challenges Modeling and Solving the Capacitated Vehicle Routing Problem on Trees Bala Chandran 1 and S. Raghavan 2 1 Department of Industrial Engineering

### Math 2602 Finite and Linear Math Fall 14. Homework 9: Core solutions

Math 2602 Finite and Linear Math Fall 14 Homework 9: Core solutions Section 8.2 on page 264 problems 13b, 27a-27b. Section 8.3 on page 275 problems 1b, 8, 10a-10b, 14. Section 8.4 on page 279 problems

### OPTIMIZED STAFF SCHEDULING AT SWISSPORT

Gurobi User Conference, Frankfurt, 01.02.2016 OPTIMIZED STAFF SCHEDULING AT SWISSPORT Prof. Dr. Andreas Klinkert Dr. Peter Fusek Dipl. Ing. Roman Berner Rita Thalmann Simona Segessenmann Zurich University

### Vector and Matrix Norms

Chapter 1 Vector and Matrix Norms 11 Vector Spaces Let F be a field (such as the real numbers, R, or complex numbers, C) with elements called scalars A Vector Space, V, over the field F is a non-empty

### Optimal Cheque Production: A Case Study

Blo UNIVERSITÀ DI SALERNO Dipartimento di Matematica e Informatica D.M.I. Via Ponte don Melillo 84084 Fisciano (SA) Italy Optimal Cheque Production: A Case Study Raffaele Cerulli, Renato De Leone, Monica

### Column Generation in GAMS Extending the GAMS Branch-and-Cut-and-Heuristic (BCH) Facility

Column Generation in GAMS Extending the GAMS Branch-and-Cut-and-Heuristic (BCH) Facility Michael R. Bussieck MBussieck@gams.com GAMS Software GmbH GAMS Development Corp 83rd Working Group Meeting Real

### Applied Algorithm Design Lecture 5

Applied Algorithm Design Lecture 5 Pietro Michiardi Eurecom Pietro Michiardi (Eurecom) Applied Algorithm Design Lecture 5 1 / 86 Approximation Algorithms Pietro Michiardi (Eurecom) Applied Algorithm Design

### INTEGER PROGRAMMING. Integer Programming. Prototype example. BIP model. BIP models

Integer Programming INTEGER PROGRAMMING In many problems the decision variables must have integer values. Example: assign people, machines, and vehicles to activities in integer quantities. If this is

### Linear Programming for Optimization. Mark A. Schulze, Ph.D. Perceptive Scientific Instruments, Inc.

1. Introduction Linear Programming for Optimization Mark A. Schulze, Ph.D. Perceptive Scientific Instruments, Inc. 1.1 Definition Linear programming is the name of a branch of applied mathematics that

### High-performance local search for planning maintenance of EDF nuclear park

High-performance local search for planning maintenance of EDF nuclear park Frédéric Gardi Karim Nouioua Bouygues e-lab, Paris fgardi@bouygues.com Laboratoire d'informatique Fondamentale - CNRS UMR 6166,

### Lecture 7: Approximation via Randomized Rounding

Lecture 7: Approximation via Randomized Rounding Often LPs return a fractional solution where the solution x, which is supposed to be in {0, } n, is in [0, ] n instead. There is a generic way of obtaining

### AN INTRODUCTION TO ERROR CORRECTING CODES Part 1

AN INTRODUCTION TO ERROR CORRECTING CODES Part 1 Jack Keil Wolf ECE 154C Spring 2008 Noisy Communications Noise in a communications channel can cause errors in the transmission of binary digits. Transmit:

### The PageRank Citation Ranking: Bring Order to the Web

The PageRank Citation Ranking: Bring Order to the Web presented by: Xiaoxi Pang 25.Nov 2010 1 / 20 Outline Introduction A ranking for every page on the Web Implementation Convergence Properties Personalized

### Lecture 4 Linear Programming Models: Standard Form. August 31, 2009

Linear Programming Models: Standard Form August 31, 2009 Outline: Lecture 4 Standard form LP Transforming the LP problem to standard form Basic solutions of standard LP problem Operations Research Methods

### Integrating Benders decomposition within Constraint Programming

Integrating Benders decomposition within Constraint Programming Hadrien Cambazard, Narendra Jussien email: {hcambaza,jussien}@emn.fr École des Mines de Nantes, LINA CNRS FRE 2729 4 rue Alfred Kastler BP

### A Weighted-Sum Mixed Integer Program for Bi-Objective Dynamic Portfolio Optimization

AUTOMATYKA 2009 Tom 3 Zeszyt 2 Bartosz Sawik* A Weighted-Sum Mixed Integer Program for Bi-Objective Dynamic Portfolio Optimization. Introduction The optimal security selection is a classical portfolio

### Big Data Optimization at SAS

Big Data Optimization at SAS Imre Pólik et al. SAS Institute Cary, NC, USA Edinburgh, 2013 Outline 1 Optimization at SAS 2 Big Data Optimization at SAS The SAS HPA architecture Support vector machines

### 4.6 Linear Programming duality

4.6 Linear Programming duality To any minimization (maximization) LP we can associate a closely related maximization (minimization) LP. Different spaces and objective functions but in general same optimal

### Definitions 1. A factor of integer is an integer that will divide the given integer evenly (with no remainder).

Math 50, Chapter 8 (Page 1 of 20) 8.1 Common Factors Definitions 1. A factor of integer is an integer that will divide the given integer evenly (with no remainder). Find all the factors of a. 44 b. 32

### Introduction: Models, Model Building and Mathematical Optimization The Importance of Modeling Langauges for Solving Real World Problems

Introduction: Models, Model Building and Mathematical Optimization The Importance of Modeling Langauges for Solving Real World Problems Josef Kallrath Structure of the Lecture: the Modeling Process survey

### Modelling for Constraint Programming

Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules CP Summer School 28 Implied Constraints Implied constraints are logical consequences of the set

### Mth 95 Module 2 Spring 2014

Mth 95 Module Spring 014 Section 5.3 Polynomials and Polynomial Functions Vocabulary of Polynomials A term is a number, a variable, or a product of numbers and variables raised to powers. Terms in an expression

### Efficiency of algorithms. Algorithms. Efficiency of algorithms. Binary search and linear search. Best, worst and average case.

Algorithms Efficiency of algorithms Computational resources: time and space Best, worst and average case performance How to compare algorithms: machine-independent measure of efficiency Growth rate Complexity

### Convex Programming Tools for Disjunctive Programs

Convex Programming Tools for Disjunctive Programs João Soares, Departamento de Matemática, Universidade de Coimbra, Portugal Abstract A Disjunctive Program (DP) is a mathematical program whose feasible