Instituto Superior Técnico Masters in Civil Engineering. Lecture 2: Transport networks design and evaluation Xpress presentation - Laboratory work



Similar documents
Xpress-Mosel User guide

Mosel tips and tricks

Contents. Xpress-Mosel Language Reference Manual

Instituto Superior Técnico. Theme 1: Transport networks design and evaluation Case study presentation and synthesis

Quality Assurance For Mathematical Modeling Systems

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

New features of Mosel in Release 7.5

Chapter 13: Binary and Mixed-Integer Programming

Applications of optimization with Xpress-MP

Airport Planning and Design. Excel Solver

TOMLAB - For fast and robust largescale optimization in MATLAB

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

Scheduling Home Health Care with Separating Benders Cuts in Decision Diagrams

How to speed-up hard problem resolution using GLPK?

LocalSolver: black-box local search for combinatorial optimization

mobility Lisbon 2014 structure of CICLE CITIES LISBON 2014 MOBILITY IN LISBON AND THE PARADIGM SHIFT OF THE MUNICIPAL MASTER PLAN

Eastern Washington University Department of Computer Science. Questionnaire for Prospective Masters in Computer Science Students

Network Optimization using AIMMS in the Analytics & Visualization Era

Optimization Modeling for Mining Engineers

Why? A central concept in Computer Science. Algorithms are ubiquitous.

Discuss the size of the instance for the minimum spanning tree problem.

Eastern Washington University Department of Computer Science. Questionnaire for Prospective Masters in Computer Science Students

ADVANCED SCHOOL OF SYSTEMS AND DATA STUDIES (ASSDAS) PROGRAM: CTech in Computer Science

Optimization applications in finance, securities, banking and insurance

CPLEX Tutorial Handout

Introduction to ROOT and data analysis

ARIZONA CTE CAREER PREPARATION STANDARDS & MEASUREMENT CRITERIA SOFTWARE DEVELOPMENT,

USING EXCEL SOLVER IN OPTIMIZATION PROBLEMS

Creating a More Efficient Course Schedule at WPI Using Linear Optimization

Eastern Washington University Department of Computer Science. Questionnaire for Prospective Masters in Computer Science Students

Minimizing costs for transport buyers using integer programming and column generation. Eser Esirgen

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

Solving convex MINLP problems with AIMMS

Proximal mapping via network optimization

Approximation Algorithms

An open source software approach to combine simulation and optimization of business processes

A Reference Point Method to Triple-Objective Assignment of Supporting Services in a Healthcare Institution. Bartosz Sawik

Binary Image Reconstruction

An Optimization Approach for Cooperative Communication in Ad Hoc Networks

EXCEL SOLVER TUTORIAL

Equilibrium computation: Part 1

Decision Mathematics D1 Advanced/Advanced Subsidiary. Tuesday 5 June 2007 Afternoon Time: 1 hour 30 minutes

Mixed Integer Linear Programming in R

Locating and sizing bank-branches by opening, closing or maintaining facilities

A Tool for Generating Partition Schedules of Multiprocessor Systems

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

Support Vector Machines Explained

Modeling and Solving the Capacitated Vehicle Routing Problem on Trees

Overview of Industrial Batch Process Scheduling

Solutions to Homework 6

Programming Languages & Tools

ML for the Working Programmer

Lecture 2 Mathcad Basics

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries

SALEM COMMUNITY COLLEGE Carneys Point, New Jersey COURSE SYLLABUS COVER SHEET. Action Taken (Please Check One) New Course Initiated

An Introduction to Data Mining

Chapter 10: Network Flow Programming

SBB: A New Solver for Mixed Integer Nonlinear Programming

Development. Software Application. MFC, and STL. A Visual C++, Tutorial. Zhang Wenzu. Bud Fox. Tan May Ling. CRC Press. Taylor &.

Using ODBC and other database interfaces

Java the UML Way: Integrating Object-Oriented Design and Programming

Distributionally Robust Optimization with ROME (part 2)

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

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

Mathematical finance and linear programming (optimization)

5.1 Bipartite Matching

Introduction to Process Optimization

Data Structure [Question Bank]

A binary heap is a complete binary tree, where each node has a higher priority than its children. This is called heap-order property

A Simple Introduction to Support Vector Machines

Precalculus REVERSE CORRELATION. Content Expectations for. Precalculus. Michigan CONTENT EXPECTATIONS FOR PRECALCULUS CHAPTER/LESSON TITLES

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

Introduction to Simulink

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

Optimization of Supply Chain Networks

Numerical Analysis. Professor Donna Calhoun. Fall 2013 Math 465/565. Office : MG241A Office Hours : Wednesday 10:00-12:00 and 1:00-3:00

Strategic planning in LTL logistics increasing the capacity utilization of trucks

Traffic Engineering for Multiple Spanning Tree Protocol in Large Data Centers

Sample Questions Csci 1112 A. Bellaachia

A Branch and Bound Algorithm for Solving the Binary Bi-level Linear Programming Problem

Portfolio Construction with OPTMODEL

The Goldberg Rao Algorithm for the Maximum Flow Problem

Quiz 4 Solutions EECS 211: FUNDAMENTALS OF COMPUTER PROGRAMMING II. 1 Q u i z 4 S o l u t i o n s

Data Structures and Algorithms Written Examination

GAMS Productivity - Performance - Reliability

Binary Heaps. CSE 373 Data Structures

CHAPTER 9. Integer Programming

Tensor Methods for Machine Learning, Computer Vision, and Computer Graphics

New and Forthcoming Developments in the AMPL Modeling Language & System

The number of marks is given in brackets [ ] at the end of each question or part question. The total number of marks for this paper is 72.

Transcription:

Instituto Superior Técnico Masters in Civil Engineering REGIÕES E REDES () Lecture 2: Transport networks design and evaluation Xpress presentation - Laboratory work Eng. Luis Martínez

OUTLINE Xpress presentation Xpress structure Create input files for Xpress Xpress-IVE overview Xpress-IVE key features Mosel programming language key words Declare and initialize variables in Mosel Declare an objective function and constraints in Mosel Declare and run the optimization in Mosel Output the results (library mmive ) Xpress Laboratory work with two network design examples A minimum spanning tree problem example A Min-cost-flow problem example 2

XPRESS PRESENTATION - XPRESS STRUCTURE Xpress-MP is a suite of mathematical modeling and optimization tools used to solve linear, integer, quadratic, non-linear, and stochastic programming problems. Solver engines: Xpress-Optimizer (LP, MIP, QP, MIQP, QCQP, NLP) Xpress-SLP (NLP, MINLP) Xpress-SP is a Stochastic Programming tool for solving optimization problems involving uncertainty Xpress-Kalis is Constraint Programming software (discrete combinatorial problems) Model building and development tools: Xpress-Mosel programming language Xpress-BCL is an object-oriented library Xpress-IVE is a complete visual development environment for Xpress-Mosel under Windows Xpress-Application Developer (XAD) extends Xpress-Mosel with an API for graphical user interface development 3

XPRESS PRESENTATION - CREATE INPUT FILES FOR XPRESS The input files are created in.dat files format These files should contain the vectors and matrices with the input variables identified for reading from the Xpress engine. Arcs: [( ) "Lisboa" "Odivelas" (2 ) "Lisboa" "Loures" (3 ) "Lisboa" "Amadora" (4 ) "Lisboa" "Oeiras" (5 ) "Lisboa" "Sintra" (6 ) "Lisboa" "Cascais" (7 ) "Lisboa" "Mafra" (8 ) "Lisboa" "Vila Franca de Xira ] x: [("Lisboa")46 ("Odivelas") 08843 ("Loures") 0098 ("Amadora") 052] flow: [0 5900 26500 26500 23850 5900 0 9540 3780 5900 26500 9540 0 4840 9080 26500 3780 4840 0 42400 23850 5900 9080 42400 0] 4

XPRESS PRESENTATION - XPRESS-IVE OVERVIEW Run and debug control Variables and constraints activity and output Mosel editor Optimization results Optimization process 5

XPRESS PRESENTATION - XPRESS-IVE KEY FEATURES The code file should have the following structure: model model name uses libraries to be used ("mmxprs","mmive ) parameters define parameters of the model filename of the input data file (DATAFILE= dat) end-parameters declarations declare variables and ranges of variables of the input file end-declarations initializations from DATAFILE initialize variables from file (insert variables names) end-initializations declarations declare decision variables end-declarations end-model 6

XPRESS PRESENTATION - MOSEL PROGRAMMING LANGUAGE KEY WORDS Key words: Variables types string text integer integer number real real number mpvar decision variable array(range) of type of variable forall(range) iterator forall(range) do end-do cycle with actions if end-if conditional action sum somation := assign value; =, >=,<= equality and inequality operators 7

XPRESS PRESENTATION - DECLARE AND INITIALIZE VARIABLES IN MOSEL Variables declaration and initialization: declarations NODES: set of string x: array(nodes) of real y: array(nodes) of real A: array(arcs:set of integer,..2) of string DIST: array (ARCS) of real demand:array(nodes,nodes) of integer end-declarations initializations from DATAFILE A x y demand end-initializations Declare range Declare input variables (range size defined by the input data file) Variables read in the file 8

XPRESS PRESENTATION - DECLARE AN OBJECTIVE FUNCTION AND CONSTRAINTS Objective function declaration Cost:=sum(i in ARCS)(a*flow(i) + b*exist(i))*dist(i) Constraint variable (linctr) Constraints declaration forall(a in NODES) Total(a):= sum(i in ARCS A(i,)=a) flow(i)>= sum(b in NODES) demand(a,b) FlowT:=sum(c in ARCS) flow(c) = sum(i,j in NODES) demand(i,j) forall(c in ARCS) flow(c) is_integer forall(c in ARCS) Exist(c) is_binary Decision variables 9

XPRESS PRESENTATION - DECLARE AND RUN THE OPTIMIZATION IN MOSEL After the declaration of the objective function and all the constraints we need to define the optimization method that will apply (minimization, maximization) minimize (Cost) maximize (utility) Optimize the identified constraint variable After the definition of the optimization method (if we don t define any output results text or graphical), we need to close the model with the key word end-model Having all the complete code needed we can now run the model in the Run button. 0

XPRESS PRESENTATION - OUTPUT THE RESULTS Write output results in text: getsol(mpvar) get the solution values of the variable getobjval get final value of the objective function writeln(string) write in a string line write(string) write a string strfmt(number) write as string Draw graphs: CnctGraph:= IVEaddplot("Road", IVE_YELLOW) TermGraph:= IVEaddplot("Cities", IVE_GREEN) IVEdrawpoint(TermGraph, x(i), y(i)) IVEdrawline(CnctGraph, x(a(i)), y(a(i)), x(a(j)), y(a(j))) IVEdrawlabel(CnctGraph, (x(a(i))+x(a(j)))/2, (y(a(i))+y(a(j)))/2, string(getsol(flow(a,j))))

XPRESS LABORATORY - A MINIMUM SPANNING TREE PROBLEM EXAMPLE (I) Goal: Design a network that connects all the nodes of the graph at minimum cost Decision Variables: X: array (NODES, NODES) binary Level: array (NODES) - integer Objective function: Constraints: Number of connections: Nodes i, j= Nodes / i <> j xij i, j= α Length ij Avoid Subcycle: level level + N + N x i, j j i Direct all connections towards the root: Road length: 2333.06 = N ij N / j <> j x ij i= = Spain Network Example Connections: A Coruña-Pontevedra Lugo-A Coruña Asturias-Lugo Cantabria-León Vizcaya-Cantabria Guipúzcoa-Vizcaya León-Asturias Burgos-Vizcaya Navarra-Guipúzcoa Madrid-Salamanca Barcelona-Zaragoza Valencia-Zaragoza Sevilla- Badajoz Salamanca-León Zaragoza-Navarra Badajoz-Salamanca 2

XPRESS LABORATORY - A MIN-COST COST-FLOW MULTI-TERMINAL TERMINAL PROBLEM EXAMPLE (I) Goal: Assign demand flow the an existing network from a several sources to a several sink nodes at minimum cost considering capacity constraints on the links of the graph Decision Variables: Flow: array (ARCS,ODpairs) integer Objective function: Constraints: Total source flow: Node equilibrium: Capacity constraint: nodes, jodpairs arcs ODPairs i= Flow ai Positive flow: i Capacity arcs Arcs / D = n i= Arcs / O = i O j j, ODPairs i= Flow Arcs, ODPairs ij i=, j= = a k k=, jodpairs Flowaj 0 α Flow Length Flow Arcs / O = n MaximumRatio ij ij Flow Demand k, j i j Spain Network Example 3