1 Optimization Spring 2007 (Third Quarter). 2 Some practical remarks Homepage: www.daimi.au.dk/dOptwww.daimi.au.dk/dOpt Exam: Written, 3 hours. There.

Slides:



Advertisements
Similar presentations
Maximum flow Main goals of the lecture:
Advertisements

1 Optimization Spring Some practical remarks Lecturers: Kristoffer Arnsfelt Hansen and Peter Bro Miltersen. Homepage:
Linear Programming (LP) (Chap.29)
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
1 Review of some graph algorithms Graph G(V,E) (Chapter 22) –Directed, undirected –Representation Adjacency-list, adjacency-matrix Breadth-first search.
Introduction To Algorithms CS 445 Discussion Session 8 Instructor: Dr Alon Efrat TA : Pooja Vaswani 04/04/2005.
MAXIMUM FLOW Max-Flow Min-Cut Theorem (Ford Fukerson’s Algorithm)
The Maximum Network Flow Problem. CSE Network Flows.
Maurizio Patrignani seminar on the paper on the single-source unsplittable flow problem authored by Yefim Dinitz Naveen Garg Michel X. Goemans FOCS ‘98.
Advanced Algorithm Design and Analysis (Lecture 8) SW5 fall 2004 Simonas Šaltenis E1-215b
Lectures on Network Flows
Nick McKeown Spring 2012 Maximum Matching Algorithms EE384x Packet Switch Architectures.
1 The Max Flow Problem. 2 Flow networks Flow networks are the problem instances of the max flow problem. A flow network is given by 1) a directed graph.
Modelling with Max Flow 1. 2 The Max Flow Problem.
CS138A Network Flows Peter Schröder. CS138A Flow Networks Definitions a flow network G=(V,E) is a directed graph in which each edge (u,v)
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2001 Lecture 4 Tuesday, 2/19/02 Graph Algorithms: Part 2 Network.
1 dKS, Spring Some practical information Lecturers: Kristoffer Arnsfelt Hansen and Peter Bro Miltersen. Homepage:
1 Maximum flow problems. 2 - Introduction of: network, max-flow problem capacity, flow - Ford-Fulkerson method pseudo code, residual networks, augmenting.
1 Combinatorial Search Spring 2008 (Fourth Quarter)
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lecture 4 Tuesday, 10/2/01 Graph Algorithms: Part 2 Network.
The max flow problem
Maximum Flows Lecture 4: Jan 19. Network transmission Given a directed graph G A source node s A sink node t Goal: To send as much information from s.
Flows sourcesink s t Flows sourcesink edge-weights = capacities.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2004 Lecture 5 Wednesday, 10/6/04 Graph Algorithms: Part 2.
1 The Min Cost Flow Problem. 2 Flow Networks with Costs Flow networks with costs are the problem instances of the min cost flow problem. A flow network.
1 Ford-Fulkerson method Ford-Fulkerson(G) f = 0 while( 9 simple path p from s to t in G f ) f := f + f p output f Runs in time O(|f max | |E|) where f.
1 Integrality constraints Integrality constraints are often crucial when modeling optimizayion problems as linear programs. We have seen that if our linear.
Maximum Flow Maximum Flow Problem The Ford-Fulkerson method
1 The Min Cost Flow Problem. 2 The Min Cost Flow problem We want to talk about multi-source, multi-sink flows than just “flows from s to t”. We want to.
Maximum Flow Chapter 26.
Theory of Computing Lecture 13 MAS 714 Hartmut Klauck.
Single Source Shortest-Path: The General Case (with negative edges) Bellman-Ford algorithm. Iteratively relax all edges |V|-1 times Running time? O(VE).
CS 473Lecture ?1 CS473-Algorithms I Lecture ? Network Flows Finding Max Flow.
Max Flow – Min Cut Problem. Directed Graph Applications Shortest Path Problem (Shortest path from one point to another) Max Flow problems (Maximum material.
Maximum Flow Problem (Thanks to Jim Orlin & MIT OCW)
CS 473Lecture ?1 CS473-Algorithms I Lecture ? Network Flows Flow Networks & Flows.
Maximum Flow Chapter 26. Flow Concepts Source vertex s – where material is produced Sink vertex t – where material is consumed For all other vertices.
CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.
15.082J and 6.855J March 4, 2003 Introduction to Maximum Flows.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 25.
Chapter 7 May 3 Ford-Fulkerson algorithm Step-by-step walk through of an example Worst-case number of augmentations Edmunds-Karp modification Time complexity.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Exercise 6.1 Find the number of different shortest paths from point A to point B in a city with perfectly horizontal streets and vertical avenues as shown.
Flow Networks Ching-Chen Huang Hsi-Yue Hsiao. CONTENTS Network flows on directed acyclic graphs Ford-fulkerson Algorithms -Residual networks.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
A directed graph G consists of a set V of vertices and a set E of arcs where each arc in E is associated with an ordered pair of vertices from V. V={0,
Maximum Flow Problem Definitions and notations The Ford-Fulkerson method.
Instructor Neelima Gupta Edited by Divya Gaur(39, MCS '09) Thanks to: Bhavya(9), Deepika(10), Deepika Bisht(11) (MCS '09)
The Maximum Network Flow Problem
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
The Maximum Network Flow Problem
Maximum Flow Chapter 26.
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Graph Algorithms Minimum Spanning Tree (Chap 23)
Linear Programming (LP) (Chap.29)
Algorithms and Networks Hans Bodlaender
Network flow problem [Adapted from M.Chandy].
Network Flow & Linear Programming
Richard Anderson Lecture 23 Network Flow
Network Flow 2016/04/12.
Instructor: Shengyu Zhang
Network Flows and Matching (Supplementary)
Introduction to Maximum Flows
Flow Networks Topics Flow Networks Residual networks
Flow Networks General Characteristics Applications
Flow Networks and Bipartite Matching
Algorithms (2IL15) – Lecture 7
EE5900 Advanced Embedded System For Smart Infrastructure
Advanced Graph Homer Lee 2013/10/31.
Maximum Flow Problems in 2005.
Presentation transcript:

1 Optimization Spring 2007 (Third Quarter)

2 Some practical remarks Homepage: Exam: Written, 3 hours. There will be three compulsory assignments. If you want to transfer credit from last year, let me know as soon as possible and before March 1. The solution to the compulsory assignments should be handed in at specific exercise sessions and given to the instructor in person. Text: “Kompendium” available at GAD.

3 Frequently asked questions about compulsory assignments Q: Do I really have to hand in all three assignments? A: YES! Q: Do I really have to hand in all three assignments on time? A: YES! Q: What if I can’t figure out how to solve them? A: Ask your instructor. Start solving them early, so that you will have sufficient time. Q: What if I get sick or my girlfriend breaks up or my hamster dies? A: Start solving them early, so that you will have sufficient time in case of emergencies. Q: Do I really have to hand in all three assignments? A: YES!

4 Maximum matching Max Flow Shortest paths Min Cost Flow Linear Programming Mixed Integer Linear Programming Polynomial (easy) by Local Search. Exponential (hard). = reduction

5 The Max Flow Problem

6 Flow networks Flow networks are the problem instances of the max flow problem. A flow network is given by 1) a directed graph G = (V,E) 2) capacities c: E ! R +. 3) The source s 2 V and the sink t 2 V. Convention: c(u,v)=0 for (u,v) not in E.

7 Flows Given flow network, a flow is a feasible solution to the max flow problem. A flow is a map f: V £ V ! R satisfying capacity constraints: 8 (u,v): f(u,v) · c(u,v). Skew symmetry: 8 (u,v): f(u,v) = – f(v,u). Flow conservation: 8 u 2 V – {s,t}:  v 2 V f(u,v) = 0

8 A Flow

9 Skew Symmetry is modeled as Our flows are net flows.

10 Flow Conservation  u f(v 3, u) = 0?

11 Flow Conservation  u f(v 3, u) = (-7)+1+(-5)+11=

Flow entering v 3 = 12 Flow leaving v 3 = 12 Flow conservation expresses that v 3 is in balance.

13 Notation f(X,Y) :=  u 2 X, v 2 Y f(u,v). Value of f: |f| := f(s,V). The Max Flow Problem: Given a flow network (V,E,c,s,t), find the feasible flow f maximizing |f|.

14 Some facts f(X,X) = 0, f(X,Y) = – f(Y,X), X Å Y = ; ) f(X [ Y, Z) = f(X,Z) + f(Y,Z). (exercise ) |f| = f(V,t).

15 Modeling with Max Flow: A scheduling problem A set of jobs must be scheduled on M identical machines. Each job j has an arrival date r j, a required delivery date d j and a processing time p j · d j - r j. A job can be preemptively moved from one machine to another. Can the jobs be scheduled on the machines so that the deadlines are met?

16 M = 3

17

18 Many natural optimization instances can be expressed using the max flow formalism. How do we solve the max flow problem?

19 Algorithmic Patterns Which algorithmic patterns do you know?

20 Local Search Pattern LocalSearch(ProblemInstance x) y := feasible solution to x; while 9 z ∊ N(y): v(z) > v(y) do y := z; od; return y; N(y) is a neighborhood of y.

21 Local Search

22 Local search checklist Design: How do we find the first feasible solution? Neighborhood design? Which neighbor to choose? Analysis: Partial correctness? (termination ) correctness) Termination? Complexity?

23 The first flow?

24 The first flow?

25 Neighborhood design Given a flow, how can we find a slightly different (and hopefully slightly better) flow?

26 The first flow?

Path Flows Path Flow = flow with positive values only on a simple path from s to t

28 Idea Let N(y) be the flows that can be obtained from y by adding a path flow (without violating the capacity bounds). The path flow we add should use some path in (V,E) along which every edge has some unused capacity.

29 Example sst

30 Example st

31 Example st

32 Another Path? No. st

33 Optimal? st

34 No! st

35 Some remarks When designing a local search algorithm, the most obvious neighborhood relation is not necessarily the right one. That a solution cannot be improved by using some specified set of changes does not necessarily mean it is globally optimal.

36 Better Idea The graph (V,E) is not really the right one to find paths in. The path flow we add should use some path in (V,E f ) where E f is the set of edges that has unused capacity under the current flow f. E f may include edges (u,v) 2 E as well as back-edges (u,v) for which (v,u) 2 E.

37 The residual network Let G=(V,E,c,s,t) be a flow network and let f be a flow in G. The residual network is the flow network with edges and capacities E f = {(u,v) 2 V £ V| f(u,v) < c(u,v)} c f (u,v) = c(u,v) - f(u,v)

38 A Flow

39 Lemma 26.2 Let G=(V,E,c,s,t) be a flow network f be a flow in G G f be the residual network f’ be a flow in G f Then f +f’ is a flow in G with value |f|+|f’|

40 Augmenting Paths A simple path p from s to t in G f is called an augmenting path. Let c f (p) = min{ c f (u,v) : (u,v) is on p} Let f p (u,v) be c f (p) if (u,v) is on p -c f (p) if (v,u) is on p 0 otherwise Then f p is a path flow in G f with value c f (p)

41 Ford-Fulkerson method Ford-Fulkerson(G) f = 0 while( 9 simple path p from s to t in G f ) f := f + f p output f

42 Design: How do we find the first feasible solution? Neighborhood design? Which neighbor to choose? Analysis: Partial correctness? (termination ) correctness) Termination? Complexity? Local search checklist ٧ ٧ Next