Perspective of mathematical optimization and its applications Tokyo University of Marine Science and Technology Mikio Kubo.

Slides:



Advertisements
Similar presentations
Chapter 8: The Solver and Mathematical Programming Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
Advertisements

Introduction to Integer Programming Modeling and Methods Michael Trick Carnegie Mellon University CPAI-OR School, Le Croisic 2002.
Solving Linear Programming Problems Shubhagata Roy.
Standard Minimization Problems with the Dual
SCIP Optimization Suite
What is GAMS?. While they are not NLP solvers, per se, attention should be given to modeling languages like: GAMS- AIMMS-
LPs and MIPs background and solution approaches Dr. Greg Bernstein Grotto Networking
MS&E 211 Quadratic Programming Ashish Goel. A simple quadratic program Minimize (x 1 ) 2 Subject to: -x 1 + x 2 ≥ 3 -x 1 – x 2 ≥ -2.
Part II General Integer Programming II.1 The Theory of Valid Inequalities 1.
Ch 2. 6 – Solving Systems of Linear Inequalities & Ch 2
Linear Programming?!?! Sec Linear Programming In management science, it is often required to maximize or minimize a linear function called an objective.
1 One Size Fits All? : Computational Tradeoffs in Mixed Integer Programming Software Bob Bixby, Mary Fenelon, Zonghao Gu, Ed Rothberg, and Roland Wunderling.
Introduction to Management Science
Operations Management
Linear Programming Integer Linear Models. When Variables Have To Be Integers Example – one time production decisions –Fractional values make no sense.
Lecture outline Support vector machines. Support Vector Machines Find a linear hyperplane (decision boundary) that will separate the data.
5.6 Maximization and Minimization with Mixed Problem Constraints
Objectives: Set up a Linear Programming Problem Solve a Linear Programming Problem.
CS541 Advanced Networking 1 Introduction to Optimization Neil Tang 2/23/2009.
(Not in text).  An LP with additional constraints requiring that all the variables be integers is called an all-integer linear program (IP).  The LP.
Chapter 4 - Linear Programming: Computer Solution Excel Solver
Quantitative Methods of Management
6.5 – Solving Equations with Quadratic Techniques.
Module B: Linear Programming
Extensions to the OSiL schema: Matrix and cone programming Horand I. Gassmann, Dalhousie University Jun Ma, Kipp Martin, Imre Polik.
Perspective of supply chain optimization
Integer Programming Key characteristic of an Integer Program (IP) or Mixed Integer Linear Program (MILP): One or more of the decision variable must be.
Systems of Inequalities in Two Variables Sec. 7.5a.
Module :MA0001NP Foundation Mathematics Lecture Week 9.
Linear Programming. Many mathematical models designed to solve problems in business, biology, and economics involve finding the optimum value (maximum.
Supply Chain Modeling Language for Optimization -Implementation in Python- Mikio KUBO Tokyo University of Marine Science of Technology.
7.4 Solving Polynomial Equations Objectives: Solve polynomial equations. Find the real zeros of polynomial functions and state the multiplicity of each.
Chapter 1. Formulations 1. Integer Programming  Mixed Integer Optimization Problem (or (Linear) Mixed Integer Program, MIP) min c’x + d’y Ax +
Basic Economic Concepts Ways to organize an economic system –Free markets –Government-run Nature of decision making –Objectives –Constraints.
Systems of Equations and Inequalities Systems of Linear Equations: Substitution and Elimination Matrices Determinants Systems of Non-linear Equations Systems.
Linear Programming Advanced Math Topics Mrs. Mongold.
15-853Page :Algorithms in the Real World Linear and Integer Programming III – Integer Programming Applications Algorithms.
D Nagesh Kumar, IIScOptimization Methods: M7L2 1 Integer Programming Mixed Integer Linear Programming.
4-1 Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Linear Programming: Modeling Examples Chapter 4- Part2.
Managerial Economics Linear Programming Aalto University School of Science Department of Industrial Engineering and Management January 12 – 28, 2016 Dr.
Anytime Planning of Optimal Schedules for a Mobile Sensing Robot JINGJIN YU JAVED ASLAM SERTAC KARAMAN DANIELA RUS SPEAKER: SANKALP ARORA.
Part II General Integer Programming II.1 The Theory of Valid Inequalities 1.
Sullivan Algebra and Trigonometry: Section 12.9 Objectives of this Section Set Up a Linear Programming Problem Solve a Linear Programming Problem.
Linear Programming Wyndor Glass Co. 3 plants 2 new products –Product 1: glass door with aluminum framing –Product 2: 4x6 foot wood frame window.
Managerial Economics Linear Programming
Introduction to Linear Programs
Quadratic Inequalities
Systems of Equations and Inequalities
Solve Linear Systems by Graphing
integer linear programming, mixed integer linear programming
Lecture 11: Tree Search © J. Christopher Beck 2008.
Standard Form I can identify intercepts from an equation.
Solve a system of linear equation in two variables
The Simplex Method: Standard Minimization Problems
MIP Tools Branch and Cut with Callbacks Lazy Constraint Callback
Algebra: Graphs, Functions, and Linear Systems
A Mathematical Programming Language
USING GRAPHS TO SOLVE EQUATIONS
INFM 718A / LBSC 705 Information For Decision Making
integer linear programming, mixed integer linear programming
Linear Programming Example: Maximize x + y x and y are called
Integer Programming.
Linear Programming Integer Linear Models.
Linear Programming Integer Linear Models.
Drawing Graphs The parabola x Example y
LINEAR & QUADRATIC GRAPHS
Chapter 1. Formulations.
BUS-221 Quantitative Methods
Applied Statistical and Optimization Models
Presentation transcript:

Perspective of mathematical optimization and its applications Tokyo University of Marine Science and Technology Mikio Kubo

How to Solve Real Combinatorial Optimization Problems Quickly Mixed Integer Programming (MIP) Solver Constraint Programming (CP) Solver Scheduling Solver (or develop (meta)heuristics)... using Python Language

Why Python? We can do anything by importing some modules Optimization import gurobipy (MIP) import SCOP (CP) Draw graphs import networkX Also fly! import antigravity ? /

Mixed Integer Programming (MIP) Variables x : Real or Integer or Binary Constraints Linear or (convex) Quadratic Expressions minimize c’x+x’Qx (objective function) subject to Ax=b (constraints)

What’s Gurobi? MIP solver Developed by: Zonghao Gu, Edward Rothberg , Robert Bixby Current version Free academic license

Gurobi Objects Model Variable Constraint LinExprQuadExpr Column Callbacks GRBError addVar addConstr SOS addSOS

Introduction to Gurobi (1) Create a model object model = Model("Wine Blending")

Add variable objects x1 = model.addVar(name="x1") x2 = model.addVar(name="x2") x3 = model.addVar(name="x3") Model update (needed before adding constraints; lazy update!) model.update() Introduction to Gurobi (2)

Introduction to Gurobi (3) Set the objective model.setObjective(15*x1 + 18*x2 + 30*x3, GRB.MAXIMIZE) Add constraints model.addConstr(2*x1 + x2 + x3 <= 60) model.addConstr(x1 + 2*x2 + x3 <= 60) model.addConstr(x3 <= 30) Optimize model.optimize()

Modeling with Lists Add variable objects into list x=[ ] for i in range(1,4): var=model.addVar(name=“x[ %s]”%i ) x.append(var) Add constraint “x1 + x2 + x3 <= 2” model.addConstr( sum(x) <= 2 ) or model.addConstr( quicksum(x) <= 2 ) X[1]X[2]X[3] ・・・

Modeling with Dictionaries Dictionary that maps keys (“Dry”, “Medium”, “Sweet”) to variable objects x={ } x[“Dry”]= model.addVar(name=“Dry”) x[“Medium”]= model.addVar(name=“Medium”) x[“Sweet”]= model.addVar(name=“Sweet”) Key “Hello”, “Dry Wine” Value “Nihao” Variable Object Mapping

Modeling with Dictionaries Add constraint “2 x1 + x2 + x3 <= 30” model.addConstr( 2* x[“Dry”]+ x[“Medium”] +x[“Sweet”] <=30 ) multidict Blends, Profit = multidict({"Dry":15, "Medium":18, "Sweet":30}) => Blends=["Dry", "Medium“, "Sweet“] Profit[“Dry”]=15, Profit[“Medium”]=18,...

Wine Blending with Dictionaries (1) multidict Blends, Profit = multidict({"Dry":15, "Medium":18, "Sweet":30}) => Blends=["Dry", "Medium“, "Sweet“] List of Keys Profit[“Dry”]=15, Profit[“Medium”]=18,... Grapes, Inventory = multidict({"Alfrocheiro":60, "Baga":60, "Castelao":30}) Use = { ("Alfrocheiro","Dry"):2, ("Alfrocheiro","Medium"):1, ("Alfrocheiro","Sweet"):1, ("Baga","Dry"):1,.... }

Wine Blending with Dictionaries (2) x = {} for j in Blends: x[j] = model.addVar(vtype="C", name="x[%s]"%j) model.update() model.setObjective(quicksum(Profit[j]*x[j] for j in Blends), GRB.MAXIMIZE) for i in Grapes: model.addConstr(quicksum(Use[i,j]*x[j] for j in Blends) <= Inventory[i], name="use[%s]"%i) model.optimize()

k-median problem A facility location problem with min-sum objective function Number of customers n=200 Number of facilities selected from customer sites k=20

Formulation week formulation

Python Code ( 1 ) from gurobipy import * model = Model("k-median") x, y = {}, {} # empty dictionaries Key “Hanako”, (1,2) Value “127cm” Variable Object Mapping Dictionary Data Structure

I=range(n) J=range(n) for j in J: y[j] = model.addVar(vtype="B", name="y[%s]"%j) for i in I: x[i,j] =model.addVar( vtype="B",name="x[%s,%s]"%(i,j)) model.update() Python Code (2) model.setObjective(quicksum(c[i,j]*x[i,j] for i in I for j in J)) Add variable objects “B” means binary variable or GRB.BINARY Set the objective

Python Code (3) for i in I: model.addConstr(quicksum(x[i,j] for j in J) = = 1, "Assign[%s]"%i) for j in J: model.addConstr(x[i,j] <= y[j], "Strong[%s,%s]"%(i,j)) model.addConstr(quicksum(y[j] for j in J) = = k, "k_median")

Python Code (4) … model.optimize() print “Opt.value=”,model.ObjVal edge=[] for (i,j) in x: if x[i,j].X= =1: edge.append((i,j)) return edge

Python Code (5) import networkx as NX #networkX module import matplotlib.pyplot as P #prepare drawing P.ion() G = NX.Graph() #graph object G.add_nodes_from(range(n)) #add nodes for (i,j) in edge: #add edges G.add_edge(i,j) NX.draw(G)

Optimize a model with 401 Rows, Columns and NonZeros … Explored 1445 nodes (63581 simplex iterations) in seconds Thread count was 2 (of 2 available processors) Optimal solution found (tolerance 1.00e-04) Best objective e+01, best bound e+01, gap % Opt.value= Weak formulation (result) n=200,k=20

Upper and lower bounds (Weak Formulation)

Optimize a model with Rows, Columns and NonZeros … Explored 0 nodes (1697 simplex iterations) in 3.33 seconds (No branching !) Thread count was 2 (of 2 available processors) Optimal solution found (tolerance 1.00e-04) Best objective e+01, best bound e+01, gap 0.0% Opt.value= Strong formulation (result)

k-center problem A facility location problem with min-max object n=100 customers , k=10 facilities k-center (n=30,k=3) k-median (n=30,k=3)

Formulation

Upper and lower bounds (n=100,k=10)

k-Covering Problem =1 if customer is not covered # of uncovered customers parameter that is =1 if distance is less than or equal to θ

k-Covering+Binary Search Upper and Lower Bounds UB , LB while UB – LB >ε: θ= (UB+LB)/2 if opt. val. of k-covering is 0 then UB = θ else LB = θ

Computational Experiments

Constraint Programming (CP) Variables x has to be selected from a finite domain (set of values) Constraints Linear, (non-convex) Quadratic, All Different or Any Types of Combinatorial Expressions

Assignment Problem (MIP/CP) Assign three jobs A,B,C to three workers 1,2,3 MIP formulation: x ij Binary CP formulation : x[i] with domain {A,B,C} AllDiff ( x[1], x[2], x[3] )

Constraint Programming Solver SCOP (Solver for COnstraint or Programming) developed by Prof. Ibaraki and Prof. Nonobe ITC (International Timetabling Competition) 2007 – Finalist for all 3 tracks (3 rd, 2 nd, 3 rd among 5 finalists) International Nurse Rostering Competition (INRC) 2010 – Finalists for all 3 tracks (2 nd,3 rd, 4 th among 5 finalists)

SCOP Objects Model Variable Linear addVariable(s) Quadratic Alldiff addConstraint

Scheduling Activities (=Variables) x has to be selected from a set of modes (=domain of CP) Resource Renewable or Non-renewable Resources (=Constraints) Temporal Constraints

Scheduling Solver OptSeq II developed by Prof. Ibaraki and Prof. Nonobe Algorithms CPU sec. # of Feasible Solutions Error from Best Known Tabu search / % Priority-rule method / % Our tabu search / % 1. [De Reyck and Herroelen, 1999] 333MHz PC 2. [Heilmann, 2001] 333MHz PC 3. 1GHz PC Multi-mode RCPSP PSPLIB [Kolisch and Sprecher, 1997]

OptSeq Objects Model Attribute Mode addActivity Resource Temporal addResource addTemporal addMode

Applications Train scheduling in a steel plant: Flow optimization using Gurobi + Detailed scheduling using OptSeq Supply Chain Modeling Language (SCML)

What’s SCML? SCML Supply Chain Optimization Models Combinatorial Optimization Models Solvers (metaheuristics, MIP/CP solvers) SCML.py

Supply Chain Optimization Models resource constrained scheduling lot-sizing logistics network design safety stock allocation economic order quantity inventory policy optimization vehicle routing

謝謝 Thank You ご清聴ありがとうございました