Programming Exercise / ILOG CPLEX Tutorial. Your Task (1) Your Task (2)

Size: px
Start display at page:

Download "Programming Exercise / ILOG CPLEX Tutorial. Your Task (1) Your Task (2)"

Transcription

1 Programming Exercise / ILOG CPLEX Tutorial Andreas M. Chwatal Algorithms and Data Structures Group Institute of Computer Graphics and Algorithms Vienna University of Technology VU Fortgeschrittene Algorithmen und Datenstrukturen April 2010 Recall the k-node minimum spanning tree (k-mst) problem from the todays lecture: Given: (undirected) graph G = (V, E, w) nonnegative weighting function w(e) R Goal: Find a minimum weight tree, spanning exactly k nodes. Programming Exercise: develop a branch-and-bound and a branch-and-cut algorithm for this problem 1 2 Your Task (1) Your Task (2) Carefully read this tutorial Formulate the k-mst problem as integer linear program (ILP), based on a 1 single commodity flow formulation (SCF) 2 cycle elimination formulation (CE), or, alternatively a formulation based on directed connection cuts (DC) Implement the corresponding algorithms, using ILOG CPLEX: 1 a branch-and-bound algorithm for the SCF formulation 2 a branch-and-cut algorithm based on CE/DC using a dynamic cut-separation procedure For the implementation you should use a C++ framework (which you can find on the webpage of the course) Furthermore you can find test-instances (to described later on), which should be used for the evaluation and analysis of the algorithms Compute the results for each instance for (at least) k = 1 5 V and k = 1 2 V with both algorithms 3 4

2 Your Task (3) Create a short document (preferably in LaTeX) of no more than three pages containing: 1 Problem description, used variables 2 SCF and CE/DC formulation 3 Short description of implementation, in particular the cut-generation 4 Result table, including 1 objective function value 2 running time 3 number of branch-and-bound nodes 4 node in which optimum has been found 5 For B&C: number of separated cuts 5 Organization You can work on the exercise alone, or in groups of two You get accounts for compute/development server behemoth.ads.tuwien.ac.at after the lecture, or request by to me. You can use this server for development, testing, computing results; Accounts will be deleted at end of 2010! Contact us (me and the Sysadmin) if you need an extension. Working on other computers: Copy corresponding directories (see Makefile) and the license file to your computer; delete after course is finished. Send the document and source code per to me/us two days prior to the (oral) exam. Make sure, that a correctly working version of your program is available on an institute-server at the time of your exam. 6 What is CPLEX? CPLEX: Simplex method and C programming language Commercial optimization software package High performance integer (linear) programming linear programming quadratic programming Concert Framework Interface to CPLEX solver (C, C++, C#, Java) Enables to implement: branch-and-bound, branch-and-cut, column generation,... What does Concert do for you? Variables restricted to e.g. Z or {0, 1} branching is automatically performed on these variables branch-and-bound Preprocessing/Presolving Cut-Generation: Gomory-Fractional-Cuts, Mixed-Integer-Cuts Lot s of problem-specific cuts, e.g. Cover-Cuts, Clique-Cuts,... What can you do for Concert? User-defined cuts generate new variables (pricing)... by callback objects 7 8

3 Prerequisites This tutorial should contain all information to solve the programming exercise, but if you want to know more, have a look at our manual pages: (password required) Also have a look at: Enable the licence: Environmental variable needs to be set. Type the following lines at the command line promt: $ ILOG LICENSE FILE=/home1/share/ILOG/ilm/access.ilm $ export ILOG LICENSE FILE 9 First steps 1 Include the headerfile: #include <ilcplex/ilocplex.h> 2 Before the class definition (of the class that will build the model and start the solver) use the following macro: ILOSTLBEGIN 3 Declare/create the following objects: IloCplex cplex; // the solver object IloEnv env; // the environment object IloModel model; // the model; all constraints etc. go in here 10 Basic Program Structure try { env = IloEnv(); // creating the environment model = IloModel(env); // creating the model (w/env) // build some variables and constraints // and add them to the model model.add(...); // add the objective function model.add(ilominimize(...)); cplex = IloCplex(model); // create cplex object w/model cplex.solve(); // solve the model } catch (IloException& e) {... } catch (...) {... } 11 Data-Types Constants: IloNum, IloBool, IloInt Variables: IloNumVar, IloBoolVar, IloIntVar Example: IloBoolVar x(env, my-first-bool-var ); Arrays/Vectors: IloIntVarArray, IloNumVarArray, IloBoolVarArray Example: // create array of 5 boolean variables IloBoolVarArray y(env, 5); for (u_int i=0; i<5; i++) { stringstream myname; myname << y_ << i; y[i] = IloBoolVar(env, myname.str()); } 12

4 Constraints Constraints, equalities, inequalities are added by the IloExpr class: Example: y1 + y2 4 IloExpr myexpr(env); myexpr += y[1]; myexpr += y[2]; model.add(myexpr <= 4); myexpr.end(); // IMPORTANT It is important to call the IloExpr::end() function to free the memory Objective Function / Solver The objective function is handled similar to constraints: model.add(ilominimize(env, expr)); Now we are ready to start the solver: IloCplex cplex(model); cplex.solve(); Did we succeed...? IloAlgorithm::Status algstatus = cplex.getstatus(); if (algstatus!= IloAlgorithm::Optimal) { // something went wrong... } else { // model solved to optimality env.out() << obj. value: " << cplex.getobjvalue() << endl; } What is going on now? Cut Generation 1 Let s assume, we have defined some integer variables 2 CPLEX solves the LP-relaxation of our model 3 CPLEX then tries to separate internal cutting-planes 4 If this process is finished we still may end up with an solution containing fractional variables 5 Now it s time for branching; One particular variable is selected and two subproblems are created by rounding it up and down respectively 6 One subproblem is selected Step 2 In each node of the branch-and-bound tree we may want to add further cutting-planes in order to 1 strengthen the LP-relaxation 2 add violated inequalities, not initially included to the model (e.g. if we did not add an exponentially large set of cycle-elimination inequalities) This can be achieved by the use of special callback-classes Example: CutCallbackI for case (1) LazyConstraintCallbackI for case (2) 15 16

5 Cut Generation (2) When CPLEX calls such a callback object, we first need to inspect the current values of our variables: IloNum a = getvalue(x[i]); Based on this values we can now build/update some data-structures, apply some algorithms and detect some cutting-planes (e.g. the cycle-elimination-cuts) As we already know from the lecture, we can easily separate cycle elimination cuts by performing shortest path computations. If we have found a valid cut, build the corresponding expression cut we can add it to the model... 1 globally: add(cut); 2 locally: addlocal(cut); Remark: Environment can be accessed by function getenv() within the callback-object 17 Numeric Issues In particular for the cut separation we need to take care about numeric issues. Assume we specified the constraint x1 + x2 + x3 = 3 A solution might only satisfy (x1 ± ɛ) + (x2 ± ɛ) + (x3 ± ɛ) = 3 for some small ɛ, or equivalently 3 3 ɛ x1 + x2 + x ɛ Attention: according to this issue we might iteratively add inequalities that are already met (except of the numeric error), or might not find valid cuts and thus end up with an infeasible solution (if not taking care of it)!!! The value of ɛ can be obtained by cplex.getparam(ilocplex::epint) and set by cplex.setparam(...). 18 Interpreting the output Nodes Cuts/ Node Left Objective IInf Best Int. Best Node ItCnt Gap Variable B NodeID Parent Depth User: x_[96] D x_[51] U * integral % x_[82] D % x_[82] U % x_[83] U * integral % x_[86] U % x_[96] U % x_[66] U Comments: Second line, still in root node of B&B tree; after the separation of 26 internal cuts the LP relaxation is better (higher); branching starts in line 3: node 1 (with parent 0) is the problem where (boolean) variable x [96] has been set to 0 (D = down); first integral solution in line 5 at node 22 of B&B tree, indicated with * in the first column; the best integer solution value is , whereas the LP-relaxation is ; the gap is 7.11%; we are finished when the gap is 0% (proven optimality); the last line with * is the node where the optimum has been found; 19 Debugging hints Compiling with -O2 (or even -O3) enables optimization. This should be used for the runs for creating the results (otherwise particularily the cut-generation will be too slow). For developing use -p -g which includes profiling and debugging information. Debugger: start with gdb --args./yourprogram type run to start the program type bt or backtrace to see the execution stack This will show you e.g. the line number in which the error or segmentation fault occurs. The tool valgrind can be used for the detection of memory leaks 20

6 Test instances To make life easier, the test instances already include the artificial root node 0 Hence, we are actually interested in finding a k-mst of nodes {1,..., V }!! Be careful, to handle this accordingy w.r.t. the number of connected nodes k! You can download six test instances ranging from 10 to 100 nodes from the course webpage. Compute the results for each instance for (at least) k = 1 5 V and k = 1 2 V with both algorithms Instances format First line: number of nodes Second line: number of edges Subsequent lines: edge list (source node, target node; edge weight) Example: , 4; 23; 2, 3; 93; 1, 5; 56; k-mst Framework Main: starting the program, parameter handling Instance: singleton class, responsible for reading the data instances, converting the data in basic data structures, and providing them to other classes Global: singleton class, containing global variables, parameters etc. Tools: provides various useful functions that do not fit to one particular class EdgeIO: reading the edges from the input file, writing to stdout (by providing appropriate operators << and >>) kmst BC: this class should contain the ILP-based algorithms, i.e. a branch-and-bound algorithm for the flow formulation and a branch-and-cut algorithm for the packing formulation 23 class Instance The class Instance provides rudimentary graph data structures (which should be enough to solve the exercise) Data structures: u int nnodes, nedges typedef std::pair<u int, u int> E defines an edge vector<e> edges list of edges vector<int> edgeweights corresponding edge weights vector<set<u int> > adjedges for each node the set of adj. edges Functions: set<u int> getadjnodes(u int node) for building directed variables we might want to get a direction set<u int> getoutedges(u int node) set<u int> getinedges(u int node) 24

7 Shortest Path algorithm DheaMaxFlow The class kmst BC CutCallback provides a very simple (Dijkstra-based) shortest path algorithm. It does not even use a priority queue, and thus has runtime O( V 3 ). Nevertheless, this is enough for the exercise. Usage: The arguments are the indices of the source and target node you want to compute the shortest path for Return type: struct sp result s, containing the edge list list<u int> path and the path length double length The class DheaMaxFlow provides an efficient max-flow algorithm, which can be used to compute the minimum cut. test.cpp shows how to use the algorithm src/makefile compiles test.cpp (for testing purposes) Graph/Algorithm libraries (optional) Further Remarks It is recommended to use the provided (graph) methods, as they provide all necessary functionality If you want more: code yourself ;-) use graph/algorithm libraries like LEDA or boost, which are also available on the servers be nice ;-) when working on the server (behemoth) start your programs with nice with lower priority $ nice./yourprogram... The compute server has four cores, but must fit the needs of all participants. start only one process at the same time for your final test runs make sure you get a slot for your own (no more than three other processes) 27 28

8 Questions? Good luck for the programming exercise! Have fun coding! If you have any questions, don t hesitate to ask me (us)! 29

CPLEX Tutorial Handout

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

More information

IBM ILOG CPLEX Optimization Studio Getting Started with CPLEX. Version12Release4

IBM ILOG CPLEX Optimization Studio Getting Started with CPLEX. Version12Release4 IBM ILOG CPLEX Optimization Studio Getting Started with CPLEX Version12Release4 Copyright notice Describes general use restrictions and trademarks related to this document and the software described in

More information

5.1 Bipartite Matching

5.1 Bipartite Matching CS787: Advanced Algorithms Lecture 5: Applications of Network Flow In the last lecture, we looked at the problem of finding the maximum flow in a graph, and how it can be efficiently solved using the Ford-Fulkerson

More information

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

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

More information

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

Discuss the size of the instance for the minimum spanning tree problem. 3.1 Algorithm complexity The algorithms A, B are given. The former has complexity O(n 2 ), the latter O(2 n ), where n is the size of the instance. Let n A 0 be the size of the largest instance that can

More information

How to speed-up hard problem resolution using GLPK?

How to speed-up hard problem resolution using GLPK? How to speed-up hard problem resolution using GLPK? Onfroy B. & Cohen N. September 27, 2010 Contents 1 Introduction 2 1.1 What is GLPK?.......................................... 2 1.2 GLPK, the best one?.......................................

More information

Chapter 13: Binary and Mixed-Integer Programming

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:

More information

Introduction to Programming System Design. CSCI 455x (4 Units)

Introduction to Programming System Design. CSCI 455x (4 Units) Introduction to Programming System Design CSCI 455x (4 Units) Description This course covers programming in Java and C++. Topics include review of basic programming concepts such as control structures,

More information

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

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

More information

Approximation Algorithms

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

More information

In this paper we present a branch-and-cut algorithm for

In this paper we present a branch-and-cut algorithm for SOLVING A TRUCK DISPATCHING SCHEDULING PROBLEM USING BRANCH-AND-CUT ROBERT E. BIXBY Rice University, Houston, Texas EVA K. LEE Georgia Institute of Technology, Atlanta, Georgia (Received September 1994;

More information

Lab 2: Swat ATM (Machine (Machine))

Lab 2: Swat ATM (Machine (Machine)) Lab 2: Swat ATM (Machine (Machine)) Due: February 19th at 11:59pm Overview The goal of this lab is to continue your familiarization with the C++ programming with Classes, as well as preview some data structures.

More information

GDB Tutorial. A Walkthrough with Examples. CMSC 212 - Spring 2009. Last modified March 22, 2009. GDB Tutorial

GDB Tutorial. A Walkthrough with Examples. CMSC 212 - Spring 2009. Last modified March 22, 2009. GDB Tutorial A Walkthrough with Examples CMSC 212 - Spring 2009 Last modified March 22, 2009 What is gdb? GNU Debugger A debugger for several languages, including C and C++ It allows you to inspect what the program

More information

C Programming Review & Productivity Tools

C Programming Review & Productivity Tools Review & Productivity Tools Giovanni Agosta Piattaforme Software per la Rete Modulo 2 Outline Preliminaries 1 Preliminaries 2 Function Pointers Variadic Functions 3 Build Automation Code Versioning 4 Preliminaries

More information

Scheduling Home Health Care with Separating Benders Cuts in Decision Diagrams

Scheduling Home Health Care with Separating Benders Cuts in Decision Diagrams Scheduling Home Health Care with Separating Benders Cuts in Decision Diagrams André Ciré University of Toronto John Hooker Carnegie Mellon University INFORMS 2014 Home Health Care Home health care delivery

More information

A Column-Generation and Branch-and-Cut Approach to the Bandwidth-Packing Problem

A Column-Generation and Branch-and-Cut Approach to the Bandwidth-Packing Problem [J. Res. Natl. Inst. Stand. Technol. 111, 161-185 (2006)] A Column-Generation and Branch-and-Cut Approach to the Bandwidth-Packing Problem Volume 111 Number 2 March-April 2006 Christine Villa and Karla

More information

Linear Programming. Widget Factory Example. Linear Programming: Standard Form. Widget Factory Example: Continued.

Linear Programming. Widget Factory Example. Linear Programming: Standard Form. Widget Factory Example: Continued. Linear Programming Widget Factory Example Learning Goals. Introduce Linear Programming Problems. Widget Example, Graphical Solution. Basic Theory:, Vertices, Existence of Solutions. Equivalent formulations.

More information

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

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

More information

University of Dayton Department of Computer Science Undergraduate Programs Assessment Plan DRAFT September 14, 2011

University of Dayton Department of Computer Science Undergraduate Programs Assessment Plan DRAFT September 14, 2011 University of Dayton Department of Computer Science Undergraduate Programs Assessment Plan DRAFT September 14, 2011 Department Mission The Department of Computer Science in the College of Arts and Sciences

More information

Modeling and Solving the Capacitated Vehicle Routing Problem on Trees

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

More information

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

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

More information

Data Structures and Algorithms Written Examination

Data Structures and Algorithms Written Examination Data Structures and Algorithms Written Examination 22 February 2013 FIRST NAME STUDENT NUMBER LAST NAME SIGNATURE Instructions for students: Write First Name, Last Name, Student Number and Signature where

More information

Parallel and Distributed Computing Programming Assignment 1

Parallel and Distributed Computing Programming Assignment 1 Parallel and Distributed Computing Programming Assignment 1 Due Monday, February 7 For programming assignment 1, you should write two C programs. One should provide an estimate of the performance of ping-pong

More information

A Branch-Cut-and-Price Approach to the Bus Evacuation Problem with Integrated Collection Point and Shelter Decisions

A Branch-Cut-and-Price Approach to the Bus Evacuation Problem with Integrated Collection Point and Shelter Decisions A Branch-Cut-and-Price Approach to the Bus Evacuation Problem with Integrated Collection Point and Shelter Decisions Marc Goerigk, Bob Grün, and Philipp Heßler Fachbereich Mathematik, Technische Universität

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 27 Approximation Algorithms Load Balancing Weighted Vertex Cover Reminder: Fill out SRTEs online Don t forget to click submit Sofya Raskhodnikova 12/6/2011 S. Raskhodnikova;

More information

A Constraint Programming based Column Generation Approach to Nurse Rostering Problems

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,

More information

CHAPTER 9. Integer Programming

CHAPTER 9. Integer Programming CHAPTER 9 Integer Programming An integer linear program (ILP) is, by definition, a linear program with the additional constraint that all variables take integer values: (9.1) max c T x s t Ax b and x integral

More information

Operations Research. Inside Class Credit Hours: 51 Prerequisite:Linear Algebra Number of students : 55 Semester: 2 Credit: 3

Operations Research. Inside Class Credit Hours: 51 Prerequisite:Linear Algebra Number of students : 55 Semester: 2 Credit: 3 Operations Research Title of the Course:Operations Research Course Teacher:Xiaojin Zheng No. of Course: GOS10011 Language:English Students: postgraduate Inside Class Credit Hours: 51 Prerequisite:Linear

More information

Branch and Cut for TSP

Branch and Cut for TSP Branch and Cut for TSP jla,jc@imm.dtu.dk Informatics and Mathematical Modelling Technical University of Denmark 1 Branch-and-Cut for TSP Branch-and-Cut is a general technique applicable e.g. to solve symmetric

More information

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

KITES TECHNOLOGY COURSE MODULE (C, C++, DS) KITES TECHNOLOGY 360 Degree Solution www.kitestechnology.com/academy.php info@kitestechnology.com technologykites@gmail.com Contact: - 8961334776 9433759247 9830639522.NET JAVA WEB DESIGN PHP SQL, PL/SQL

More information

EXCEL SOLVER TUTORIAL

EXCEL SOLVER TUTORIAL ENGR62/MS&E111 Autumn 2003 2004 Prof. Ben Van Roy October 1, 2003 EXCEL SOLVER TUTORIAL This tutorial will introduce you to some essential features of Excel and its plug-in, Solver, that we will be using

More information

Introduction to Data Structures

Introduction to Data Structures Introduction to Data Structures Albert Gural October 28, 2011 1 Introduction When trying to convert from an algorithm to the actual code, one important aspect to consider is how to store and manipulate

More information

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) 3 4 4 7 5 9 6 16 7 8 8 4 9 8 10 4 Total 92.

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) 3 4 4 7 5 9 6 16 7 8 8 4 9 8 10 4 Total 92. Name: Email ID: CSE 326, Data Structures Section: Sample Final Exam Instructions: The exam is closed book, closed notes. Unless otherwise stated, N denotes the number of elements in the data structure

More information

Adaptive Linear Programming Decoding

Adaptive Linear Programming Decoding Adaptive Linear Programming Decoding Mohammad H. Taghavi and Paul H. Siegel ECE Department, University of California, San Diego Email: (mtaghavi, psiegel)@ucsd.edu ISIT 2006, Seattle, USA, July 9 14, 2006

More information

Maximum Utility Product Pricing Models and Algorithms Based on Reservation Prices

Maximum Utility Product Pricing Models and Algorithms Based on Reservation Prices Maximum Utility Product Pricing Models and Algorithms Based on Reservation Prices R. Shioda L. Tunçel T. G. J. Myklebust April 15, 2007 Abstract We consider a revenue management model for pricing a product

More information

Multiple Spanning Tree Protocol (MSTP), Multi Spreading And Network Optimization Model

Multiple Spanning Tree Protocol (MSTP), Multi Spreading And Network Optimization Model Load Balancing of Telecommunication Networks based on Multiple Spanning Trees Dorabella Santos Amaro de Sousa Filipe Alvelos Instituto de Telecomunicações 3810-193 Aveiro, Portugal dorabella@av.it.pt Instituto

More information

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 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

More information

Linear Programming. Solving LP Models Using MS Excel, 18

Linear Programming. Solving LP Models Using MS Excel, 18 SUPPLEMENT TO CHAPTER SIX Linear Programming SUPPLEMENT OUTLINE Introduction, 2 Linear Programming Models, 2 Model Formulation, 4 Graphical Linear Programming, 5 Outline of Graphical Procedure, 5 Plotting

More information

Ordered Lists and Binary Trees

Ordered Lists and Binary Trees Data Structures and Algorithms Ordered Lists and Binary Trees Chris Brooks Department of Computer Science University of San Francisco Department of Computer Science University of San Francisco p.1/62 6-0:

More information

CMPSCI611: Approximating MAX-CUT Lecture 20

CMPSCI611: Approximating MAX-CUT Lecture 20 CMPSCI611: Approximating MAX-CUT Lecture 20 For the next two lectures we ll be seeing examples of approximation algorithms for interesting NP-hard problems. Today we consider MAX-CUT, which we proved to

More information

Simplified Benders cuts for Facility Location

Simplified Benders cuts for Facility Location Simplified Benders cuts for Facility Location Matteo Fischetti, University of Padova based on joint work with Ivana Ljubic (ESSEC, Paris) and Markus Sinnl (ISOR, Vienna) Barcelona, November 2015 1 Apology

More information

1.00 Lecture 1. Course information Course staff (TA, instructor names on syllabus/faq): 2 instructors, 4 TAs, 2 Lab TAs, graders

1.00 Lecture 1. Course information Course staff (TA, instructor names on syllabus/faq): 2 instructors, 4 TAs, 2 Lab TAs, graders 1.00 Lecture 1 Course Overview Introduction to Java Reading for next time: Big Java: 1.1-1.7 Course information Course staff (TA, instructor names on syllabus/faq): 2 instructors, 4 TAs, 2 Lab TAs, graders

More information

Pseudo code Tutorial and Exercises Teacher s Version

Pseudo code Tutorial and Exercises Teacher s Version Pseudo code Tutorial and Exercises Teacher s Version Pseudo-code is an informal way to express the design of a computer program or an algorithm in 1.45. The aim is to get the idea quickly and also easy

More information

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

! 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

More information

LECTURE 5: DUALITY AND SENSITIVITY ANALYSIS. 1. Dual linear program 2. Duality theory 3. Sensitivity analysis 4. Dual simplex method

LECTURE 5: DUALITY AND SENSITIVITY ANALYSIS. 1. Dual linear program 2. Duality theory 3. Sensitivity analysis 4. Dual simplex method LECTURE 5: DUALITY AND SENSITIVITY ANALYSIS 1. Dual linear program 2. Duality theory 3. Sensitivity analysis 4. Dual simplex method Introduction to dual linear program Given a constraint matrix A, right

More information

IBM ILOG CPLEX for Microsoft Excel User's Manual

IBM ILOG CPLEX for Microsoft Excel User's Manual IBM ILOG CPLEX V12.1 IBM ILOG CPLEX for Microsoft Excel User's Manual Copyright International Business Machines Corporation 1987, 2009 US Government Users Restricted Rights - Use, duplication or disclosure

More information

[PRAKTISCHE ASPEKTE DER INFORMATIK WS 13/14]

[PRAKTISCHE ASPEKTE DER INFORMATIK WS 13/14] 2013/14 Institut für Computergraphik, TU Braunschweig Pablo Bauszat [PRAKTISCHE ASPEKTE DER INFORMATIK WS 13/14] All elemental steps that will get you started for your new life as a computer science programmer.

More information

Using Web-based Tools to Enhance Student Learning and Practice in Data Structures Course

Using Web-based Tools to Enhance Student Learning and Practice in Data Structures Course Using Web-based Tools to Enhance Student Learning and Practice in Data Structures Course 1. Introduction Chao Chen January 2014 The purpose of this project is to enhance student learning and practice in

More information

Strategic planning in LTL logistics increasing the capacity utilization of trucks

Strategic planning in LTL logistics increasing the capacity utilization of trucks Strategic planning in LTL logistics increasing the capacity utilization of trucks J. Fabian Meier 1,2 Institute of Transport Logistics TU Dortmund, Germany Uwe Clausen 3 Fraunhofer Institute for Material

More information

Liner Shipping Revenue Management with Respositioning of Empty Containers

Liner Shipping Revenue Management with Respositioning of Empty Containers Liner Shipping Revenue Management with Respositioning of Empty Containers Berit Løfstedt David Pisinger Simon Spoorendonk Technical Report no. 08-15 ISSN: 0107-8283 Dept. of Computer Science University

More information

Linear Programming. March 14, 2014

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

More information

Proximal mapping via network optimization

Proximal mapping via network optimization L. Vandenberghe EE236C (Spring 23-4) Proximal mapping via network optimization minimum cut and maximum flow problems parametric minimum cut problem application to proximal mapping Introduction this lecture:

More information

Scheduling Algorithm with Optimization of Employee Satisfaction

Scheduling Algorithm with Optimization of Employee Satisfaction Washington University in St. Louis Scheduling Algorithm with Optimization of Employee Satisfaction by Philip I. Thomas Senior Design Project http : //students.cec.wustl.edu/ pit1/ Advised By Associate

More information

Sample Questions Csci 1112 A. Bellaachia

Sample Questions Csci 1112 A. Bellaachia Sample Questions Csci 1112 A. Bellaachia Important Series : o S( N) 1 2 N N i N(1 N) / 2 i 1 o Sum of squares: N 2 N( N 1)(2N 1) N i for large N i 1 6 o Sum of exponents: N k 1 k N i for large N and k

More information

Project 2: Bejeweled

Project 2: Bejeweled Project 2: Bejeweled Project Objective: Post: Tuesday March 26, 2013. Due: 11:59PM, Monday April 15, 2013 1. master the process of completing a programming project in UNIX. 2. get familiar with command

More information

Decision Mathematics 1 TUESDAY 22 JANUARY 2008

Decision Mathematics 1 TUESDAY 22 JANUARY 2008 ADVANCED SUBSIDIARY GCE 4736/01 MATHEMATICS Decision Mathematics 1 TUESDAY 22 JANUARY 2008 Additional materials: Answer Booklet (8 pages) Graph paper Insert for Questions 3 and 4 List of Formulae (MF1)

More information

1.204 Lecture 10. Greedy algorithms: Job scheduling. Greedy method

1.204 Lecture 10. Greedy algorithms: Job scheduling. Greedy method 1.204 Lecture 10 Greedy algorithms: Knapsack (capital budgeting) Job scheduling Greedy method Local improvement method Does not look at problem globally Takes best immediate step to find a solution Useful

More information

On the effect of forwarding table size on SDN network utilization

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

More information

New Exact Solution Approaches for the Split Delivery Vehicle Routing Problem

New Exact Solution Approaches for the Split Delivery Vehicle Routing Problem New Exact Solution Approaches for the Split Delivery Vehicle Routing Problem Gizem Ozbaygin, Oya Karasan and Hande Yaman Department of Industrial Engineering, Bilkent University, Ankara, Turkey ozbaygin,

More information

Time Limit: X Flags: -std=gnu99 -w -O2 -fomitframe-pointer. Time Limit: X. Flags: -std=c++0x -w -O2 -fomit-frame-pointer - lm

Time Limit: X Flags: -std=gnu99 -w -O2 -fomitframe-pointer. Time Limit: X. Flags: -std=c++0x -w -O2 -fomit-frame-pointer - lm Judge Environment Language Compilers Language Version Flags/Notes Max Memory Limit C gcc 4.8.1 Flags: -std=gnu99 -w -O2 -fomit-frame-pointer - lm C++ g++ 4.8.1 Flags: -std=c++0x -w -O2 -fomit-frame-pointer

More information

Building Embedded Systems

Building Embedded Systems All Rights Reserved. The contents of this document cannot be reproduced without prior permission of the authors. Building Embedded Systems Chapter 5: Maintenance and Debugging Andreas Knirsch andreas.knirsch@h-da.de

More information

Tutorial on C Language Programming

Tutorial on C Language Programming Tutorial on C Language Programming Teodor Rus rus@cs.uiowa.edu The University of Iowa, Department of Computer Science Introduction to System Software p.1/64 Tutorial on C programming C program structure:

More information

Noncommercial Software for Mixed-Integer Linear Programming

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

More information

Problem Set 7 Solutions

Problem Set 7 Solutions 8 8 Introduction to Algorithms May 7, 2004 Massachusetts Institute of Technology 6.046J/18.410J Professors Erik Demaine and Shafi Goldwasser Handout 25 Problem Set 7 Solutions This problem set is due in

More information

Chapter 11. 11.1 Load Balancing. Approximation Algorithms. Load Balancing. Load Balancing on 2 Machines. Load Balancing: Greedy Scheduling

Chapter 11. 11.1 Load Balancing. Approximation Algorithms. Load Balancing. Load Balancing on 2 Machines. Load Balancing: Greedy Scheduling 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

More information

Using Power to Improve C Programming Education

Using Power to Improve C Programming Education Using Power to Improve C Programming Education Jonas Skeppstedt Department of Computer Science Lund University Lund, Sweden jonas.skeppstedt@cs.lth.se jonasskeppstedt.net jonasskeppstedt.net jonas.skeppstedt@cs.lth.se

More information

Guessing Game: NP-Complete?

Guessing Game: NP-Complete? Guessing Game: NP-Complete? 1. LONGEST-PATH: Given a graph G = (V, E), does there exists a simple path of length at least k edges? YES 2. SHORTEST-PATH: Given a graph G = (V, E), does there exists a simple

More information

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

A Branch and Bound Algorithm for Solving the Binary Bi-level Linear Programming Problem A Branch and Bound Algorithm for Solving the Binary Bi-level Linear Programming Problem John Karlof and Peter Hocking Mathematics and Statistics Department University of North Carolina Wilmington Wilmington,

More information

Data Structures and Algorithms

Data Structures and Algorithms Data Structures and Algorithms CS245-2016S-06 Binary Search Trees David Galles Department of Computer Science University of San Francisco 06-0: Ordered List ADT Operations: Insert an element in the list

More information

CHAPTER 4 ESSENTIAL DATA STRUCTRURES

CHAPTER 4 ESSENTIAL DATA STRUCTRURES CHAPTER 4 ESSENTIAL DATA STRUCTURES 72 CHAPTER 4 ESSENTIAL DATA STRUCTRURES In every algorithm, there is a need to store data. Ranging from storing a single value in a single variable, to more complex

More information

Algorithms and Data Structures

Algorithms and Data Structures Algorithms and Data Structures Part 2: Data Structures PD Dr. rer. nat. habil. Ralf-Peter Mundani Computation in Engineering (CiE) Summer Term 2016 Overview general linked lists stacks queues trees 2 2

More information

CS 2302 Data Structures Spring 2015

CS 2302 Data Structures Spring 2015 1. General Information Instructor: CS 2302 Data Structures Spring 2015 Olac Fuentes Email: ofuentes@utep.edu Web: www.cs.utep.edu/ofuentes Office hours: Tuesdays and Thursdays 2:00-3:30, or by appointment,

More information

Data Structures. Chapter 8

Data Structures. Chapter 8 Chapter 8 Data Structures Computer has to process lots and lots of data. To systematically process those data efficiently, those data are organized as a whole, appropriate for the application, called a

More information

Analysis of an Artificial Hormone System (Extended abstract)

Analysis of an Artificial Hormone System (Extended abstract) c 2013. This is the author s version of the work. Personal use of this material is permitted. However, permission to reprint/republish this material for advertising or promotional purpose or for creating

More information

Lecture 1: Course overview, circuits, and formulas

Lecture 1: Course overview, circuits, and formulas Lecture 1: Course overview, circuits, and formulas Topics in Complexity Theory and Pseudorandomness (Spring 2013) Rutgers University Swastik Kopparty Scribes: John Kim, Ben Lund 1 Course Information Swastik

More information

Route optimization applied to school transports A method combining column generation with greedy heuristics

Route optimization applied to school transports A method combining column generation with greedy heuristics PREPRINT Route optimization applied to school transports A method combining column generation with greedy heuristics Mikael Andersson Peter Lindroth Department of Mathematics CHALMERS UNIVERSITY OF TECHNOLOGY

More information

Solving convex MINLP problems with AIMMS

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

More information

Actually Doing It! 6. Prove that the regular unit cube (say 1cm=unit) of sufficiently high dimension can fit inside it the whole city of New York.

Actually Doing It! 6. Prove that the regular unit cube (say 1cm=unit) of sufficiently high dimension can fit inside it the whole city of New York. 1: 1. Compute a random 4-dimensional polytope P as the convex hull of 10 random points using rand sphere(4,10). Run VISUAL to see a Schlegel diagram. How many 3-dimensional polytopes do you see? How many

More information

Branch, Cut, and Price: Sequential and Parallel

Branch, Cut, and Price: Sequential and Parallel Branch, Cut, and Price: Sequential and Parallel T.K. Ralphs 1, L. Ladányi 2, and L.E. Trotter, Jr. 3 1 Department of Industrial and Manufacturing Systems Engineering, Lehigh University, Bethlehem, PA 18017,

More information

Routing in Line Planning for Public Transport

Routing in Line Planning for Public Transport Konrad-Zuse-Zentrum für Informationstechnik Berlin Takustraße 7 D-14195 Berlin-Dahlem Germany MARC E. PFETSCH RALF BORNDÖRFER Routing in Line Planning for Public Transport Supported by the DFG Research

More information

CLC Server Command Line Tools USER MANUAL

CLC Server Command Line Tools USER MANUAL CLC Server Command Line Tools USER MANUAL Manual for CLC Server Command Line Tools 2.5 Windows, Mac OS X and Linux September 4, 2015 This software is for research purposes only. QIAGEN Aarhus A/S Silkeborgvej

More information

Applied Algorithm Design Lecture 5

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

More information

Optimal Bandwidth Reservation in Hose-Model VPNs with Multi-Path Routing

Optimal Bandwidth Reservation in Hose-Model VPNs with Multi-Path Routing Optimal Bandwidth Reservation in Hose-Model VPNs with -Path Routing Thomas Erlebach Computer Engineering and Networks Laboratory (TIK) Dept. of Information Technology and Electrical Engineering ETH Zürich,

More information

2) Write in detail the issues in the design of code generator.

2) Write in detail the issues in the design of code generator. COMPUTER SCIENCE AND ENGINEERING VI SEM CSE Principles of Compiler Design Unit-IV Question and answers UNIT IV CODE GENERATION 9 Issues in the design of code generator The target machine Runtime Storage

More information

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 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

More information

A Decision Support System for Crew Planning in Passenger Transportation using a Flexible Branch-and-Price Algorithm

A Decision Support System for Crew Planning in Passenger Transportation using a Flexible Branch-and-Price Algorithm A Decision Support System for Crew Planning in Passenger Transportation using a Flexible Branch-and-Price Algorithm RICHARD FRELING 1, 2*, RAMON M. LENTINK 1, 2 AND ALBERT P.M. WAGELMANS 1 1 Erasmus Center

More information

Parallelization: Binary Tree Traversal

Parallelization: Binary Tree Traversal By Aaron Weeden and Patrick Royal Shodor Education Foundation, Inc. August 2012 Introduction: According to Moore s law, the number of transistors on a computer chip doubles roughly every two years. First

More information

Recursive Algorithms. Recursion. Motivating Example Factorial Recall the factorial function. { 1 if n = 1 n! = n (n 1)! if n > 1

Recursive Algorithms. Recursion. Motivating Example Factorial Recall the factorial function. { 1 if n = 1 n! = n (n 1)! if n > 1 Recursion Slides by Christopher M Bourke Instructor: Berthe Y Choueiry Fall 007 Computer Science & Engineering 35 Introduction to Discrete Mathematics Sections 71-7 of Rosen cse35@cseunledu Recursive Algorithms

More information

3.3. Solving Polynomial Equations. Introduction. Prerequisites. Learning Outcomes

3.3. Solving Polynomial Equations. Introduction. Prerequisites. Learning Outcomes Solving Polynomial Equations 3.3 Introduction Linear and quadratic equations, dealt within Sections 3.1 and 3.2, are members of a class of equations, called polynomial equations. These have the general

More information

Het inplannen van besteld ambulancevervoer (Engelse titel: Scheduling elected ambulance transportation)

Het inplannen van besteld ambulancevervoer (Engelse titel: Scheduling elected ambulance transportation) Technische Universiteit Delft Faculteit Elektrotechniek, Wiskunde en Informatica Delft Institute of Applied Mathematics Het inplannen van besteld ambulancevervoer (Engelse titel: Scheduling elected ambulance

More information

02-201: Programming for Scientists

02-201: Programming for Scientists 1. Course Information 1.1 Course description 02-201: Programming for Scientists Carl Kingsford Fall 2015 Provides a practical introduction to programming for students with little or no prior programming

More information

10CS35: Data Structures Using C

10CS35: Data Structures Using C CS35: Data Structures Using C QUESTION BANK REVIEW OF STRUCTURES AND POINTERS, INTRODUCTION TO SPECIAL FEATURES OF C OBJECTIVE: Learn : Usage of structures, unions - a conventional tool for handling a

More information

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

! 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

More information

Programming with Data Structures

Programming with Data Structures Programming with Data Structures CMPSCI 187 Spring 2016 Please find a seat Try to sit close to the center (the room will be pretty full!) Turn off or silence your mobile phone Turn off your other internet-enabled

More information

Chapter 6. Linear Programming: The Simplex Method. Introduction to the Big M Method. Section 4 Maximization and Minimization with Problem Constraints

Chapter 6. Linear Programming: The Simplex Method. Introduction to the Big M Method. Section 4 Maximization and Minimization with Problem Constraints Chapter 6 Linear Programming: The Simplex Method Introduction to the Big M Method In this section, we will present a generalized version of the simplex method that t will solve both maximization i and

More information

Lab 5: BitTorrent Client Implementation

Lab 5: BitTorrent Client Implementation Lab 5: BitTorrent Client Implementation Due: Nov. 30th at 11:59 PM Milestone: Nov. 19th during Lab Overview In this lab, you and your lab parterner will develop a basic BitTorrent client that can, at minimal,

More information

Combining (Integer) Linear Programming Techniques and Metaheuristics for Combinatorial Optimization

Combining (Integer) Linear Programming Techniques and Metaheuristics for Combinatorial Optimization Combining (Integer) Linear Programming Techniques and Metaheuristics for Combinatorial Optimization Günther R. Raidl 1 and Jakob Puchinger 2 1 Institute of Computer Graphics and Algorithms, Vienna University

More information

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits Outline NP-completeness Examples of Easy vs. Hard problems Euler circuit vs. Hamiltonian circuit Shortest Path vs. Longest Path 2-pairs sum vs. general Subset Sum Reducing one problem to another Clique

More information

Introduction to Synoptic

Introduction to Synoptic Introduction to Synoptic 1 Introduction Synoptic is a tool that summarizes log files. More exactly, Synoptic takes a set of log files, and some rules that tell it how to interpret lines in those logs,

More information

Chapter 3 INTEGER PROGRAMMING 3.1 INTRODUCTION. Robert Bosch. Michael Trick

Chapter 3 INTEGER PROGRAMMING 3.1 INTRODUCTION. Robert Bosch. Michael Trick Chapter 3 INTEGER PROGRAMMING Robert Bosch Oberlin College Oberlin OH, USA Michael Trick Carnegie Mellon University Pittsburgh PA, USA 3.1 INTRODUCTION Over the last 20 years, the combination of faster

More information