CS3510 Design & Analysis of Algorithms Fall 2017 Section A. Test 3 Solutions. Instructor: Richard Peng In class, Wednesday, Nov 15, 2017

Similar documents
Solutions to assignment 3

CSC 373: Algorithm Design and Analysis Lecture 9

Graduate Algorithms CS F-18 Flow Networks

Bipartite Matching. Matching. Bipartite Matching. Maxflow Formulation

Maximum Flow. Flow Graph

1 The Network Flow Problem

Released Assessment Questions, 2017 QUESTIONS

Chapter Introduction. 2. Linear Combinations [4.1]

Jonathan Turner Exam 2-10/28/03

Fall 2014 David Wagner 10/31 Notes. The min-cut problem. Examples

5. Network flow. Network flow. Maximum flow problem. Ford-Fulkerson algorithm. Min-cost flow. Network flow 5-1

Lecture 2: Network Flow. c 14

4.8 Improper Integrals

Sph3u Practice Unit Test: Kinematics (Solutions) LoRusso

LAPLACE TRANSFORMS. 1. Basic transforms

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

A LOG IS AN EXPONENT.

Section P.1 Notes Page 1 Section P.1 Precalculus and Trigonometry Review

graph of unit step function t

ENGR 1990 Engineering Mathematics The Integral of a Function as a Function

e t dt e t dt = lim e t dt T (1 e T ) = 1

Problem Set If all directed edges in a network have distinct capacities, then there is a unique maximum flow.

Motion. Part 2: Constant Acceleration. Acceleration. October Lab Physics. Ms. Levine 1. Acceleration. Acceleration. Units for Acceleration.

The Covenant Renewed. Family Journal Page. creation; He tells us in the Bible.)

Bisimulation, Games & Hennessy Milner logic p.1/32

Randomized Perfect Bipartite Matching

ANSWERS TO EVEN NUMBERED EXERCISES IN CHAPTER 2

ALG 5.3 Flow Algorithms:

0 for t < 0 1 for t > 0

Admin MAX FLOW APPLICATIONS. Flow graph/networks. Flow constraints 4/30/13. CS lunch today Grading. in-flow = out-flow for every vertex (except s, t)

Matching. Slides designed by Kevin Wayne.

Max Flow, Min Cut COS 521. Kevin Wayne Fall Soviet Rail Network, Cuts. Minimum Cut Problem. Flow network.

Algorithmic Discrete Mathematics 6. Exercise Sheet

Flow networks. Flow Networks. A flow on a network. Flow networks. The maximum-flow problem. Introduction to Algorithms, Lecture 22 December 5, 2001

Graphs III - Network Flow

Today s topics. CSE 421 Algorithms. Problem Reduction Examples. Problem Reduction. Undirected Network Flow. Bipartite Matching. Problem Reductions

ALLOWABLE STRESS DESIGN FLOWCHART FOR AISC MANUAL OF STEEL CONSTRUCTION, NINTH EDITION APPENDIX B BEARING STIFFENERS AND TRANSVERSE STIFFENERS DESIGN

(b) 10 yr. (b) 13 m. 1.6 m s, m s m s (c) 13.1 s. 32. (a) 20.0 s (b) No, the minimum distance to stop = 1.00 km. 1.

two values, false and true used in mathematical logic, and to two voltage levels, LOW and HIGH used in switching circuits.

Transformations. Ordered set of numbers: (1,2,3,4) Example: (x,y,z) coordinates of pt in space. Vectors

Discussion Session 2 Constant Acceleration/Relative Motion Week 03

Section 5: Chain Rule

PHYSICS 1210 Exam 1 University of Wyoming 14 February points

Minimum Squared Error

Minimum Squared Error

Algorithm Design and Analysis

DC Miniature Solenoids KLM Varioline

Positive and negative solutions of a boundary value problem for a

Reminder: Flow Networks

1. Consider a PSA initially at rest in the beginning of the left-hand end of a long ISS corridor. Assume xo = 0 on the left end of the ISS corridor.

Main Reference: Sections in CLRS.

Flow Networks Alon Efrat Slides courtesy of Charles Leiserson with small changes by Carola Wenk. Flow networks. Flow networks CS 445

An integral having either an infinite limit of integration or an unbounded integrand is called improper. Here are two examples.

t s (half of the total time in the air) d?

Flow Networks. Ma/CS 6a. Class 14: Flow Exercises

The solution is often represented as a vector: 2xI + 4X2 + 2X3 + 4X4 + 2X5 = 4 2xI + 4X2 + 3X3 + 3X4 + 3X5 = 4. 3xI + 6X2 + 6X3 + 3X4 + 6X5 = 6.

Laplace Transform. Inverse Laplace Transform. e st f(t)dt. (2)

Network Flows: Introduction & Maximum Flow

Robust Network Coding for Bidirected Networks

4/12/12. Applications of the Maxflow Problem 7.5 Bipartite Matching. Bipartite Matching. Bipartite Matching. Bipartite matching: the flow network

Introduction to Congestion Games

Maximum Flow and Minimum Cut

Laplace Examples, Inverse, Rational Form

Soviet Rail Network, 1955

6/3/2009. CS 244 Algorithm Design Instructor: t Artur Czumaj. Lecture 8 Network flows. Maximum Flow and Minimum Cut. Minimum Cut Problem.

Math 2142 Exam 1 Review Problems. x 2 + f (0) 3! for the 3rd Taylor polynomial at x = 0. To calculate the various quantities:

f(x) dx with An integral having either an infinite limit of integration or an unbounded integrand is called improper. Here are two examples dx x x 2

1 Motivation and Basic Definitions

EECE 301 Signals & Systems Prof. Mark Fowler

Exponential Sawtooth

Average & instantaneous velocity and acceleration Motion with constant acceleration

5.1-The Initial-Value Problems For Ordinary Differential Equations

More on Magnetically C Coupled Coils and Ideal Transformers

can be viewed as a generalized product, and one for which the product of f and g. That is, does

Mathematics 805 Final Examination Answers

Some Inequalities variations on a common theme Lecture I, UL 2007

CS 491G Combinatorial Optimization Lecture Notes

Chapter 9 - The Laplace Transform

Greedy. I Divide and Conquer. I Dynamic Programming. I Network Flows. Network Flow. I Previous topics: design techniques

Addition & Subtraction of Polynomials

1.0 Electrical Systems

The Residual Graph. 12 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm

ON DIFFERENTIATION OF A LEBESGUE INTEGRAL WITH RESPECT TO A PARAMETER

Contraction Mapping Principle Approach to Differential Equations

September 20 Homework Solutions

And I Saw a New Heaven

ON THE DEGREES OF RATIONAL KNOTS

Physic 231 Lecture 4. Mi it ftd l t. Main points of today s lecture: Example: addition of velocities Trajectories of objects in 2 = =

SOME USEFUL MATHEMATICS

Algorithms and Data Structures 2011/12 Week 9 Solutions (Tues 15th - Fri 18th Nov)

Selfish Routing. Tim Roughgarden Cornell University. Includes joint work with Éva Tardos

Review for the Midterm Exam.

Algorithm Design and Analysis

8.1. a) For step response, M input is u ( t) Taking inverse Laplace transform. as α 0. Ideal response, K c. = Kc Mτ D + For ramp response, 8-1

The Residual Graph. 11 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm

MTH 146 Class 11 Notes

Properties of Logarithms. Solving Exponential and Logarithmic Equations. Properties of Logarithms. Properties of Logarithms. ( x)

Brock University Physics 1P21/1P91 Fall 2013 Dr. D Agostino. Solutions for Tutorial 3: Chapter 2, Motion in One Dimension

Some basic notation and terminology. Deterministic Finite Automata. COMP218: Decision, Computation and Language Note 1

Amit Mehra. Indian School of Business, Hyderabad, INDIA Vijay Mookerjee

Transcription:

Uer ID (NOT he 9 igi numer): gurell4 CS351 Deign & Anlyi of Algorihm Fll 17 Seion A Te 3 Soluion Inruor: Rihr Peng In l, Weney, Nov 15, 17 Do no open hi quiz ookle unil you re iree o o o. Re ll he inruion fir. You hve 7 minue o ern up o 6 poin, he e i gre ou of 5. Wrie your nme n uer i ( inie on T-qure) on he op of every pge Thi ookle onin 3 queion on 6 pge, inluing hi one. You n ue he k of he pge for rh work. Wrie your oluion in he pe provie. If you run ou of pe, oninue your nwer on he k of he me hee n mke noion on he fron of he hee. You my ue hee wih noe on oh ie. You my ue lulor, u no ny evie wih rnmiing funion, epeilly one h n e he wirele or he Inerne. You my ue ny of he heorem/f/lemm/lgorihm/home-work h we overe in l wihou re-proving hem unle expliily e oherwie. If neery mke reonle umpion u plee e ure o e hem lerly When we k you o give n lgorihm in hi e, erie your lgorihm in Englih or peuooe, n provie hor rgumen for orrene n running ime. You o no nee o provie igrm or exmple unle i help mke your explnion lerer. Do no pen oo muh ime on ny one prolem. Generlly, wie prolem poin vlue i n iniion of how mny minue o pen on i. Goo luk! Prolem Tile Poin Pr Gre Iniil of Grer Nme & ID on op of every pge 1 1 1 Formuling Liner Progrm 9 1 The For-Fulkeron Algorihm 1 3 3 Spor Eliminion 6 Tol 5 1

Uer ID (NOT he 9 igi numer): gurell4 ( /1 poin) Wrie your nme n uer i on op of every pge. 1. ( /9 poin) Formuling Liner Progrm An oil refinery h wo oure of rue oil: ligh rue h o $35/rrel hevy rue h o $3/rrel The refinery proue goline, heing oil, n je fuel from rue in he following moun: eh rrel of ligh rue proue.3 rrel of goline,. rrel of heing oil, n.3 rrel of je fuel. eh rrel of hevy rue proue.3 rrel of goline,.4 rrel of heing oil, n. rrel of je fuel. (noe h hee numer on up o 1 ue o proeing ineffiienie) The refinery nee o upply: 9, rrel of goline 8, rrel of heing oil 5, rrel of je fuel n wn o minimize he ol o purhing o of he wo ype of rue oil. Formule he prolem of fining he moun of ligh n hevy rue o purhe o o e le o mee i oligion minimum o. You my ue ny ype of vrile / onrin / ojeive, long hey re liner. Noe h he moun of rrel ough n e negive (here i no exiing orge o ell), n you n exee he moun onre. Le x 1 n x e he moun of ligh n hevy rue ough repeively. The LP i: min 35x 1 + 3x uje o:.3x 1 +.3x 9.x 1 +.4x 8.3x 1 +.x 5 x 1, x

Uer ID (NOT he 9 igi numer): gurell4 Alerne oluion: we n ree 6 more vrile, g 1, h 1, j 1 for he moun of goline, heing oil, n jefuel oming from hevy rue, n g, h, j for he moun of goline, heing oil, n jefuel oming from ligh rue. Then we ge he progrm min 35x 1 + 3x uje o: g 1 + g 9 h 1 + h 8 j 1 + j 5 g 1.3x 1 h 1.x 1 j 1.3x 1 g.3x h.4x j.x x 1, x There re ome flexiiliie wih he g i, h i, n j i onrin: hem eing i no neery, n heir inerion wih x i n e equliy (e.g. g 1 =.3x 1 ). 1 poin eh for: () wo vrile, one for eh moun proue () o funion () vrile eing non-negive. poin eh for he hree onrin, 1 per iue in hem. If he progrm omie he ie h pr of prou my e from hevy rue, pr from ligh rue, poin. If he requiremen inequlie re e o =, (e.g. nee o proue exly hi muh goline), 1 poin. 3

Uer ID (NOT he 9 igi numer): gurell4. ( /1 poin) The For-Fulkeron Algorihm Conier he mximum flow on he following grph G wih piie on ege. 1 5 3 7 8 1 long wih he flow f: whih i wh hppen fer rouing uni of flow long he ph. () ( /3 poin) give he reiul grph hi poin (G f ): 4

Uer ID (NOT he 9 igi numer): gurell4 () (.5 per ege ifferene. Cpiie on ege of reiul grph re ignore, only he ireion/exiene of ege re mrke. /3) Your reiul grph from pr ) houl mi he ph. Conier rouing uni of flow long hi ph, in iion o he flow f peifie he r of hi prolem. Give he reuling flow, n he upe reiul grph (eprely). flow: reiul grph:.5 per ege ifferene, for up o 1.5 poin per pr. Cpiie on ege of reiul grph re ignore, only he ireion/exiene of ege re mrke. () ( /4 poin) provie mximum flow n minimum u on hi grph. Mke ure o peify he u vi e of verie. 5

Uer ID (NOT he 9 igi numer): gurell4 A flow of vlue 7 i: 4 3 5 5 A u wih piy 7 i given y {S,, }. 6

Uer ID (NOT he 9 igi numer): gurell4 3. ( /6 poin) Spor Eliminion Conier he following iuion in por ournmen involving n em, numere 1... n: () Eh em lrey h x i win. () There i li of m gme o e plye eween hee em, eh hving he vlue {i, j} for ome em 1 i < j n. For impliiy, ume h eh pir of em hve mo 1 gme lef, o m O(n ). We wn o hek wheher noher em, whih oul poily ge up o z win, n ill win he ournmen. Th i, we wn o know wheher here exi n ouome of he remining m gme o h no em win more hn z x i gme. Of oure, hi men we nee o hve z x i for every i. For exmple, if em,, n hve, 1, n 1 win repeively, n here re hree gme lef eween,, n, hen i poile for eh of hem o hve mo 3 win: em oul loe ll of i remining gme, n em oul win he gme eween, reuling in, 3, n win repeively. () ( /3 poin) By uing eiher mximum flow or mhing in lk-ox mnner (you o no nee o give eil of hoe lgorihm), give n O(n 1 ) ime lgorihm o eermine wheher i poile for ll em o finih wih mo z win. Conru nework wih verie Super oure uper ink verie for gme V gme = {g 1... g m } verie for em V em = { 1... n }. Then we pie ege: For eh gme g j, n ege from o g j wih piy 1. For eh em i, n ege from i o wih piy z x i. For eh gme g j, involving em i1 n i, ege from g j o i1 n i wih infinie piie. A flow on hi nework orrepon igning gme o one of he em involve. So long we n roue ll m uni of flow, here i wy o ign he gme o h eh em oe no ge oo mny win. There i lo noher oluion h ju ege eween he em verie. Th oluion lo reeive full poin. 7

Uer ID (NOT he 9 igi numer): gurell4 () ( /3 poin) Show (uing eiher he mxflow-minu heorem, or Hll heorem) h houl i e impoile for ll em o finih wih mo z win, here exi ue of em S em o h he numer of gme lef o e plye eween hem i more hn (z x i ), i S em k. he ol numer of win h hee em oul hve wih none of hem going over z. Coninuing wih he exmple from pr ), i no poile for ll em o hve mo win eue he ol numer of win eween hem i le + 1 + 1 + 3 = 7 whih verge ou o.333... >. By he mx-flow min-u heorem, uh n ignmen i no poile only if here i u S in he grph peifie in pr ) whoe piy i le hn m. The oure verex i in S, n le i inereion wih he gme / em verie e S gme n S em repeively. A ll ege leving he gme verie hve infinie piy, he only ege leving S gme mu e o S em. Ak. he gme elee in S g me mu only e eween em in S em. The ize of hi u i (z x i ) + V gme \ S gme = (z x i ) + r S gme. i S em i S em For hi o e le hn r, we mu hve i S em (z x i ) < S gme, whih men h here re le hi mny gme lef o e plye eween he em in S em. 1 poin for giving he orre e from S. 1 poin for ing no ege leve S gme. 1 poin for eriving he finl oun. 8