Written Exam Linear and Integer Programming (DM545)

Similar documents
Written Exam Linear and Integer Programming (DM554)

maxz = 3x 1 +4x 2 2x 1 +x 2 6 2x 1 +3x 2 9 x 1,x 2

min3x 1 + 4x 2 + 5x 3 2x 1 + 2x 2 + x 3 6 x 1 + 2x 2 + 3x 3 5 x 1, x 2, x 3 0.

Section Notes 9. IP: Cutting Planes. Applied Math 121. Week of April 12, 2010

(P ) Minimize 4x 1 + 6x 2 + 5x 3 s.t. 2x 1 3x 3 3 3x 2 2x 3 6

21. Solve the LP given in Exercise 19 using the big-m method discussed in Exercise 20.

Introduction to Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Optimization - Examples Sheet 1

Standard Form An LP is in standard form when: All variables are non-negativenegative All constraints are equalities Putting an LP formulation into sta

MVE165/MMG631 Linear and integer optimization with applications Lecture 5 Linear programming duality and sensitivity analysis

Summary of the simplex method

Section Notes 8. Integer Programming II. Applied Math 121. Week of April 5, expand your knowledge of big M s and logical constraints.

DM559/DM545 Linear and integer programming

min 4x 1 5x 2 + 3x 3 s.t. x 1 + 2x 2 + x 3 = 10 x 1 x 2 6 x 1 + 3x 2 + x 3 14

Week 4. (1) 0 f ij u ij.

1. Algebraic and geometric treatments Consider an LP problem in the standard form. x 0. Solutions to the system of linear equations

Review Solutions, Exam 2, Operations Research

c) Place the Coefficients from all Equations into a Simplex Tableau, labeled above with variables indicating their respective columns

DEPARTMENT OF STATISTICS AND OPERATIONS RESEARCH OPERATIONS RESEARCH DETERMINISTIC QUALIFYING EXAMINATION. Part I: Short Questions

Section Notes 9. Midterm 2 Review. Applied Math / Engineering Sciences 121. Week of December 3, 2018

Discrete Optimization

Linear Programming Redux

Note 3: LP Duality. If the primal problem (P) in the canonical form is min Z = n (1) then the dual problem (D) in the canonical form is max W = m (2)

Systems Analysis in Construction

Overview of course. Introduction to Optimization, DIKU Monday 12 November David Pisinger

MAT016: Optimization

Linear Programming Duality P&S Chapter 3 Last Revised Nov 1, 2004

Introduction to the Simplex Algorithm Active Learning Module 3

Introduction to integer programming II

Decision Models Lecture 5 1. Lecture 5. Foreign-Currency Trading Integer Programming Plant-location example Summary and Preparation for next class

Review Questions, Final Exam

Algorithms Exam TIN093 /DIT602

Lecture 5. x 1,x 2,x 3 0 (1)

SOLVING INTEGER LINEAR PROGRAMS. 1. Solving the LP relaxation. 2. How to deal with fractional solutions?

Spring 2017 CO 250 Course Notes TABLE OF CONTENTS. richardwu.ca. CO 250 Course Notes. Introduction to Optimization

Linear Programming Duality

Integer Programming. The focus of this chapter is on solution techniques for integer programming models.

END3033 Operations Research I Sensitivity Analysis & Duality. to accompany Operations Research: Applications and Algorithms Fatih Cavdur

MATH 373 Section A1. Final Exam. Dr. J. Bowman 17 December :00 17:00

Lecture 23 Branch-and-Bound Algorithm. November 3, 2009

Resource Constrained Project Scheduling Linear and Integer Programming (1)

CHAPTER 2. The Simplex Method

Math 16 - Practice Final

Lecture 11 Linear programming : The Revised Simplex Method

IP Cut Homework from J and B Chapter 9: 14, 15, 16, 23, 24, You wish to solve the IP below with a cutting plane technique.

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

Sensitivity Analysis

Introduction to optimization and operations research

MATH 445/545 Test 1 Spring 2016

MATH 445/545 Homework 2: Due March 3rd, 2016

Lecture 11: Post-Optimal Analysis. September 23, 2009

Lecture 5 January 16, 2013

Computational Integer Programming Universidad de los Andes. Lecture 1. Dr. Ted Ralphs

Metode Kuantitatif Bisnis. Week 4 Linear Programming Simplex Method - Minimize

OPTIMISATION 2007/8 EXAM PREPARATION GUIDELINES

A Review of Linear Programming

Advanced Linear Programming: The Exercises

CS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs. Instructor: Shaddin Dughmi

Answer the following questions: Q1: Choose the correct answer ( 20 Points ):

- Well-characterized problems, min-max relations, approximate certificates. - LP problems in the standard form, primal and dual linear programs

AM 121: Intro to Optimization Models and Methods

1 Review Session. 1.1 Lecture 2

Week 3 Linear programming duality

CS675: Convex and Combinatorial Optimization Fall 2016 Combinatorial Problems as Linear and Convex Programs. Instructor: Shaddin Dughmi

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Lecture 2: The Simplex method

Relation of Pure Minimum Cost Flow Model to Linear Programming

Chap6 Duality Theory and Sensitivity Analysis

Linear Programming: Chapter 5 Duality

Farkas Lemma, Dual Simplex and Sensitivity Analysis

Foundations of Operations Research

Optimization Methods in Management Science

Simplex Method for LP (II)

COMP3121/9101/3821/9801 Lecture Notes. Linear Programming

56:171 Operations Research Fall 1998

December 2014 MATH 340 Name Page 2 of 10 pages

Worked Examples for Chapter 5

IE418 Integer Programming

Points: The first problem is worth 10 points, the others are worth 15. Maximize z = x y subject to 3x y 19 x + 7y 10 x + y = 100.

MATH3017: Mathematical Programming

BBM402-Lecture 20: LP Duality

Math 164-1: Optimization Instructor: Alpár R. Mészáros

F 1 F 2 Daily Requirement Cost N N N

Mathematics for Decision Making: An Introduction. Lecture 8

Homework Assignment 4 Solutions

CSC Design and Analysis of Algorithms. LP Shader Electronics Example

CO 250 Final Exam Guide

OPTIMISATION /09 EXAM PREPARATION GUIDELINES

Part 1. The Review of Linear Programming

Mathematical Programs Linear Program (LP)

Week 2. The Simplex method was developed by Dantzig in the late 40-ties.

Solutions to Review Questions, Exam 1

C&O 355 Mathematical Programming Fall 2010 Lecture 18. N. Harvey

56:270 Final Exam - May

Linear and Integer Programming - ideas

1 Simplex and Matrices

Summary of the simplex method

Fundamentals of Operations Research. Prof. G. Srinivasan. Indian Institute of Technology Madras. Lecture No. # 15

CS261: Problem Set #3

AM 121 Introduction to Optimization: Models and Methods Example Questions for Midterm 1

Transcription:

Written Exam Linear and Integer Programming (DM545) Department of Mathematics and Computer Science University of Southern Denmark Monday, June 22, 2015, 10:00 14:00, Festsalen, Niels Bohr Allé 1 The exam consists of a number of tasks divided into subtasks. The answers in a PDF document are to be handed in electronically in Blackboard (http://e-learn.sdu.dk). The content of the documents Eksamensvejledning and Exam Monitor published in BlackBoard under the section Course Information is assumed to be known. Remember to justify all your statements! You may refer to results from the books or the lecture slides listed at the course web page. In particular, it is possible to justify a statement by saying that it derives trivially from a result in the textbook (if this is true). You may use all methods or extensions that have been used in the assignment sheets, published during the course. However, it is not allowed to answer a subtask exclusively by reference to an exercise seen during the course. Reference to other books (outside the course material) or to internet links is not accepted as answer to a task. The contribution to the final evaluation of each task, if carried out correctly, is given at the beginning of each task as a list of points for each subtask. The number of points does not necessarily reflect the difficulty of the subtask. The maximum score is 100. Exercises are sorted in the order of treatment during the course. The exam consists of 7 tasks distributed on 15 pages. You may write your answers in Danish or in English. An HTML version of this document with some data in different format is available at: http://www.imada.sdu.dk/~marco/dm545/exam/sb7i5wgk.html However, the printed copy and the PDF file are the official reference for the exam.

Contents Simplex (points: 8, 12, 5, 10) 3............................................. 3............................................. 3............................................. 4............................................. 4 Revised Simplex (points: 10, 3) 5............................................. 5............................................. 5 Duality (points: 11) 6 LP Formulation (points: 5, 5, 3) 7............................................. 7............................................. 8............................................. 8 Branch and bound (points: 10, 6) 9............................................. 9............................................. 9 IP Formulation (points: 12) 12 Network Flows (points: 5) 14 Page 2 of 15

Task 1 Simplex (points: 8, 12, 5, 10) Consider the following integer linear programming problem: x 2 (IP ) max z = 2x 1 + x 2 s.t. 5x 1 + 10x 2 25 3x 1 2x 2 1 x 1 + 3x 2 1 0 x 2 2 x 1 0 x 1, x 2 integer x 1 and let (LR0) be the linear relaxation of (IP). [Note: in the following subtasks, arguments that refer to the graphical representation given above will NOT be counted as valid. You can use Python to do the calculations. A tutorial on the commands you may need is available from the course web page under Assessment. For rational numbers, please, use fraction mode representation. ] Subtask 1.a Write the initial tableau for (LR0) and the corresponding basic solution. solution feasible? Is the basic Subtask 1.b After a number of simplex iterations the tableau of (LR0) looks as follows: x1 x2 x3 x4 x5 x6 -z b 5/3 0 1 0 10/3 0 0 65/3 11/3 0 0 1-2/3 0 0 5/3 1/3 1 0 0-1/3 0 0 1/3-1/3 0 0 0 1/3 1 0 5/3 5/3 0 0 0 1/3 0 1-1/3 Perform from here another simplex iteration using the largest increase pivoting rule. [The Python code for the tableau above is given in the HTML version of this document.] Page 3 of 15

Subtask 1.c After two more simplex iterations we reach the following optimal tableau for (LR0): x1 x2 x3 x4 x5 x6 -z b 1 0 1/20 1/4 0 0 0 3/2 0 0-3/40 1/8 0 1 0 1/4 0 1 3/40-1/8 0 0 0 7/4 0 0 11/40-1/8 1 0 0 23/4 0 0-7/40-3/8 0 0 1-19/4 Write: (i) an explanation of why this tableau is optimal. (ii) the corresponding optimal solution and its value. (iii) what type of information the solution value of (LR0) provides for the solution value of (IP). (iv) the branching constraint for the variable of (IP) that has the most fractional value in the optimal solution of (LR0). Subtask 1.d Let s now branch on the variable x 2 : x 2 7/4 x 2 7/4 and let s consider the up branch, that is, x 2 7/4. Add this constraint to (LR0), thus obtaining the new problem (LR1). Find the optimal solution of (LR1) by introducing the new constraint in the optimal tableau of (LR0) 1 and performing one single further simplex iteration. Report the optimal solution of (LR1). Can we say that this solution is the optimal solution also for the original problem (IP) without doing any further computation? Why? 1 You are given this optimal tableau in Subtask 1.c. Page 4 of 15

Task 2 Revised Simplex (points: 10, 3) Consider the following LP problem maximize x 1 + 2 x 2 + 4 x 3 + 8 x 4 + 16 x 5 st x 1 + 2 x 2 + 3 x 3 + 4 x 4 + 5 x 5 5 7 x 1 + 5 x 2 3 x 3 2 x 4 0 x 1, x 2, x 3, x 4, x 5 0 and call x 6, x 7 the two slack variables to bring the problem in standard form. [Use Python to carry out the calculations. Here, there is no requirement to use the fraction mode. You find online the data above in Python format.] Subtask 2.a In the optimal simplex tableau the basic variables are x B = (x 3, x 5 ) and the non basic variables are x N = (x 1, x 2, x 4, x 6, x 7 ). Using only matrix computations, like in the revised simplex method, determine the value of the variables (x 1, x 2, x 3, x 4, x 5 ) and the value of the two dual variables associated with the two constraints. Subtask 2.b Knowing that (x 5, x 7 ) and (x 3, x 5 ) are also optimal bases and that all three optimal bases give the same optimal solution, what can you conclude about the state of the simplex tableau? Page 5 of 15

Task 3 Duality (points: 11) Write the dual of the following pooling problem that we defined in Exam 2014 on a set of source nodes I, indexed by i and a set of pools J, index by j: (P ) max r j x ij j J i I x ij b i j J x ij d j i I p i x ij = p j i I i I x ij 0 x ij i I j J j J i I, j J If you find it helpful, you can use the numerical example depicted in Figure 1. However, the dual problem must be expressed in general terms as in the model above. 4 12 30 dkk 20% 10 40% G 3 12 25 dkk 16% 20 0% T 2 12 21 dkk 13% 1 12 15 dkk 10% Figure 1: A numerical example for the pooling problem of Task 3. Page 6 of 15

Task 4 LP Formulation (points: 5, 5, 3) Consider the world s currency market. Given two currencies, say the British Pound GBP and the Euro, there is an exchange rate between them (currently about 0.72 Pounds to the Euro). It is often true that, if you convert money from one currency to another and then back, you will end up with less than you started with. That is, the product of the exchange rates between the two countries is less than one. However, it sometimes happens that a longer chain of conversions results in a gain. Such a lucky situation is called a currency arbitrage. One can use a linear programming model to find such situations when they suddenly arise. Consider the following table of exchange rates (which are actual data): rate = { ( USD, YEN ) : 122.785, ( YEN, USD ) : 0.008, ( USD, GBP ) : 0.646, ( GBP, USD ) : 1.548, ( USD, EUR ) : 0.885, ( EUR, USD ) : 1.13, ( EUR, GBP ) : 0.72, ( GBP, EUR ) : 1.39, ( EUR, YEN ) : 138.802, ( YEN, EUR ) : 0.007, ( GBP, YEN ) : 190.131, ( YEN, GBP ) : 0.005 } It is not obvious, but the EUR USD GBP EUR conversion actually generates 1 euro if we let circulate 68 euro, i.e., it is a money pump. To look for arbitrage possibilities, one can make a generalized network model, which is a network flow model with the unusual feature that a unit of flow that leaves one node arrives at the next node multiplied by a scale factor in our case, the currency conversion rate. For us, each currency is represented by a node. There is an arc from each node to every other node. A flow of one unit out of one node becomes a flow of a different magnitude at the head node. For example, one dollar flowing out of the USD node arrives at the YEN node as 122.785 YEN. Let x ij denote the flow from node (i.e. currency) i to node j. This flow is measured in the currency of node i. One node is special; it is the home node, say the Euro (EUR) node. At this node there can be a flow imbalance. At all other nodes, there must be flow balance. [The following three tasks must be solved sequentially. Hence, if you cannot do one, skip the successive ones and focus on another Task.] Subtask 4.a Write a linear programming problem in explicit form 2 for the specific example and data described above. More specifically: 2 An explicit form is here intended to use scalars and specific data and does not use summations, vectors and matrices. Page 7 of 15

Write the flow balance constraints at one of the 3 non-home nodes (YEN, USD and GBP). At the home node (EUR), the flow balance will not be satisfied. Instead one expects a net in or out flow. If it is possible to make this net flow outgoing, then an arbitrage has been found. Let f be a variable that represents the outflow. Using variable f to represent net outflow to the home node, write a flow balance equation for the home node. Write an objective function to find the best arbitrage, ie, chain of conversions. To avoid unboundedness limit f to be smaller or equal to 1. Subtask 4.b Now consider the general case, which might involve hundreds of currencies worldwide. Write the model mathematically using x ij for the flow leaving node i heading for node j (measured in the currency of node i), r ij for the exchange rate when converting from currency i to currency j, and f for the net outflow at the home node h. Subtask 4.c Is the constraint matrix totally unimodular? Can your model give a fractional flow x? Page 8 of 15

Task 5 Branch and bound (points: 10, 6) Consider the following knapsack problem: Subtask 5.a max 42x 0 + 87x 1 + 53x 2 + 50x 3 + 58x 4 s.t. 88x 0 + 44x 1 + 56x 2 + 26x 3 + 14x 4 92 x 0, x 1, x 2, x 3, x 4 binary We solve the problem by branch and bound. In Table 1 we report the solution values of the linear programming relaxations computed at some initial nodes. After each computation, you have to provide the missing information here listed: (a) The value of the best global 3 dual bound up to that point (take possible roundings into account). The initial value is +. (b) The value of the best global primal bound up to that point. The initial value is. (c) The list of open nodes left and, if some nodes have been pruned, an indication about the type of pruning used (i.e., by optimality, by infeasibility, by bounding). (d) Whether we can stop because we solved the problem or whether we must continue examining open nodes or branching. If we solved the problem say which is the solution type (infeasible/unbounded) or the solution value. You have to report this information after each row of the Table 1. The branch and bound tree represented on the right column is obtained after the solution of the linear relaxation at the node. Nodes filled with grey are nodes that have been already processed while nodes in white have not yet been processed. The list of open nodes will be made by the white nodes that you decide not to prune. [Note, running a solver will not help you to solve this task.] Subtask 5.b We solve the problem by branch and bound. The first two levels of the branch and bound tree are reported in Figure 2. We solve first the linear relaxation at the root node and then the one at the node N3. The solution found at node N3 is: x N3 LR = [0; 0.5; 1; 0; 1] and has value 154.5. Find a valid cover inequality that is violated by this solution and say whether it would be valid globally, for example, also at the node N2 and N6. 3 A global dual/primal bound is one that is valid a the root node given the information collected on the subtrees. Page 9 of 15

Node N1: Simplex report: x 2 0 N1 x 2 1 starting value = 290.000000 Finished solving (status=optimal, iters=2, leave=2, enter=0, objvalue=202.571429) fractional variables = 1 x 0 0 N6 N2 x 0 1 N7 x 1 0 N4 N3 x 1 1 N5 Node N3: Simplex report: x 2 0 N1 x 2 1 starting value = 202.571429 finished solving (status=optimal, iters=2, leave=2, enter=0, objvalue=154.500000) fractional variables = 1 x 0 0 N6 N2 x 0 1 N7 x 1 0 N4 N3 x 1 1 N5 Node N2: Simplex report: x 2 0 N1 x 2 1 starting value = 202.571429 Finished solving (status=optimal, iters=1, leave=1, enter=0, objvalue=198.818182) fractional variables = 1 x 0 0 N6 N2 x 0 1 N7 x 1 0 N4 N3 x 1 1 N5 Node N6: Simplex report: x 2 0 N1 x 2 1 starting value = 198.818182 Finished solving (status=optimal, iters=1, leave=1, enter=0, objvalue=195.000000) fractional variables = 0 x 0 0 N6 N2 x 0 1 N7 x 1 0 N4 N3 x 1 1 N5 Node N7: Simplex report: x 2 0 N1 x 2 1 starting value = 198.818182 Finished solving (status=infeasible, objvalue=--) x 0 0 N2 x 0 1 x 1 0 N3 x 1 1 N6 N7 N4 N5 Table 1: The results of linear relaxations at some nodes of the branch and bound tree. Page 10 of 15

N1 x 2 0 x 2 1 N2 N3 x 0 0 x 0 1 x 1 0 x 1 1 N6 N7 N4 N5 Figure 2: The first two levels of the branch and bound tree of Subtask 5.b. Page 11 of 15

Task 6 IP Formulation (points: 12) The following decision problem arises in the organization of the course FF501, First Year Project, at the Faculty of Science. After the assignment of students to projects, the students must be assigned to sections (in Danish, hold) of a set of minicourses and the sections must be scheduled in one of the available timeslots. Minicourses are workshops on topics complementary to the projects, for example, on Latex, on scientific writing, etc. Each minicourse is offered a number of times, each times to a different set of students called section (or hold, in Danish). We make the simplifying assumption that students are enrolled to all minicourses available. Moreover, since students assigned in groups to the same project are to be assigned to the same section, we focus on groups rather than on students. We use the following notation: G, indexed by g, is the set of groups; n g is the number of students in group g G; C, indexed by c, is the set of minicourses; H c, indexed by h, is the set of sections for minicourse c C. For two different minicourses c 1, c 2 the sets H c1, H c2 are different and may contain a different number of sections; T, indexed by t, is the set of timeslots (they can be thought of as tuples (day, hour, week)). We will assume that no pair of different timeslots, t 1, t 2 T, overlap; n c is the average number of students in sections of a minicourse c C. This number is obtained by dividing the total number of students that are enrolled in the minicourse by the number of sections in the minicourse, ie, H c. It represents the desired size of the section. Your task is to write a mixed integer linear programming problem to model the assignment of students to sections and sections to timeslots. Your model must express the following constraints: (i) each group must attend exactly one section of each minicourse (ii) each section must be scheduled in a timeslot (iii) there cannot be two sections of the same minicourse that are scheduled in the same timeslot (iv) if two sections of different minicourses share groups, then they cannot be scheduled at the same time. Page 12 of 15

The objective is to balance the distribution of students in the sections by minimizing the sum of the absolute deviations of the number of students assigned to the sections from their desired size, that is, n c for all sections of course c C. [Hint: introduce binary variables x gch and y cht to represent the assignment of groups to sections and of sections to timeslots.] Page 13 of 15

Task 7 Network Flows (points: 5) This task was not included in the written exam of June 22 but it is included for the oral reexam. Maximum flow problems in networks can be solved by linear programming or, more efficiently, by dedicated algorithms. In the module networkx for Python the function maximum_flow solves the maximum flow problem using one of these efficient algorithms, that can be selected with the option flow_func. In Figure 3 you are given an example of a Python script that uses maximum_flow for finding the maximum flow for the Network depicted on the right side. In this particular example the algorithm by Ford and Fulkerson is selected that solves the problem in O(nm 2 ) for n nodes and m arcs. #!/usr/bin/env python import networkx as nx t print "Networkx versions is",nx. version G = nx.digraph() G.add_edge( s, a, capacity=3.0) G.add_edge( s, b, capacity=1.0) G.add_edge( a, c, capacity=3.0) G.add_edge( b, c, capacity=5.0) G.add_edge( b, d, capacity=4.0) G.add_edge( d, e, capacity=2.0) G.add_edge( c, t, capacity=2.0) G.add_edge( e, t, capacity=3.0) flow_value, flow_dict = nx.maximum_flow(g, s, t, flow_func=nx.algorithms.flow.ford_fulkerson) print flow_value, flow_dict 2.0 3.0 e 5.0 2.0 b 4.0 d 1.0 3.0 s c 3.0 a Figure 3: An example of Python code to find the maximum (s, t) flow in the network depicted on the right. Remember that a max flow problem is always defined in a network N = (V, A, l 0, u), that is, a network where on arcs there are only capacities and no lower bounds. All nodes except the source and the target have then null balance. Source and target have infinite balances. In this task, you have to find a feasible flow for the network N = (V, A, l, u ) represented in Figure 4 by solving a maximum flow problem. More specifically, you have to: (i) explain how you can use a maximum flow algorithm for a network N for solving the feasible flow problem for the network N ; (ii) report the script with the correct data for solving the feasible flow problem on the network N ; Page 14 of 15

(iii) execute the script and, if a feasible flow for the Network of Figure 4 is found, report the flow for this network. (If you do not have networkx installed then make sure that your code is correct both in the data content and in syntax such that it can be run by the examiner by copy and paste.) [Note that an answer to this task by guessing a solution without reporting the precise source code will not count as valid.] 1//2 b/ 5 c/2 d/4 3//4 3//4 3//4 2//2 2//4 0//1 a/ 1 a/-1, b/-5, c/2, d/4, e/0 a/c/{3/ /4}, a/d/{2/ /2}, b/c/{1/ /2}, b/e/{3/ /4}, c/a/{3/ /4}, e/a/{0/ /1}, e/d/{2/ /4} e/0 Figure 4: The network with the data. For the nodes the notation l/b indicates the that label of the node is l and the balance b. For the arcs the notation e 1 /e 2 /{l//u} indicates that the tail of the arc is e 1, the head e 2, the lower bound l and the upper bound u (The Tikz file for the network is available in the online HTML version of this document.) Page 15 of 15