15.082 and 6.855J Fall 2010 Network Optimization J.B. Orlin.

Slides:



Advertisements
Similar presentations
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
Advertisements

Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
15.082J & 6.855J & ESD.78J October 14, 2010 Maximum Flows 2.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Introduction This chapter explores graphs and their applications in computer science This chapter explores graphs and their applications in computer science.
Management Science 461 Lecture 2b – Shortest Paths September 16, 2008.
Piyush Kumar (Lecture 6: MaxFlow MinCut Applications)
Lectures on Network Flows
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
Math 308 Discrete Mathematics Discrete Mathematics deals with “Separated” or discrete sets of objects (rather than continuous sets) Processes with a sequence.
MIT and James Orlin © Introduction to Networks Eulerian Tours Hamiltonian Tours The Shortest Path Problem Dijkstra’s Algorithm for Solving the Shortest.
Math443/543 Mathematical Modeling and Optimization
An Euler Circuit is a cycle of an undirected graph, that traverses every edge of the graph exactly once, and ends at the same node from which it began.
Graphs and Trees This handout: Eulerian Cycles: Sufficiency of the condition Hamiltonian tour.
IEOR266 © Classification of MCNF problems.
Chapter 11 Graphs and Trees This handout: Terminology of Graphs Eulerian Cycles.
Graphs and Trees This handout: Terminology of Graphs Applications of Graphs.
15.082J and 6.855J and ESD.78J November 2, 2010 Network Flow Duality and Applications of Network Flows.
15.082J, 6.855J, and ESD.78J September 21, 2010 Eulerian Walks Flow Decomposition and Transformations.
GRAPH Learning Outcomes Students should be able to:
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
Lecture 2 Computational Complexity
Section 2.9 Maximum Flow Problems Minimum Cost Network Flows Shortest Path Problems.
Chapter 2 Graph Algorithms.
Graph Theory Topics to be covered:
Advanced Algorithms Piyush Kumar (Lecture 4: MaxFlow MinCut Applications) Welcome to COT5405.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Modeling and Evaluation with Graph Mohammad Khalily Dermany Islamic Azad University, Khomein branch.
Analysis of Algorithms
Chapter 3 Sec 3.3 With Question/Answer Animations 1.
MIT and James Orlin1 NP-completeness in 2005.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
15.082J and 6.855J and ESD.78J Lagrangian Relaxation 2 Applications Algorithms Theory.
The minimum cost flow problem. Simplifying assumptions Network is connected (as an undirected graph). – We can consider each connected component separately.
15.082J & 6.855J & ESD.78J September 23, 2010 Dijkstra’s Algorithm for the Shortest Path Problem.
Week 11 - Monday.  What did we talk about last time?  Binomial theorem and Pascal's triangle  Conditional probability  Bayes’ theorem.
and 6.855J Lagrangian Relaxation I never missed the opportunity to remove obstacles in the way of unity. —Mohandas Gandhi.
Data Structures & Algorithms Graphs
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Chapter 3 Algorithms Complexity Analysis Search and Flow Decomposition Algorithms.
Graphs Edge(arc) Vertices can be even or odd or undirected (two-way) Edges can be directed (one-way) This graph is connected. Degree(order) = 3 Odd vertex.
15.082J & 6.855J & ESD.78J October 7, 2010 Introduction to Maximum Flows.
MIT and James Orlin © NP-hardness. MIT and James Orlin © Moving towards complexity theory Linear Programming is viewed as easy and Integer.
Associated Matrices of Vertex Edge Graphs Euler Paths and Circuits Block Days April 30, May 1 and May
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
Euler Paths and Circuits. The original problem A resident of Konigsberg wrote to Leonard Euler saying that a popular pastime for couples was to try.
15.082J and 6.855J and ESD.78J The Successive Shortest Path Algorithm and the Capacity Scaling Algorithm for the Minimum Cost Flow Problem.
and 6.855J March 6, 2003 Maximum Flows 2. 2 Network Reliability u Communication Network u What is the maximum number of arc disjoint paths from.
CES 592 Theory of Software Systems B. Ravikumar (Ravi) Office: 124 Darwin Hall.
15.082J & 6.855J & ESD.78J September 30, 2010 The Label Correcting Algorithm.
Chapter 9: Graphs.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
1 CSE 326: Data Structures: Graphs Lecture 23: Wednesday, March 5 th, 2003.
Minimum Cost Flow Algorithms and Networks. Algorithms and Networks: Minimum Cost Flow2 This lecture The minimum cost flow problem: statement and applications.
The Theory of NP-Completeness
Cycle Canceling Algorithm
Network Optimization J.B. Orlin
Routing Through Networks - 1
EECS 203 Lecture 20 More Graphs.
Lectures on Network Flows
Algorithms and Networks
Piyush Kumar (Lecture 6: MaxFlow MinCut Applications)
and 6.855J March 6, 2003 Maximum Flows 2
Algorithms and Networks
Network Optimization Depth First Search
Eulerian Cycles in directed graphs
Chapter 10 Graphs and Trees
Slides on Network Optimization based on slides prepared by J.B. Orlin
Presentation transcript:

and 6.855J Fall 2010 Network Optimization J.B. Orlin

2 WELCOME! u Welcome to /6.855J u Introduction to Network Optimization u Instructor: James B. Orlin u TA: David Goldberg u Textbook: Network Flows: Theory, Algorithms, and Applications by Ahuja, Magnanti, and Orlin referred to as AMO

3 Quick Overview u Next: The Koenigsberg Bridge Problem Introduces Networks and Network Algorithms u Some subject management issues u Network flows and applications u Computational Complexity u Overall goal of today’s lecture: set the tone for the rest of the subject provide background provide motivation handle some class logistics

4 On the background of students u Requirement for this class Either Linear Programming (15.081J) or Data Structures u Mathematical proofs The homework exercises usually call for proofs. The midterms will not require proofs. For those who have not done many proofs before, the TA will provide guidance

5 Some aspects of the class u Fondness for Powerpoint animations u Cold-calling as a way to speed up learning of the algorithms u Talking with partners (the person next to you in in the classroom.) u Class time: used for presenting theory, algorithms, applications mostly outlines of proofs illustrated by examples (not detailed proofs) detailed proofs are in the text

6 The Bridges of Koenigsberg: Euler 1736 u “Graph Theory” began in 1736 u Leonard Eüler Visited Koenigsberg People wondered whether it is possible to take a walk, end up where you started from, and cross each bridge in Koenigsberg exactly once Generally it was believed to be impossible

7 The Bridges of Koenigsberg: Euler 1736 A D C B Is it possible to start in A, cross over each bridge exactly once, and end up back in A?

8 The Bridges of Koenigsberg: Euler 1736 A D C B Conceptualization: Land masses are “nodes”.

9 The Bridges of Koenigsberg: Euler Conceptualization: Bridges are “arcs.” A C D B

10 The Bridges of Koenigsberg: Euler Is there a “walk” starting at A and ending at A and passing through each arc exactly once? A C D B

11 Notation and Terminology Network terminology as used in AMO. Node set N = {1, 2, 3, 4} Network G = (N, A) Arc Set A = {(1,2), (1,3), (3,2), (3,4), (2,4)} a b c d e An Undirected Graph or Undirected Network a b c d e A Directed Graph or Directed Network In an undirected graph, (i,j) = (j,i)

Directed Path. Example: 1, 2, 5, 3, 4 (or 1, a, 2, c, 5, d, 3, e, 4) No node is repeated. Directions are important. Cycle (or circuit or loop) 1, 2, 3, 1. (or 1, a, 2, b, 3, e) A path with 2 or more nodes, except that the first node is the last node. Directions are ignored. Path: Example: 5, 2, 3, 4. (or 5, c, 2, b, 3, e, 4) No node is repeated. Directions are ignored. Directed Cycle: (1, 2, 3, 4, 1) or 1, a, 2, b, 3, c, 4, d, 1 No node is repeated. Directions are important ab c 1 5 d e a b c d 1 e ab c 1 5 d e a b c d 1 e

13 Walks a b c d e a b c d e 5 Walks are paths that can repeat nodes and arcs Example of a directed walk: A walk is closed if its first and last nodes are the same. A closed walk is a cycle except that it can repeat nodes and arcs.

14 The Bridges of Koenigsberg: Euler Is there a “walk” starting at A and ending at A and passing through each arc exactly once? Such a walk is called an eulerian cycle. A C D B

15 Adding two bridges creates such a walk A, 1, B, 5, D, 6, B, 4, C, 8, A, 3, C, 7, D, 9, B, 2, A A C D B 8 9 Here is the walk. Note: the number of arcs incident to B is twice the number of times that B appears on the walk.

On Eulerian Cycles A C D B 8 9 The degree of a node in an undirected graph is the number of incident arcs Theorem. An undirected graph has an eulerian cycle if and only if (1) every node degree is even and (2) the graph is connected (that is, there is a path from each node to each other node).

17 More on Euler’s Theorem u Necessity of two conditions: Any eulerian cycle “visits” each node an even number of times Any eulerian cycle shows the network is connected caveat: nodes of degree 0 u Sufficiency of the condition Assume the result is true for all graphs with fewer than |A| arcs. Start at some node, and take a walk until a cycle C is found

18 More on Euler’s Theorem u Sufficiency of the condition Start at some node, and take a walk until a cycle C is found. Consider G’ = (N, A\C) the degree of each node is even each component is connected u So, G’ is the union of Eulerian cycles u Connect G’ into a single eulerian cycle by adding C

19 Comments on Euler’s theorem 1. It reflects how proofs are done in class, often in outline form, with key ideas illustrated. 2. However, this proof does not directly lead to an efficient algorithm. (More on this in two lectures.) 3. Usually we focus on efficient algorithms.

/6.855J Subject Goals: 1.To present students with a knowledge of the state-of-the art in the theory and practice of solving network flow problems. u A lot has happened since To provide students with a rigorous analysis of network flow algorithms. computational complexity & worst case analysis 3. To help each student develop his or her own intuition about algorithm development and algorithm analysis.

21 Homework Sets and Grading u Homework Sets 6 assignments 4 points per assignment lots of practice problems with solutions u Grading homework: 24 points Project16 points Midterm 1: 30 points Midterm 2:30 points

22 Class discussion u Have you seen network models elsewhere? u Do you have any specific goals in taking this subject?

Mental break 23 Which nation gave women the right to vote first? New Zealand. Which Ocean goes to the deepest depths? Pacific Ocean What is northernmost land on earth? Cape Morris Jessep in Greenland Where is the Worlds Largest Aquarium? Epcot Center in Orlando, FL

Mental break 24 What country has not fought in a war since 1815? Switzerland What does the term Prima Donna mean in Opera? The leading female singer What fruit were Hawaiian women once forbidden by law to eat? The coconut What’s the most common non-contagious disease in the world? Tooth decay

Three Fundamental Flow Problems u The shortest path problem u The maximum flow problem u The minimum cost flow problem 25

26 The shortest path problem Consider a network G = (N, A) in which there is an origin node s and a destination node t. standard notation: n = |N|, m = |A| What is the shortest path from s to t? 16

27 The Maximum Flow Problem u Directed Graph G = (N, A). Source s Sink t Capacities u ij on arc (i,j) Maximize the flow out of s, subject to u Flow out of i = Flow into i, for i ≠ s or t. s 1 2 t A Network with Arc Capacities (and the maximum flow)

28 s 1 2 t 10, 9 8,8 1,1 10,7 6,6 Flow out of i - Flow into i = 0 for i ≠ s or t. Representing the Max Flow as an LP max v s.t x s1 + x s2 = v max v s.t. ∑ j x sj = v -x s1 + x 12 + x 1t = 0 -x s2 - x 12 + x 2t = 0 ∑ j x ij – ∑ j x ji = 0 for each i ≠ s or t -x 1t - x 2t = -v 0 ≤ x ij ≤ u ij for all (i,j) s.t. - ∑ i x it = -v

29 Flow out of i - Flow into i = b(i) Min Cost Flows min ∑ i,j c ij x ij s.t ∑ j x ij – ∑ j x ji = b(i) for each i 0 ≤ x ij ≤ u ij for all (i,j) $4,10 5 Each arc has a linear cost and a capacity Covered in detail in Chapter 1 of AMO

30 Where Network Optimization Arises u Transportation Systems Transportation of goods over transportation networks Scheduling of fleets of airplanes u Manufacturing Systems Scheduling of goods for manufacturing Flow of manufactured items within inventory systems u Communication Systems Design and expansion of communication systems Flow of information across networks u Energy Systems, Financial Systems, and much more

31 Next topic: computational complexity u What is an efficient algorithm? u How do we measure efficiency? u “Worst case analysis” u but first …

32 Measuring Computational Complexity  Consider the following algorithm for adding two m × n matrices A and B with coefficients a(, ) and b(, ). begin for i = 1 to m do for j = 1 to n do c(i,j) := a(i,j) + b(i,j) end What is the running time of this algorithm? u Let’s measure it as precisely as we can as a function of n and m. u Is it 2nm, or 3nm, or what? Worst case versus average case u How do we measure the running time? u What are the basic steps that we should count?

33 Compute the running time precisely. Operation Number (as a function of m,n) Additions Assignments Comparisons Multiplications

34 Towards Computational Complexity 1. We will ignore running time constants. 2. Our running times will be stated in terms of relevant problem parameters, e.g., nm. 3. We will measure everything in terms of worst case or most pessimistic analysis (performance guarantees.) 4. All arithmetic operations are assumed to take one step, (or a number of steps that is bounded by a constant).

35 A Simpler Metric for Running Time. u Operation Number (as a function of m,n) u Additions ≤ c 1 mn for some c 1 and m, n ≥ 1 O(mn) steps u Assignments ≤ c 2 mn for some c 2 and m, n ≥ 1 O(mn) steps u Comparisons ≤ c 3 mn for some c 3 and m, n ≥ 1 O(mn) steps u TOTAL ≤ c 4 mn for some c 4 and m, n ≥ 1 O(mn) steps

36 Simplifying Assumptions and Notation u MACHINE MODEL: Random Access Machine (RAM). This is the computer model that everyone is used to. It allows the use of arrays, and it can select any element of an array or matrix in O(1) steps. c(i,j) := a(i,j) + b(i,j). u Integrality Assumption. All numbers are integral (unless stated otherwise.)

37 Size of a problem u The size of a problem is the number of bits needed to represent the problem. u The size of the n × m matrix A is not nm. If each matrix element has K bits, the size is nmK e.g., if max < a ij < 2 108, then K = 108. K = O( log (a max )).

38 Polynomial Time Algorithms  We say that an algorithm runs in polynomial time if the number of steps taken by an algorithm on any instance I is bounded by a polynomial in the size of I. u We say that an algorithm runs in exponential time if it does not run in polynomial time. u Example 1: finding the determinant of a matrix can be done in O(n 3 ) steps. This is polynomial time.

39 Polynomial Time Algorithms u Example 2: We can determine if n is prime by dividing n by every integer less than n. This algorithm is exponential time. The size of the instance is log n The running time of the algorithm is O(n). Side note: there is a polynomial time algorithm for determining if n is prime. u Almost all of the algorithms presented in this class will be polynomial time. u One can find an Eulerian cycle (if one exists) in O(m) steps. u There is no known polynomial time algorithm for finding a min cost traveling salesman tour

40 On polynomial vs exponential time u We contrast two algorithm, one that takes 30,000 n 3 steps, and one that takes 2 n steps. u Suppose that we could carry out 1 billion steps per second. u # of nodes 30,000 n 3 steps2 n steps n = 30, 0.81 seconds1 second n = 40, 1.92 seconds17 minutes n = seconds12 days n = seconds31 years

41 On polynomial vs. exponential time u Suppose that we could carry out 1 trillion steps per second, and instantaneously eliminate % of all solutions as not worth considering u # of nodes 1,000 n 10 steps2 n steps n = 70, 2.82 seconds1 second n = 80, seconds17 minutes n = seconds12 days n = seconds31 years

42 Overview of today’s lecture u Eulerian cycles u Network Definitions u Network Applications u Introduction to computational complexity

43 Upcoming Lectures u Lecture 2: Review of Data Structures even those with data structure backgrounds are encouraged to attend. u Lecture 3. Graph Search Algorithms. how to determine if a graph is connected and to label a graph and more

MITOpenCourseWare J / 6.855J / ESD.78J Network Optimization Fall 2010 For information about citing these materials or our Terms of Use, visit: