Algorithms and Data Structures 2014 Exercises and Solutions Week 14

Similar documents
Network Flow Problems Luis Goddyn, Math 408

Algorithms Demands and Bounds. Demands and Bounds. Design and Analysis of Algorithms Andrei Bulatov

Math Mathematical Notation

Theory of Network Communication

A spectral Turán theorem

Lecture 1. 1 Overview. 2 Maximum Flow. COMPSCI 532: Design and Analysis of Algorithms August 26, 2015

NP and NP-Completeness

The Budgeted Minimum Cost Flow Problem with Unit Upgrading Cost

A Regularization Framework for Learning from Graph Data

Math 20C. Lecture Examples.

Unit 11: Vectors in the Plane

Section 6: PRISMATIC BEAMS. Beam Theory

Lect-19. In this lecture...

Online Companion to Pricing Services Subject to Congestion: Charge Per-Use Fees or Sell Subscriptions?

Discrete Optimization 23

MCAT Physics - Problem Drill 06: Translational Motion

Would you risk your live driving drunk? Intro

Geostrophy & Thermal wind

DEVIL PHYSICS THE BADDEST CLASS ON CAMPUS AP PHYSICS

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

Scalar multiplication and algebraic direction of a vector

Efficient solution of interval optimization problem

Minimum cost transportation problem

FREEWAY WEAVING. Highway Capacity Manual 2000 CHAPTER 24 CONTENTS EXHIBITS

Blue and purple vectors have same magnitude and direction so they are equal. Blue and green vectors have same direction but different magnitude.

arxiv: v2 [math.co] 12 Jul 2009

Maximum flow problem CE 377K. February 26, 2015

BAYESIAN PREMIUM AND ASYMPTOTIC APPROXIMATION FOR A CLASS OF LOSS FUNCTIONS

1 :: Mathematical notation

Isoperimetric problems

Math 144 Activity #9 Introduction to Vectors

On diamond-free subposets of the Boolean lattice

Flow Network. The following figure shows an example of a flow network:

Chapter 7 Network Flow Problems, I

Lecture #21. c T x Ax b. maximize subject to

A-level Mathematics. MM03 Mark scheme June Version 1.0: Final

Two Applications of Maximum Flow

Linear Programming Duality

7.5 Bipartite Matching

Magnetism has been observed since roughly 800 B.C. Certain rocks on the Greek peninsula of Magnesia were noticed to attract and repel one another.

Notes on Linear Minimum Mean Square Error Estimators

International Journal of Scientific & Engineering Research, Volume 7, Issue 11, November-2016 ISSN Nullity of Expanded Smith graphs

Some Lecture Notes on Auctions

arxiv: v1 [math.co] 25 Apr 2016

different formulas, depending on whether or not the vector is in two dimensions or three dimensions.

6.046 Recitation 11 Handout

Chapter 5 Solution P5.2-2, 3, 6 P5.3-3, 5, 8, 15 P5.4-3, 6, 8, 16 P5.5-2, 4, 6, 11 P5.6-2, 4, 9

On resilience of distributed routing in networks under cascade dynamics

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.436J/15.085J Fall 2008 Recitation 13 10/31/2008. Markov Chains

Lecture J. 10 Counting subgraphs Kirchhoff s Matrix-Tree Theorem.

27 ft 3 adequately describes the volume of a cube with side 3. ft F adequately describes the temperature of a person.

Polynomial-Solvability of N P-class Problems

(a) During the first part of the motion, the displacement is x 1 = 40 km and the time interval is t 1 (30 km / h) (80 km) 40 km/h. t. (2.

UNDERSTAND MOTION IN ONE AND TWO DIMENSIONS

Stable Network Flow with Piece-wise Linear Constraints

arxiv: v1 [math.gt] 2 Nov 2010

Review of Matrices and Vectors 1/45

Towards Green Distributed Storage Systems

On Shortest Single/Multiple Path Computation Problems in Fiber-Wireless (FiWi) Access Networks

Optimization Problems in Multiple Subtree Graphs

A Geometric Review of Linear Algebra

Introduction to Thermodynamic Cycles Part 1 1 st Law of Thermodynamics and Gas Power Cycles

Algebra Based Physics. Motion in One Dimension. 1D Kinematics Graphing Free Fall 2016.notebook. August 30, Table of Contents: Kinematics

Chapter 2: 1D Kinematics Tuesday January 13th

Motion in Two and Three Dimensions

An Explicit Lower Bound of 5n o(n) for Boolean Circuits

Maximum flow problem

Dynamic Lot Size Problems with One-way Product Substitution 1

A Geometric Review of Linear Algebra

6.3 Vectors in a Plane

DYNAMICS. Kinematics of Particles Engineering Dynamics Lecture Note VECTOR MECHANICS FOR ENGINEERS: Eighth Edition CHAPTER

0 a 3 a 2 a 3 0 a 1 a 2 a 1 0

Chapter 4: Techniques of Circuit Analysis

Motion in Two and Three Dimensions

6.1.1 Angle between Two Lines Intersection of Two lines Shortest Distance from a Point to a Line

IE 5531: Engineering Optimization I

4.6 Linear Programming duality

Some Lecture Notes on Auctions

Generalization of the Minimum Branch Vertices Spanning Tree Problem

Network Flows. 7. Multicommodity Flows Problems. Fall 2010 Instructor: Dr. Masoud Yaghini

Note on Posted Slides. Motion Is Relative

G 2(X) X SOLVABILITY OF GRAPH INEQUALITIES. 1. A simple graph inequality. Consider the diagram in Figure 1.

Exercises - Linear Programming

Lesson 2: Kinematics (Sections ) Chapter 2 Motion Along a Line

Pyramidal Sum Labeling In Graphs

Chapter 11 Collision Theory

Network Flows. CS124 Lecture 17

3.3 Easy ILP problems and totally unimodular matrices

Chapter 7. Network Flow. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Graphs and Network Flows IE411. Lecture 12. Dr. Ted Ralphs

LINEAR ALGEBRA. and VECTOR GEOMETRY Volume 2 of 2 September 2014 edition

BBM402-Lecture 20: LP Duality

CHAPTER 3 : VECTORS. Definition 3.1 A vector is a quantity that has both magnitude and direction.

Duality of LPs and Applications

dv dv 2 2 dt dt dv dt

On (a, d)-vertex-antimagic total labeling of Harary graphs

Flows and Cuts. 1 Concepts. CS 787: Advanced Algorithms. Instructor: Dieter van Melkebeek

Journal of Computational and Applied Mathematics. New matrix iterative methods for constraint solutions of the matrix

THE LOCAL-GLOBAL PRINCIPLE KEITH CONRAD

Maximum Flow Problem (Ford and Fulkerson, 1956)

Transcription:

lgorithms and ata tructures 0 xercises and s Week Linear programming. onsider the following linear program. maximize x y 0 x + y 7 x x 0 y 0 x + 3y Plot the feasible region and identify the optimal solution. Just for checking: x = and y =.. cargo plane can carry a maximum weight of 00 tons and a maximum olume of 0 cubic meters. here are three materials to be transported, and the cargo company may choose to carry any amount of each, upto the maximum aailable limits gien below. Material has density tons/cubic meter, maximum aailable amount 0 cubic meters, and reenue e.000 per cubic meter. Material has density tons/cubic meter, maximum aailable amount 30 cubic meters, and reenue e.00 per cubic meter. Material 3 has density 3 tons/cubic meter, maximum aailable amount 0 cubic meters, and reenue e.000 per cubic meter. Write a linear program that optimizes reenue within the constraints. We introduce ariables,, and 3 representing the olumes of the respectie materials. he requested linear program is then gien by maximize 000 + 00 + 000 3 + + 3 3 00 + + 3 0 0 30 3 0,, 3 0. 3. You are gien the following points (x i, y i ) in the plane: (, 3), (, ), (3, 7), (, ), (7, ), (8, ), (0, 9). uppose you want to determine a line ax + by = c that approximately passes through these points (it might not contain all the points). Write a linear program to find a line that minimizes the maximum absolute error, being max ax i + by i c 0<i 7

We introduce a ariable z to replace the formula max 0<i 7 ax i + by i c. It remains to constrain z such that z = max 0<i 7 ax i + by i c. ince we are minimizing z, it is sufficient to hae z max 0<i 7 ax i + by i c, which is equialent to the requirements z ax i + by i c for 0 < i 7. o get rid of the absolute alues, we split each of those requirements into z ax i + by i c and z ax i by i + c. Note that because z is greater than certain absolute alues, we can add the restriction z 0 without affecting the solution. In standard form, the linear program is gien by maximize z z + x i a + y i b c 0 0<i 7 z + x i a + y i b c 0 0<i 7 a, b, c, z 0.. he following figure shows a graph with four nodes on the left representing boys and four nodes on the right representing girls. here is an edge between a boy and girl if they like each other (for instance, l likes all the girls). his kind of graph, in which the nodes can be partitioned into two groups such that all edges are between the groups, is called bipartite. Is it possible to choose couples so that eeryone has exactly one partner? In graph-theoretic jargon, is there a perfect matching? Write a linear program that soles the matching problem. We turn the graph into a directed graph, choosing to direct the edges towards the girls. urthermore, we add nodes s and t to the graph with for eery boy an edge from s to that boy and for eery girl an edge from that girl to t. or all nodes i and j, we hae a constant c ij that is 0 if there is no edge and if there is an edge from i to j. inally, we introduce ariables f ij for all nodes i and j. he problem has turned into a maximum flow problem (after soling it as such, we simply check if the size of the flow equals the number of boys), where s is the source node, t the sink node, c the capacities and f the flow. hus, the problem can be modelled by a linear program as explained during the lecture.. In the last lecture, we saw the single-source-single-target shortest path problem being formulated as a linear maximization problem. lternatiely, one can derie the following dual minimization ariant: minimize x u w(u, ) (u,) Here, x u = if the edge (u, ) is part of the shortest path, and x u = 0, otherwise. Write down the corresponding constraints. he constraints are x s x s = x t x t =

and, for all w / {s, t}, x w x w = 0. Here s is the source node and t is the target node. o make this a linear problem, we need to replace the assertion x u {0, } for all u and by x u 0. Note that there may now be solutions with non-integer alues for some x u. his means that the flow is diided oer multiple paths between certain nodes, but because of the minimization it can only be diided if these paths hae the same length. hus, any path along which all x u are nonzero will be a shortest path.. onert the following linear program into standard form: minimize x + 7x + x 3 x x 3 = 7 3x + x x 0 x 3 0 We first switch from minimization to maximization by multiplying the objectie function by. Now obsere that x has no nonnegatiity constraint, so we replace it by x x. he same goes for x 3, but we can exploit the x 3 0 constraint to simply replace x 3 by x 3. Now we replace the equality constraint. maximize x + x 7x + x 3 x x + x 3 = 7 3x 3x + x x, x, x, x 3 0 maximize x + x 7x + x 3 x x + x 3 7 x x + x 3 7 3x 3x + x x, x, x, x 3 0 inally, we fix the constraints with opposite signs. maximize x + x 7x + x 3 x + x x 3 7 x x + x 3 7 3x + 3x x x, x, x, x 3 0 7. onert the following linear program into slack form: maximize x x 3 x + x x 3 7 3x x 8 x + x + x 3 0 x, x, x 3 0

What are the basic and nonbasic ariables? irst we conert to standard form. maximize x x 3 x + x x 3 7 3x + x 8 x x x 3 0 x, x, x 3 0 Now we introduce slack ariables x, x, and x and display the program in slack form. z = x x 3 x = 7 x x + x 3 x = 8 + 3x x x = x + x + x 3 hose are the basic ariables. he nonbasic ariables are x, x, and x 3. 8. ole the following linear program using IMPLX maximize 8x +.x x + x 0 x x x, x 0 We first conert to slack form. z = 8x +.x x 3 = 0 x x x = x x = x he ariable x has a positie coefficient in the objectie function. With respect to x, the second constraint is the most restrictie. hus, we substitute x using x = x. z = +.x 8x x 3 = 8 x + x x = x x = x he ariable x has a positie coefficient in the new objectie function, and now the first constraint is the most restrictie. We replace it by x = 8 x 3 + x and substitute x eerywhere else. z = 3.x 3.x x = 8 x 3 + x x = x x = 8 + x 3 x Now all coefficients are negatie, so the basic solution, with x = and x = 8, is optimal.

9. or the following network, with edge capacities as shown, find the maximum flow from to, along with a matching cut. 0 0 0 cut partitions the ertices of a graph into two disjoint subsets, say L and R. he capacity of a cut is the total capacity of the edges from L to R. cut is said to match a flow if the size of the flow is equal to the capacity of the cut. follows. ending a flow of oer the path (,,,, ), the residual graph is as 0 0 8 0 possible choice of the rest of the paths is shown below, along with the additional flow each path admits and the final residual graph that results from all this. Path low (,,,,, ) (,,,, ) (,,, ) (,,,,, ) ogether, the size of the flow is 3. matching cut can be found by taking for L the nodes that in the final residual graph can be reached from, i.e., L = {,, }. 9 3