Wrap up: Weighted, directed graph shortest path Minimum Spanning Tree. Feb 25, 2019 CSCI211 - Sprenkle

Size: px
Start display at page:

Download "Wrap up: Weighted, directed graph shortest path Minimum Spanning Tree. Feb 25, 2019 CSCI211 - Sprenkle"

Transcription

1 Objecive Wrap up: Weighed, direced graph hore pah Minimum Spanning Tree eb, 1 SI - Sprenkle 1 Review Wha are greedy algorihm? Wha i our emplae for olving hem? Review he la problem we were working on: Single-ource, weighed-graph hore pah Ø Wha wa our approach o olving he problem? eb, 1 SI - Sprenkle 1

2 Review: Shore Pah Problem Given Ø ireced graph G = (V, ) Ø Source, deinaion Ø Lengh! e = lengh of edge e (non-negaive) Shore pah problem: find hore direced pah from o 3 o of pah ---- = = 48 eb, 1 SI - Sprenkle 3 Wha wa our raegy? 1 co of pah = um of edge co in pah Review: ijkra lgorihm 1. Mainain a e of explored node S Ø Keep he hore pah diance d(u) from o u. Iniialize S={}, d()=, u, d(u)= 3. Repeaedly chooe unexplored node v which imize π ( v) = d( u) + e, Ø dd v o S and e d(v) = p(v) S d(u) u! e e = ( u, v) : u S v hore pah o (ome u in explored par followed by a ingle edge (u, v)) Implemenaion Idea Wha o repreen? How o repreen? eb, 1 SI - Sprenkle 4

3 ijkra Shore Pah lgorihm ind hore pah from o 4 1 eb, 1 SI - Sprenkle ijkra Shore Pah lgorihm S = { } PQ = {,,,,,,, } Iniialize diance o all node o infiniy 4 1 diance label eb, 1 SI - Sprenkle 3

4 ijkra Shore Pah lgorihm S = { } PQ = {,,,,,,, } elee 4 1 diance label eb, 1 SI - Sprenkle 7 ijkra Shore Pah lgorihm S = { } PQ = {,,,,,, } ecreae key xplored Se dd node o explored e X Updae diance o node i poin o 4 X 1 diance label X eb, 1 SI - Sprenkle 8 4

5 ijkra Shore Pah lgorihm S = { } PQ = {,,,,,, } ecreae key Updae PQ baed on he diance xplored Se X 4 1 diance label X eb, 1 SI - Sprenkle ijkra Shore Pah lgorihm S = { } PQ = {,,,,,, } elee xplored Se Selec node wih imum lengh from explored e (from PQ) 4 X 1 diance label X eb, 1 SI - Sprenkle 1

6 ijkra Shore Pah lgorihm S = {, } PQ = {,,,,, } elee xplored Se dd node o explored e 4 X 1 diance label X eb, 1 SI - Sprenkle ijkra Shore Pah lgorihm xplored Se S = {, } PQ = {,,,,, } Updae diance o node ha poin o, if maller 4 ecreae key X 33 1 eb, 1 SI - Sprenkle 1

7 ijkra Shore Pah lgorihm xplored Se S = {, } PQ = {,,,,, } elee he imum node from PQ, dd i o S elee 4 X 33 1 eb, 1 SI - Sprenkle 13 ijkra Shore Pah lgorihm S = {,, } PQ = {,,,, } dd o S 33 elee X 4 1 eb, 1 SI - Sprenkle 7

8 ijkra Shore Pah lgorihm S = {,, } PQ = {,,,, } Updae diance o node poin o, if maller X X 1 eb, 1 SI - Sprenkle ijkra Shore Pah lgorihm S = {,, } PQ = {,,,, } Remove from PQ elee eb, 1 SI - Sprenkle 8

9 ijkra Shore Pah lgorihm S = {,,, } PQ = {,,, } dd o S, Updae diance o node X elee X eb, 1 SI - Sprenkle 17 ijkra Shore Pah lgorihm S = {,,, } PQ = {,,, } elee from PQ 4 X 3 elee 3 1 X eb, 1 SI - Sprenkle

10 ijkra Shore Pah lgorihm S = {,,,, } PQ = {,, } dd o S, Updae diance o node 3 X 34 4 elee X eb, 1 SI - Sprenkle 1 ijkra Shore Pah lgorihm S = {,,,, } PQ = {,, } elee elee 1 eb, 1 SI - Sprenkle 3 1

11 ijkra Shore Pah lgorihm S = {,,,,, } PQ = {, } dd o S, Updae diance o node 4 4 X 34 1 elee 1 X eb, 1 SI - Sprenkle 1 3 ijkra Shore Pah lgorihm S = {,,,,, } PQ = {, } elee elee X eb, 1 SI - Sprenkle

12 ijkra Shore Pah lgorihm S = {,,,,,, } PQ = { } dd o S, Updae diance o node X eb, 1 SI - Sprenkle 3 ijkra Shore Pah lgorihm S = {,,,,,, } PQ = { } elee eb, 1 SI - Sprenkle 4 1

13 ijkra Shore Pah lgorihm S = {,,,,,,, } PQ = { } dd o S, Updae diance o node elee eb, 1 SI - Sprenkle ijkra Shore Pah lgorihm S = {,,,,,,, } PQ = { } eb, 1 SI - Sprenkle 13

14 ijkra' lgorihm: Proof of orrecne Invarian. or each node u Î S, d(u) i he lengh of he hore -u pah Pf. (by inducion on S ) ae cae: S =1 Inducive hypohei? Nex ep? eb, 1 SI - Sprenkle 7 ijkra' lgorihm: Proof of orrecne Prove: or each node u Î S, d(u) i he lengh of he hore -u pah Pf. (by inducion on S ) ae cae: or S = 1, S={}; d() = Inducive hypohei: ume rue for S = k, k ³ 1 Proof: Ø Grow S o k+1 Ø Greedy: dd node v by u v Ø Wha do we know abou u? Ø Why didn Greedy pick y a he nex node? Ø Wha can we ay abou all oher v pah? S P' u x Greedy P v y eb, 1 SI - Sprenkle 8

15 ijkra' lgorihm: Proof of orrecne Prove: or each node u Î S, d(u) i he lengh of he hore -u pah Pf. (by inducion on S ) Inducive hypohei: ume rue for S = k, k ³ 1 Proof: Ø Le v be he nex node added o S by Greedy, and le uàv be he choen edge Ø The hore àu pah plu uàv i an àv pah of lengh p(v) Ø onider any àv pah P. I' no horer han p(v). Ø Le xày be he fir edge in P ha leave S, and le P' be he ubpah o x. Ø P i already oo long a oon a i leave S. In erm of inequaliie:! (P) ³! (P') +! (x,y) = d(x) +! (x, y) ³ p(y) ³ p(v) nonnegaive weigh inducive hypohei defn of p(y) ijkra choe v inead of y eb, 1 SI - Sprenkle S P' u x Greedy P v y icuion: ijra lgorihm Why doe he algorihm break down if we allow negaive weigh/co on edge? eb, 1 SI - Sprenkle

16 ijkra lgorihm: nalyi 1. Mainain a e of explored node S Ø Know he hore pah diance d(u) from o u. Iniialize S={}, d()=, u, d(u)= 3. Repeaedly chooe unexplored node v which imize π ( v) = d( u) + e, Ø dd v o S and e d(v) = p(v) S d(u) u! e e = ( u, v) : u S v hore pah o ome u in explored par, followed by a ingle edge (u, v) Running ime? Implemenaion? aa rucure? eb, 1 SI - Sprenkle 31 ijkra lgorihm: nalyi 1. Mainain a e of explored node S Ø Keep he hore pah diance d(u) from o u. Iniialize S={}, d()=, u, d(u)= 3. Repeaedly chooe unexplored node v which imize π ( v) = d( u) + e, Ø dd v o S and e d(v) = p(v) PQ Operaion RT of Op # in ijkra Iner xracmin hangekey Impy e = ( u, v) : u S hore pah o ome u in explored par, followed by a ingle edge (u, v) How long doe each operaion ake? How many of each operaion? Toal eb, 1 SI - Sprenkle 3

17 ijkra lgorihm: Implemenaion or each unexplored node, explicily mainain π(v) = d(u) + e. e = (u,v) : u S Ø Nex node o explore = node wih imum p(v). Ø When exploring v, for each inciden edge e = (v, w), updae π(w) = { π(w), π(v)+ e }. fficien implemenaion. Mainain a prioriy queue of unexplored node, prioriized by p(v) PQ Operaion RT of Op # Prioriy in ijkra Queue Iner log n n xracmin log n n hangekey log n m Impy 1 n Toal eb, 1 SI - Sprenkle 33 ijkra lgorihm: Implemenaion or each unexplored node, explicily mainain π(v) = d(u) + e. e = (u,v) : u S Ø Nex node o explore = node wih imum p(v). Ø When exploring v, for each inciden edge e = (v, w), updae π(w) = { π(w), π(v)+ e }. fficien implemenaion. Mainain a prioriy queue of unexplored node, prioriized by p(v) PQ Operaion RT of Op # Prioriy in ijkra Queue Iner log n n xracmin log n n hangekey log n m Impy 1 n O(m log n) Toal m log n eb, 1 SI - Sprenkle 34 17

18 Laying able omca wan o lay cable in a neighborhood Ø Reach all houe Ø Lea co Neighborhood Layou o of laying cable bw houe depend on amoun of cable, landcaping, obacle, ec Wha ype of graph? eb, 1 SI - Sprenkle 3 Minimum Spanning Tree (MST) Spanning ree: pan all node in graph Given a conneced graph G = (V, ) wih poiive edge weigh c e, an MST i a ube of he edge T Í uch ha T i a panning ree whoe um of edge weigh i imized T, S G = (V, ) eît c e = eb, 1 SI - Sprenkle 3

19 Looking ahead Wiki oday: haper 4 (fron maer), 4.1, 4., 4.4 PS due riday eb, 1 SI - Sprenkle 37 1

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

Max Flow, Min Cut COS 521. Kevin Wayne Fall Soviet Rail Network, Cuts. Minimum Cut Problem. Flow network. Sovie Rail Nework, Max Flow, Min u OS Kevin Wayne Fall Reference: On he hiory of he ranporaion and maximum flow problem. lexander Schrijver in Mah Programming, :,. Minimum u Problem u Flow nework.! Digraph

More information

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)

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) /0/ dmin lunch oday rading MX LOW PPLIION 0, pring avid Kauchak low graph/nework low nework direced, weighed graph (V, ) poiive edge weigh indicaing he capaciy (generally, aume ineger) conain a ingle ource

More information

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

The Residual Graph. 12 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm Augmening Pah Algorihm Greedy-algorihm: ar wih f (e) = everywhere find an - pah wih f (e) < c(e) on every edge augmen flow along he pah repea a long a poible The Reidual Graph From he graph G = (V, E,

More information

Basic Tools CMSC 641. Running Time. Problem. Problem. Algorithmic Design Paradigms. lg (n!) (lg n)! (lg n) lgn n.2

Basic Tools CMSC 641. Running Time. Problem. Problem. Algorithmic Design Paradigms. lg (n!) (lg n)! (lg n) lgn n.2 Baic Tool CMSC April, Review Aympoic Noaion Order of Growh Recurrence relaion Daa Srucure Li, Heap, Graph, Tree, Balanced Tree, Hah Table Advanced daa rucure: Binomial Heap, Fibonacci Heap Soring Mehod

More information

Warm Up. Correct order: s,u,v,y,x,w,t

Warm Up. Correct order: s,u,v,y,x,w,t Warm Up Rn Breadh Fir Search on hi graph aring from. Wha order are erice placed on he qee? When proceing a erex iner neighbor in alphabeical order. In a direced graph, BFS only follow an edge in he direcion

More information

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

The Residual Graph. 11 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm Augmening Pah Algorihm Greedy-algorihm: ar wih f (e) = everywhere find an - pah wih f (e) < c(e) on every edge augmen flow along he pah repea a long a poible The Reidual Graph From he graph G = (V, E,

More information

Introduction to Congestion Games

Introduction to Congestion Games Algorihmic Game Theory, Summer 2017 Inroducion o Congeion Game Lecure 1 (5 page) Inrucor: Thoma Keelheim In hi lecure, we ge o know congeion game, which will be our running example for many concep in game

More information

Network Flows UPCOPENCOURSEWARE number 34414

Network Flows UPCOPENCOURSEWARE number 34414 Nework Flow UPCOPENCOURSEWARE number Topic : F.-Javier Heredia Thi work i licened under he Creaive Common Aribuion- NonCommercial-NoDeriv. Unpored Licene. To view a copy of hi licene, vii hp://creaivecommon.org/licene/by-nc-nd/./

More information

! Abstraction for material flowing through the edges. ! G = (V, E) = directed graph, no parallel edges.

! Abstraction for material flowing through the edges. ! G = (V, E) = directed graph, no parallel edges. Sovie Rail Nework, haper Nework Flow Slide by Kevin Wayne. opyrigh Pearon-ddion Weley. ll righ reerved. Reference: On he hiory of he ranporaion and maximum flow problem. lexander Schrijver in Mah Programming,

More information

Today: Max Flow Proofs

Today: Max Flow Proofs Today: Max Flow Proof COSC 58, Algorihm March 4, 04 Many of hee lide are adaped from everal online ource Reading Aignmen Today cla: Chaper 6 Reading aignmen for nex cla: Chaper 7 (Amorized analyi) In-Cla

More information

Maximum Flow and Minimum Cut

Maximum Flow and Minimum Cut // Sovie Rail Nework, Maximum Flow and Minimum Cu Max flow and min cu. Two very rich algorihmic problem. Cornerone problem in combinaorial opimizaion. Beauiful mahemaical dualiy. Nework Flow Flow nework.

More information

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

Problem Set If all directed edges in a network have distinct capacities, then there is a unique maximum flow. CSE 202: Deign and Analyi of Algorihm Winer 2013 Problem Se 3 Inrucor: Kamalika Chaudhuri Due on: Tue. Feb 26, 2013 Inrucion For your proof, you may ue any lower bound, algorihm or daa rucure from he ex

More information

Maximum Flow in Planar Graphs

Maximum Flow in Planar Graphs Maximum Flow in Planar Graph Planar Graph and i Dual Dualiy i defined for direced planar graph a well Minimum - cu in undireced planar graph An - cu (undireced graph) An - cu The dual o he cu Cu/Cycle

More information

Soviet Rail Network, 1955

Soviet Rail Network, 1955 7.1 Nework Flow Sovie Rail Nework, 19 Reerence: On he hiory o he ranporaion and maximum low problem. lexander Schrijver in Mah Programming, 91: 3, 00. (See Exernal Link ) Maximum Flow and Minimum Cu Max

More information

MAXIMUM FLOW. introduction Ford-Fulkerson algorithm maxflow-mincut theorem

MAXIMUM FLOW. introduction Ford-Fulkerson algorithm maxflow-mincut theorem MAXIMUM FLOW inroducion Ford-Fulkeron algorihm maxflow-mincu heorem Mincu problem Inpu. An edge-weighed digraph, ource verex, and arge verex. each edge ha a poiive capaciy capaciy 9 10 4 15 15 10 5 8 10

More information

Algorithmic Discrete Mathematics 6. Exercise Sheet

Algorithmic Discrete Mathematics 6. Exercise Sheet Algorihmic Dicree Mahemaic. Exercie Shee Deparmen of Mahemaic SS 0 PD Dr. Ulf Lorenz 7. and 8. Juni 0 Dipl.-Mah. David Meffer Verion of June, 0 Groupwork Exercie G (Heap-Sor) Ue Heap-Sor wih a min-heap

More information

Network Flows: Introduction & Maximum Flow

Network Flows: Introduction & Maximum Flow CSC 373 - lgorihm Deign, nalyi, and Complexiy Summer 2016 Lalla Mouaadid Nework Flow: Inroducion & Maximum Flow We now urn our aenion o anoher powerful algorihmic echnique: Local Search. In a local earch

More information

Soviet Rail Network, 1955

Soviet Rail Network, 1955 Sovie Rail Nework, 1 Reference: On he hiory of he ranporaion and maximum flow problem. Alexander Schrijver in Mah Programming, 1: 3,. Maximum Flow and Minimum Cu Max flow and min cu. Two very rich algorihmic

More information

Notes for Lecture 17-18

Notes for Lecture 17-18 U.C. Berkeley CS278: Compuaional Complexiy Handou N7-8 Professor Luca Trevisan April 3-8, 2008 Noes for Lecure 7-8 In hese wo lecures we prove he firs half of he PCP Theorem, he Amplificaion Lemma, up

More information

CSE 521: Design & Analysis of Algorithms I

CSE 521: Design & Analysis of Algorithms I CSE 52: Deign & Analyi of Algorihm I Nework Flow Paul Beame Biparie Maching Given: A biparie graph G=(V,E) M E i a maching in G iff no wo edge in M hare a verex Goal: Find a maching M in G of maximum poible

More information

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

Flow networks. Flow Networks. A flow on a network. Flow networks. The maximum-flow problem. Introduction to Algorithms, Lecture 22 December 5, 2001 CS 545 Flow Nework lon Efra Slide courey of Charle Leieron wih mall change by Carola Wenk Flow nework Definiion. flow nework i a direced graph G = (V, E) wih wo diinguihed verice: a ource and a ink. Each

More information

Main Reference: Sections in CLRS.

Main Reference: Sections in CLRS. Maximum Flow Reied 09/09/200 Main Reference: Secion 26.-26. in CLRS. Inroducion Definiion Muli-Source Muli-Sink The Ford-Fulkeron Mehod Reidual Nework Augmening Pah The Max-Flow Min-Cu Theorem The Edmond-Karp

More information

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1 Conider he following flow nework CS444/944 Analyi of Algorihm II Soluion for Aignmen (0 mark) In he following nework a minimum cu ha capaciy 0 Eiher prove ha hi aemen i rue, or how ha i i fale Uing he

More information

18 Extensions of Maximum Flow

18 Extensions of Maximum Flow Who are you?" aid Lunkwill, riing angrily from hi ea. Wha do you wan?" I am Majikhie!" announced he older one. And I demand ha I am Vroomfondel!" houed he younger one. Majikhie urned on Vroomfondel. I

More information

Randomized Perfect Bipartite Matching

Randomized Perfect Bipartite Matching Inenive Algorihm Lecure 24 Randomized Perfec Biparie Maching Lecurer: Daniel A. Spielman April 9, 208 24. Inroducion We explain a randomized algorihm by Ahih Goel, Michael Kapralov and Sanjeev Khanna for

More information

Please Complete Course Survey. CMPSCI 311: Introduction to Algorithms. Approximation Algorithms. Coping With NP-Completeness. Greedy Vertex Cover

Please Complete Course Survey. CMPSCI 311: Introduction to Algorithms. Approximation Algorithms. Coping With NP-Completeness. Greedy Vertex Cover Pleae Complee Coure Survey CMPSCI : Inroducion o Algorihm Dealing wih NP-Compleene Dan Sheldon hp: //owl.oi.uma.edu/parner/coureevalsurvey/uma/ Univeriy of Maachue Slide Adaped from Kevin Wayne La Compiled:

More information

Ground Rules. PC1221 Fundamentals of Physics I. Kinematics. Position. Lectures 3 and 4 Motion in One Dimension. A/Prof Tay Seng Chuan

Ground Rules. PC1221 Fundamentals of Physics I. Kinematics. Position. Lectures 3 and 4 Motion in One Dimension. A/Prof Tay Seng Chuan Ground Rules PC11 Fundamenals of Physics I Lecures 3 and 4 Moion in One Dimension A/Prof Tay Seng Chuan 1 Swich off your handphone and pager Swich off your lapop compuer and keep i No alking while lecure

More information

Graphs III - Network Flow

Graphs III - Network Flow Graph III - Nework Flow Flow nework eup graph G=(V,E) edge capaciy w(u,v) 0 - if edge doe no exi, hen w(u,v)=0 pecial verice: ource verex ; ink verex - no edge ino and no edge ou of Aume every verex v

More information

CS 473G Lecture 15: Max-Flow Algorithms and Applications Fall 2005

CS 473G Lecture 15: Max-Flow Algorithms and Applications Fall 2005 CS 473G Lecure 1: Max-Flow Algorihm and Applicaion Fall 200 1 Max-Flow Algorihm and Applicaion (November 1) 1.1 Recap Fix a direced graph G = (V, E) ha doe no conain boh an edge u v and i reveral v u,

More information

Discussion Session 2 Constant Acceleration/Relative Motion Week 03

Discussion Session 2 Constant Acceleration/Relative Motion Week 03 PHYS 100 Dicuion Seion Conan Acceleraion/Relaive Moion Week 03 The Plan Today you will work wih your group explore he idea of reference frame (i.e. relaive moion) and moion wih conan acceleraion. You ll

More information

Matching. Slides designed by Kevin Wayne.

Matching. Slides designed by Kevin Wayne. Maching Maching. Inpu: undireced graph G = (V, E). M E i a maching if each node appear in a mo edge in M. Max maching: find a max cardinaliy maching. Slide deigned by Kevin Wayne. Biparie Maching Biparie

More information

Network flows. The problem. c : V V! R + 0 [ f+1g. flow network G = (V, E, c), a source s and a sink t uv not in E implies c(u, v) = 0

Network flows. The problem. c : V V! R + 0 [ f+1g. flow network G = (V, E, c), a source s and a sink t uv not in E implies c(u, v) = 0 Nework flow The problem Seing flow nework G = (V, E, c), a orce and a ink no in E implie c(, ) = 0 Flow from o capaciy conrain kew-ymmery flow-coneraion ale of he flow jfj = P 2V Find a maximm flow from

More information

1 Motivation and Basic Definitions

1 Motivation and Basic Definitions CSCE : Deign and Analyi of Algorihm Noe on Max Flow Fall 20 (Baed on he preenaion in Chaper 26 of Inroducion o Algorihm, 3rd Ed. by Cormen, Leieron, Rive and Sein.) Moivaion and Baic Definiion Conider

More information

EECE 301 Signals & Systems Prof. Mark Fowler

EECE 301 Signals & Systems Prof. Mark Fowler EECE 31 Signal & Syem Prof. Mark Fowler Noe Se #27 C-T Syem: Laplace Tranform Power Tool for yem analyi Reading Aignmen: Secion 6.1 6.3 of Kamen and Heck 1/18 Coure Flow Diagram The arrow here how concepual

More information

24 Single-Source Shortest Paths

24 Single-Source Shortest Paths Single-Source Shore Pah Profeor Parick wihe o find he hore poible roue from Phoeni o Indianapoli. Given a road map of he Unied Sae on which he diance beween each pair of adjacen inerecion i marked, how

More information

Welcome Back to Physics 215!

Welcome Back to Physics 215! Welcome Back o Physics 215! (General Physics I) Thurs. Jan 19 h, 2017 Lecure01-2 1 Las ime: Syllabus Unis and dimensional analysis Today: Displacemen, velociy, acceleraion graphs Nex ime: More acceleraion

More information

16 Max-Flow Algorithms and Applications

16 Max-Flow Algorithms and Applications Algorihm A proce canno be underood by opping i. Underanding mu move wih he flow of he proce, mu join i and flow wih i. The Fir Law of Mena, in Frank Herber Dune (196) There a difference beween knowing

More information

Linear Motion, Speed & Velocity

Linear Motion, Speed & Velocity Add Iporan Linear Moion, Speed & Velociy Page: 136 Linear Moion, Speed & Velociy NGSS Sandard: N/A MA Curriculu Fraework (2006): 1.1, 1.2 AP Phyic 1 Learning Objecive: 3.A.1.1, 3.A.1.3 Knowledge/Underanding

More information

Dynamic Programming 11/8/2009. Weighted Interval Scheduling. Weighted Interval Scheduling. Unweighted Interval Scheduling: Review

Dynamic Programming 11/8/2009. Weighted Interval Scheduling. Weighted Interval Scheduling. Unweighted Interval Scheduling: Review //9 Algorihms Dynamic Programming - Weighed Ineral Scheduling Dynamic Programming Weighed ineral scheduling problem. Insance A se of n jobs. Job j sars a s j, finishes a f j, and has weigh or alue j. Two

More information

CMU-Q Lecture 3: Search algorithms: Informed. Teacher: Gianni A. Di Caro

CMU-Q Lecture 3: Search algorithms: Informed. Teacher: Gianni A. Di Caro CMU-Q 5-38 Lecure 3: Search algorihms: Informed Teacher: Gianni A. Di Caro UNINFORMED VS. INFORMED SEARCH Sraegy How desirable is o be in a cerain inermediae sae for he sake of (effecively) reaching a

More information

2.1: What is physics? Ch02: Motion along a straight line. 2.2: Motion. 2.3: Position, Displacement, Distance

2.1: What is physics? Ch02: Motion along a straight line. 2.2: Motion. 2.3: Position, Displacement, Distance Ch: Moion along a sraigh line Moion Posiion and Displacemen Average Velociy and Average Speed Insananeous Velociy and Speed Acceleraion Consan Acceleraion: A Special Case Anoher Look a Consan Acceleraion

More information

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright Pearson-Addison Wesley. All rights reserved. 4 4.1 Interval Scheduling Interval Scheduling Interval scheduling. Job j starts at s j and finishes

More information

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

6/3/2009. CS 244 Algorithm Design Instructor: t Artur Czumaj. Lecture 8 Network flows. Maximum Flow and Minimum Cut. Minimum Cut Problem. Maximum Flow and Minimum Cu CS lgorihm Deign Inrucor: rur Czumaj Lecure Nework Max and min cu. Two very rich algorihmic problem. Cornerone problem in combinaorial opimizaion. Beauiful mahemaical dualiy.

More information

Math 2214 Solution Test 1 B Spring 2016

Math 2214 Solution Test 1 B Spring 2016 Mah 14 Soluion Te 1 B Spring 016 Problem 1: Ue eparaion of ariable o ole he Iniial alue DE Soluion (14p) e =, (0) = 0 d = e e d e d = o = ln e d uing u-du b leing u = e 1 e = + where C = for he iniial

More information

KINEMATICS IN ONE DIMENSION

KINEMATICS IN ONE DIMENSION KINEMATICS IN ONE DIMENSION PREVIEW Kinemaics is he sudy of how hings move how far (disance and displacemen), how fas (speed and velociy), and how fas ha how fas changes (acceleraion). We say ha an objec

More information

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

Algorithms and Data Structures 2011/12 Week 9 Solutions (Tues 15th - Fri 18th Nov) Algorihm and Daa Srucure 2011/ Week Soluion (Tue 15h - Fri 18h No) 1. Queion: e are gien 11/16 / 15/20 8/13 0/ 1/ / 11/1 / / To queion: (a) Find a pair of ube X, Y V uch ha f(x, Y) = f(v X, Y). (b) Find

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorihm Deign and Analyi LECTURES 17 Nework Flow Dualiy of Max Flow and Min Cu Algorihm: Ford-Fulkeron Capaciy Scaling Sofya Rakhodnikova S. Rakhodnikova; baed on lide by E. Demaine, C. Leieron, A. Smih,

More information

Math 2214 Solution Test 1A Spring 2016

Math 2214 Solution Test 1A Spring 2016 Mah 14 Soluion Tes 1A Spring 016 sec Problem 1: Wha is he larges -inerval for which ( 4) = has a guaraneed + unique soluion for iniial value (-1) = 3 according o he Exisence Uniqueness Theorem? Soluion

More information

Constant Acceleration

Constant Acceleration Objecive Consan Acceleraion To deermine he acceleraion of objecs moving along a sraigh line wih consan acceleraion. Inroducion The posiion y of a paricle moving along a sraigh line wih a consan acceleraion

More information

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

Greedy. I Divide and Conquer. I Dynamic Programming. I Network Flows. Network Flow. I Previous topics: design techniques Algorihm Deign Technique CS : Nework Flow Dan Sheldon April, reedy Divide and Conquer Dynamic Programming Nework Flow Comparion Nework Flow Previou opic: deign echnique reedy Divide and Conquer Dynamic

More information

Introduction to SLE Lecture Notes

Introduction to SLE Lecture Notes Inroducion o SLE Lecure Noe May 13, 16 - The goal of hi ecion i o find a ufficien condiion of λ for he hull K o be generaed by a imple cure. I urn ou if λ 1 < 4 hen K i generaed by a imple curve. We will

More information

Lecture 2-1 Kinematics in One Dimension Displacement, Velocity and Acceleration Everything in the world is moving. Nothing stays still.

Lecture 2-1 Kinematics in One Dimension Displacement, Velocity and Acceleration Everything in the world is moving. Nothing stays still. Lecure - Kinemaics in One Dimension Displacemen, Velociy and Acceleraion Everyhing in he world is moving. Nohing says sill. Moion occurs a all scales of he universe, saring from he moion of elecrons in

More information

PHYSICS Solving Equations

PHYSICS Solving Equations Sepember 20, 2013 PHYSIS Solving Equaion Sepember 2013 www.njcl.org Solving for a Variable Our goal i o be able o olve any equaion for any variable ha appear in i. Le' look a a imple equaion fir. The variable

More information

Math 221: Mathematical Notation

Math 221: Mathematical Notation Mah 221: Mahemaical Noaion Purpose: One goal in any course is o properly use he language o ha subjec. These noaions summarize some o he major conceps and more diicul opics o he uni. Typing hem helps you

More information

Geometric Path Problems with Violations

Geometric Path Problems with Violations Click here o view linked Reference 1 1 1 0 1 0 1 0 1 0 1 Geomeric Pah Problem wih Violaion Anil Mahehwari 1, Subha C. Nandy, Drimi Paanayak, Saanka Roy and Michiel Smid 1 1 School of Compuer Science, Carleon

More information

Chapter 3 Kinematics in Two Dimensions

Chapter 3 Kinematics in Two Dimensions Chaper 3 KINEMATICS IN TWO DIMENSIONS PREVIEW Two-dimensional moion includes objecs which are moing in wo direcions a he same ime, such as a projecile, which has boh horizonal and erical moion. These wo

More information

Maximum Flow. Contents. Max Flow Network. Maximum Flow and Minimum Cut

Maximum Flow. Contents. Max Flow Network. Maximum Flow and Minimum Cut Conen Maximum Flow Conen. Maximum low problem. Minimum cu problem. Max-low min-cu heorem. Augmening pah algorihm. Capaciy-caling. Shore augmening pah. Princeon Univeriy COS Theory o Algorihm Spring Kevin

More information

Physics 218 Exam 1 with Solutions Spring 2011, Sections ,526,528

Physics 218 Exam 1 with Solutions Spring 2011, Sections ,526,528 Physics 18 Exam 1 wih Soluions Sprin 11, Secions 513-515,56,58 Fill ou he informaion below bu do no open he exam unil insruced o do so Name Sinaure Suden ID E- mail Secion # Rules of he exam: 1. You have

More information

Phys 221 Fall Chapter 2. Motion in One Dimension. 2014, 2005 A. Dzyubenko Brooks/Cole

Phys 221 Fall Chapter 2. Motion in One Dimension. 2014, 2005 A. Dzyubenko Brooks/Cole Phys 221 Fall 2014 Chaper 2 Moion in One Dimension 2014, 2005 A. Dzyubenko 2004 Brooks/Cole 1 Kinemaics Kinemaics, a par of classical mechanics: Describes moion in erms of space and ime Ignores he agen

More information

How to Solve System Dynamic s Problems

How to Solve System Dynamic s Problems How o Solve Sye Dynaic Proble A ye dynaic proble involve wo or ore bodie (objec) under he influence of everal exernal force. The objec ay uliaely re, ove wih conan velociy, conan acceleraion or oe cobinaion

More information

= ( ) ) or a system of differential equations with continuous parametrization (T = R

= ( ) ) or a system of differential equations with continuous parametrization (T = R XIII. DIFFERENCE AND DIFFERENTIAL EQUATIONS Ofen funcions, or a sysem of funcion, are paramerized in erms of some variable, usually denoed as and inerpreed as ime. The variable is wrien as a funcion of

More information

CS 4495 Computer Vision Tracking 1- Kalman,Gaussian

CS 4495 Computer Vision Tracking 1- Kalman,Gaussian CS 4495 Compuer Vision A. Bobick CS 4495 Compuer Vision - KalmanGaussian Aaron Bobick School of Ineracive Compuing CS 4495 Compuer Vision A. Bobick Adminisrivia S5 will be ou his Thurs Due Sun Nov h :55pm

More information

Selfish Routing and the Price of Anarchy. Tim Roughgarden Cornell University

Selfish Routing and the Price of Anarchy. Tim Roughgarden Cornell University Selfih Rouing and he Price of Anarchy Tim Roughgarden Cornell Univeriy 1 Algorihm for Self-Inereed Agen Our focu: problem in which muliple agen (people, compuer, ec.) inerac Moivaion: he Inerne decenralized

More information

Reminder: Flow Networks

Reminder: Flow Networks 0/0/204 Ma/CS 6a Cla 4: Variou (Flow) Execie Reminder: Flow Nework A flow nework i a digraph G = V, E, ogeher wih a ource verex V, a ink verex V, and a capaciy funcion c: E N. Capaciy Source 7 a b c d

More information

Graph Theory: Network Flow

Graph Theory: Network Flow Univeriy of Wahingon Mah 336 Term Paper Graph Theory: Nework Flow Auhor: Ellio Broard Advier: Dr. Jame Morrow 3 June 200 Conen Inroducion...................................... 2 2 Terminology......................................

More information

Physics 240: Worksheet 16 Name

Physics 240: Worksheet 16 Name Phyic 4: Workhee 16 Nae Non-unifor circular oion Each of hee proble involve non-unifor circular oion wih a conan α. (1) Obain each of he equaion of oion for non-unifor circular oion under a conan acceleraion,

More information

Average Case Lower Bounds for Monotone Switching Networks

Average Case Lower Bounds for Monotone Switching Networks Average Cae Lower Bound for Monoone Swiching Nework Yuval Filmu, Toniann Piai, Rober Robere, Sephen Cook Deparmen of Compuer Science Univeriy of Torono Monoone Compuaion (Refreher) Monoone circui were

More information

( ) a system of differential equations with continuous parametrization ( T = R + These look like, respectively:

( ) a system of differential equations with continuous parametrization ( T = R + These look like, respectively: XIII. DIFFERENCE AND DIFFERENTIAL EQUATIONS Ofen funcions, or a sysem of funcion, are paramerized in erms of some variable, usually denoed as and inerpreed as ime. The variable is wrien as a funcion of

More information

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

4/12/12. Applications of the Maxflow Problem 7.5 Bipartite Matching. Bipartite Matching. Bipartite Matching. Bipartite matching: the flow network // Applicaion of he Maxflow Problem. Biparie Maching Biparie Maching Biparie maching. Inpu: undireced, biparie graph = (, E). M E i a maching if each node appear in a mo one edge in M. Max maching: find

More information

Physics 218 Exam 1. with Solutions Fall 2010, Sections Part 1 (15) Part 2 (20) Part 3 (20) Part 4 (20) Bonus (5)

Physics 218 Exam 1. with Solutions Fall 2010, Sections Part 1 (15) Part 2 (20) Part 3 (20) Part 4 (20) Bonus (5) Physics 18 Exam 1 wih Soluions Fall 1, Secions 51-54 Fill ou he informaion below bu o no open he exam unil insruce o o so! Name Signaure Suen ID E-mail Secion # ules of he exam: 1. You have he full class

More information

CS Lunch This Week. Special Talk This Week. Soviet Rail Network, Flow Networks. Slides20 - Network Flow Intro.key - December 5, 2016

CS Lunch This Week. Special Talk This Week. Soviet Rail Network, Flow Networks. Slides20 - Network Flow Intro.key - December 5, 2016 CS Lunch This Week Panel on Sudying Engineering a MHC Wednesday, December, : Kendade Special Talk This Week Learning o Exrac Local Evens from he Web John Foley, UMass Thursday, December, :, Carr Sovie

More information

23 Maximum Flows and Minimum Cuts

23 Maximum Flows and Minimum Cuts A proce canno be underood by opping i. Underanding mu move wih he flow of he proce, mu join i and flow wih i. The Fir Law of Mena, in Frank Herber Dune (196) Conrary o expecaion, flow uually happen no

More information

On the Submodularity of Influence in Social Networks

On the Submodularity of Influence in Social Networks On he ubmodulariy o Inluence in ocial Neworks Elchanan Mossel & ebasien Roch OC07 peaker: Xinran He Xinranhe1990@gmail.com ocial Nework ocial nework as a graph Nodes represen indiiduals. Edges are social

More information

6. DYNAMIC PROGRAMMING II

6. DYNAMIC PROGRAMMING II 6. DYNAMIC PROGRAMMING II sequence alignmen Hirschberg's algorihm Bellman-Ford algorihm disance vecor proocols negaive cycles in a digraph 6. DYNAMIC PROGRAMMING II sequence alignmen Hirschberg's algorihm

More information

3.6 Derivatives as Rates of Change

3.6 Derivatives as Rates of Change 3.6 Derivaives as Raes of Change Problem 1 John is walking along a sraigh pah. His posiion a he ime >0 is given by s = f(). He sars a =0from his house (f(0) = 0) and he graph of f is given below. (a) Describe

More information

Q2.1 This is the x t graph of the motion of a particle. Of the four points P, Q, R, and S, the velocity v x is greatest (most positive) at

Q2.1 This is the x t graph of the motion of a particle. Of the four points P, Q, R, and S, the velocity v x is greatest (most positive) at Q2.1 This is he x graph of he moion of a paricle. Of he four poins P, Q, R, and S, he velociy is greaes (mos posiive) a A. poin P. B. poin Q. C. poin R. D. poin S. E. no enough informaion in he graph o

More information

, the. L and the L. x x. max. i n. It is easy to show that these two norms satisfy the following relation: x x n x = (17.3) max

, the. L and the L. x x. max. i n. It is easy to show that these two norms satisfy the following relation: x x n x = (17.3) max ecure 8 7. Sabiliy Analyi For an n dimenional vecor R n, he and he vecor norm are defined a: = T = i n i (7.) I i eay o how ha hee wo norm aify he following relaion: n (7.) If a vecor i ime-dependen, hen

More information

T L. t=1. Proof of Lemma 1. Using the marginal cost accounting in Equation(4) and standard arguments. t )+Π RB. t )+K 1(Q RB

T L. t=1. Proof of Lemma 1. Using the marginal cost accounting in Equation(4) and standard arguments. t )+Π RB. t )+K 1(Q RB Elecronic Companion EC.1. Proofs of Technical Lemmas and Theorems LEMMA 1. Le C(RB) be he oal cos incurred by he RB policy. Then we have, T L E[C(RB)] 3 E[Z RB ]. (EC.1) Proof of Lemma 1. Using he marginal

More information

Flow networks, flow, maximum flow. Some definitions. Edmonton. Saskatoon Winnipeg. Vancouver Regina. Calgary. 12/12 a.

Flow networks, flow, maximum flow. Some definitions. Edmonton. Saskatoon Winnipeg. Vancouver Regina. Calgary. 12/12 a. Flow nework, flow, maximum flow Can inerpre direced graph a flow nework. Maerial coure hrough ome yem from ome ource o ome ink. Source produce maerial a ome eady rae, ink conume a ame rae. Example: waer

More information

2. VECTORS. R Vectors are denoted by bold-face characters such as R, V, etc. The magnitude of a vector, such as R, is denoted as R, R, V

2. VECTORS. R Vectors are denoted by bold-face characters such as R, V, etc. The magnitude of a vector, such as R, is denoted as R, R, V ME 352 VETS 2. VETS Vecor algebra form he mahemaical foundaion for kinemaic and dnamic. Geomer of moion i a he hear of boh he kinemaic and dnamic of mechanical em. Vecor anali i he imehonored ool for decribing

More information

IB Physics Kinematics Worksheet

IB Physics Kinematics Worksheet IB Physics Kinemaics Workshee Wrie full soluions and noes for muliple choice answers. Do no use a calculaor for muliple choice answers. 1. Which of he following is a correc definiion of average acceleraion?

More information

Chapter 10 INDUCTANCE Recommended Problems:

Chapter 10 INDUCTANCE Recommended Problems: Chaper 0 NDUCTANCE Recommended Problems: 3,5,7,9,5,6,7,8,9,,,3,6,7,9,3,35,47,48,5,5,69, 7,7. Self nducance Consider he circui shown in he Figure. When he swich is closed, he curren, and so he magneic field,

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorihm Deign and Analyi LECTURE 0 Nework Flow Applicaion Biparie maching Edge-dijoin pah Adam Smih 0//0 A. Smih; baed on lide by E. Demaine, C. Leieron, S. Rakhodnikova, K. Wayne La ime: Ford-Fulkeron

More information

CS781 Lecture 3 January 27, 2011

CS781 Lecture 3 January 27, 2011 CS781 Lecture 3 January 7, 011 Greedy Algorithms Topics: Interval Scheduling and Partitioning Dijkstra s Shortest Path Algorithm Minimum Spanning Trees Single-Link k-clustering Interval Scheduling Interval

More information

Algorithms. Algorithms 6.4 MAXIMUM FLOW

Algorithms. Algorithms 6.4 MAXIMUM FLOW Algorihm ROBERT SEDGEWICK KEVIN WAYNE 6.4 MAXIMUM FLOW Algorihm F O U R T H E D I T I O N ROBERT SEDGEWICK KEVIN WAYNE hp://alg4.c.princeon.edu inroducion Ford Fulkeron algorihm maxflow mincu heorem analyi

More information

5.1 - Logarithms and Their Properties

5.1 - Logarithms and Their Properties Chaper 5 Logarihmic Funcions 5.1 - Logarihms and Their Properies Suppose ha a populaion grows according o he formula P 10, where P is he colony size a ime, in hours. When will he populaion be 2500? We

More information

arxiv: v1 [cs.cg] 21 Mar 2013

arxiv: v1 [cs.cg] 21 Mar 2013 On he rech facor of he Thea-4 graph Lui Barba Proenji Boe Jean-Lou De Carufel André van Renen Sander Verdoncho arxiv:1303.5473v1 [c.cg] 21 Mar 2013 Abrac In hi paper we how ha he θ-graph wih 4 cone ha

More information

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 4.1 Interval Scheduling Interval Scheduling Interval scheduling. Job j starts at s j and

More information

Designing Information Devices and Systems I Spring 2019 Lecture Notes Note 17

Designing Information Devices and Systems I Spring 2019 Lecture Notes Note 17 EES 16A Designing Informaion Devices and Sysems I Spring 019 Lecure Noes Noe 17 17.1 apaciive ouchscreen In he las noe, we saw ha a capacior consiss of wo pieces on conducive maerial separaed by a nonconducive

More information

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

Flow Networks. Ma/CS 6a. Class 14: Flow Exercises 0/0/206 Ma/CS 6a Cla 4: Flow Exercie Flow Nework A flow nework i a digraph G = V, E, ogeher wih a ource verex V, a ink verex V, and a capaciy funcion c: E N. Capaciy Source 7 a b c d e Sink 0/0/206 Flow

More information

MEI Mechanics 1 General motion. Section 1: Using calculus

MEI Mechanics 1 General motion. Section 1: Using calculus Soluions o Exercise MEI Mechanics General moion Secion : Using calculus. s 4 v a 6 4 4 When =, v 4 a 6 4 6. (i) When = 0, s = -, so he iniial displacemen = - m. s v 4 When = 0, v = so he iniial velociy

More information

Notes on cointegration of real interest rates and real exchange rates. ρ (2)

Notes on cointegration of real interest rates and real exchange rates. ρ (2) Noe on coinegraion of real inere rae and real exchange rae Charle ngel, Univeriy of Wiconin Le me ar wih he obervaion ha while he lieraure (mo prominenly Meee and Rogoff (988) and dion and Paul (993))

More information

! ln 2xdx = (x ln 2x - x) 3 1 = (3 ln 6-3) - (ln 2-1)

! ln 2xdx = (x ln 2x - x) 3 1 = (3 ln 6-3) - (ln 2-1) 7. e - d Le u = and dv = e - d. Then du = d and v = -e -. e - d = (-e - ) - (-e - )d = -e - + e - d = -e - - e - 9. e 2 d = e 2 2 2 d = 2 e 2 2d = 2 e u du Le u = 2, hen du = 2 d. = 2 eu = 2 e2.! ( - )e

More information

CSC 364S Notes University of Toronto, Spring, The networks we will consider are directed graphs, where each edge has associated with it

CSC 364S Notes University of Toronto, Spring, The networks we will consider are directed graphs, where each edge has associated with it CSC 36S Noe Univeriy of Torono, Spring, 2003 Flow Algorihm The nework we will conider are direced graph, where each edge ha aociaed wih i a nonnegaive capaciy. The inuiion i ha if edge (u; v) ha capaciy

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 7 Greedy Graph Algorithms Shortest paths Minimum Spanning Tree Sofya Raskhodnikova 9/14/016 S. Raskhodnikova; based on slides by E. Demaine, C. Leiserson, A. Smith,

More information

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

Selfish Routing. Tim Roughgarden Cornell University. Includes joint work with Éva Tardos Selfih Rouing Tim Roughgarden Cornell Univeriy Include join work wih Éva Tardo 1 Which roue would you chooe? Example: one uni of raffic (e.g., car) wan o go from o delay = 1 hour (no congeion effec) long

More information

16 Max-Flow Algorithms

16 Max-Flow Algorithms A process canno be undersood by sopping i. Undersanding mus move wih he flow of he process, mus join i and flow wih i. The Firs Law of Mena, in Frank Herber s Dune (196) There s a difference beween knowing

More information

Christos Papadimitriou & Luca Trevisan November 22, 2016

Christos Papadimitriou & Luca Trevisan November 22, 2016 U.C. Bereley CS170: Algorihms Handou LN-11-22 Chrisos Papadimiriou & Luca Trevisan November 22, 2016 Sreaming algorihms In his lecure and he nex one we sudy memory-efficien algorihms ha process a sream

More information

Math 23 Spring Differential Equations. Final Exam Due Date: Tuesday, June 6, 5pm

Math 23 Spring Differential Equations. Final Exam Due Date: Tuesday, June 6, 5pm Mah Spring 6 Differenial Equaions Final Exam Due Dae: Tuesday, June 6, 5pm Your name (please prin): Insrucions: This is an open book, open noes exam. You are free o use a calculaor or compuer o check your

More information