SlideShare a Scribd company logo
15.082 and 6.855J

Network Optimization

Fall 2010

J.B. Orlin
WELCOME!
Welcome to 15.082/6.855J
Introduction to Network Optimization
Instructor: James B. Orlin
TA: David Goldberg

Textbook: Network Flows: Theory, Algorithms,
and Applications by Ahuja, Magnanti, and Orlin
referred to as AMO

2
Quick Overview
Next: The Koenigsberg Bridge Problem
 Introduces Networks and Network Algorithms
Some subject management issues
Network flows and applications
Computational Complexity
Overall goal of today’s lecture: set the tone for the rest of
the subject
 provide background
 provide motivation
 handle some class logistics
3
On the background of students
Requirement for this class
 Either Linear Programming (15.081J)
 or Data Structures
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

4
Some aspects of the class
Fondness for Powerpoint animations
Cold-calling as a way to speed up learning of the
algorithms
Talking with partners (the person next to you in
in the classroom.)
Class time: used for presenting theory,
algorithms, applications
 mostly outlines of proofs illustrated by
examples (not detailed proofs)
 detailed proofs are in the text
5
The Bridges of Koenigsberg: Euler 1736
“Graph Theory” began in 1736
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

6
The Bridges of Koenigsberg: Euler 1736
A
1

2

3

B
5

4

C

6

D

7

Is it possible to start in A, cross over each bridge
exactly once, and end up back in A?

7
The Bridges of Koenigsberg: Euler 1736
A
1

2

3

B
5

4

C

6

D

7

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

A
1

2

3

B

5

4
6

D

C

7

Conceptualization: Bridges are “arcs.”
9
The Bridges of Koenigsberg: Euler 1736

A
1

2

3

B

5

4
6

D

C

7

Is there a “walk” starting at A and ending at A and
passing through each arc exactly once?
10
Notation and Terminology
Network terminology as used in AMO.
1
a
4

b
c

2

1
e

3
d
An Undirected Graph or
Undirected Network

a

b

2

c

e

4

3
d
A Directed Graph or
Directed Network

Network G = (N, A)
Node set N = {1, 2, 3, 4}
Arc Set A = {(1,2), (1,3), (3,2), (3,4), (2,4)}
In an undirected graph, (i,j) = (j,i)

11
Path: Example: 5, 2, 3, 4.
(or 5, c, 2, b, 3, e, 4)
•No node is repeated.
•Directions are ignored.

1

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.

Directed Cycle: (1, 2, 3, 4, 1) or
1, a, 2, b, 3, c, 4, d, 1
•No node is repeated.
•Directions are important.

5

c
a

b

2

c
1

a

a

2

d
3 e

5

4

d

b

3 e

4

2
b
e

1
d

3

c
4
a

2
b
e

1
d

c
4

3
Walks
1
a
4

b

2

c

1
e

3

d
5

a
4

b

2

c

e
3

d
5

Walks are paths that can repeat nodes and arcs
Example of a directed walk: 1-2-3-5-4-2-3-5
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.
13
The Bridges of Koenigsberg: Euler 1736

A
1

2

3

B

5

4
6

D

C

7

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.

14
Adding two bridges creates such a walk
A

1

8

2
B

4

5 6

3
C

9
D

7

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

15
On Eulerian Cycles
4
A

1
6

8

2
B

4

5 6

3
C

9
D
4

4

The degree of
a node in an
undirected
graph is the
number of
incident arcs

7

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).
More on Euler’s Theorem
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

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.

1

5

4

7

3
17
More on Euler’s Theorem
Sufficiency of the condition
 Start at some node, and take a walk until a cycle C is
found.
 Consider G’ = (N, AC)
the degree of each node is even
 each component is connected


So, G’ is the union of Eulerian cycles
Connect G’ into a single eulerian cycle by adding C.
5

4

7

3

18
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.

19
15.082/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.
A lot has happened since 1736
2. 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.
20
Homework Sets and Grading
Homework Sets
 6 assignments
 4 points per assignment
 lots of practice problems with solutions
Grading
 homework:
 Project
 Midterm 1:
 Midterm 2:

24 points
16 points
30 points
30 points

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

22
Mental break
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
23
Mental break
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

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

25
The shortest path problem
2

4

4

2

2
1

1

2

3

4

6
6
2

3

3

5

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?
26
The Maximum Flow Problem
Directed Graph G = (N, A).
 Source s
 Sink t
 Capacities uij on arc (i,j)


Maximize the flow out of s, subject to

Flow out of i = Flow into i, for i ≠ s or t.
9
10
s

6
6

1
1

1

8

8
7

t

10
2

A Network with Arc Capacities (and the maximum flow)

27
Representing the Max Flow as an LP

10, 9

1
1,1

s
6, 6

2

max v
s.t xs1 + xs2

t
10,7

max
= v

-xs1 + x12 + x1t = 0
-xs2 - x12 + x2t = 0
-x1t - x2t

Flow out of i - Flow into i =
0 for i ≠ s or t.

8,8

= -v

0 ≤ xij ≤ uij for all (i,j)

s.t.

v

∑ j xsj
=
∑ j xij – ∑ j xji =

v
0

for each i ≠ s or t
s.t. - ∑ i xit
= -v
0 ≤ xij ≤ uij for all (i,j)

28
Min Cost Flows
5
2

$4 ,10
1

Flow out of i - Flow into i = b(i)
4

3

min
s.t

∑ i,j cijxij
∑ j xij – ∑ j xji

Each arc has a
linear cost and a
capacity

= b(i) for each i

0 ≤ xij ≤ uij for all (i,j)
Covered in detail in Chapter 1 of AMO

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

30
Next topic: computational complexity
What is an efficient algorithm?
How do we measure efficiency?
“Worst case analysis”

but first …

31
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?
Let’s measure it as precisely as we can as a function of n and m.
Is it 2nm, or 3nm, or what?

Worst case versus average case
How do we measure the running time?
What are the basic steps that we should count?
32
Compute the running time precisely.
Operation Number (as a function of m,n)
Additions
Assignments
Comparisons
Multiplications

33
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).
34
A Simpler Metric for Running Time.
Operation Number (as a function of m,n)
Additions ≤ c1 mn for some c1 and m, n ≥ 1
 O(mn) steps
Assignments ≤ c2 mn for some c2 and m, n ≥ 1
 O(mn) steps
Comparisons ≤ c3 mn for some c3 and m, n ≥ 1
 O(mn) steps
TOTAL ≤ c4 mn for some c4 and m, n ≥ 1
 O(mn) steps

35
Simplifying Assumptions and Notation
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).
Integrality Assumption. All numbers are integral
(unless stated otherwise.)

36
Size of a problem
The size of a problem is the number of bits
needed to represent the problem.
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 2107 < aij < 2108, then K = 108.
K

= O( log (amax)).

37
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.
We say that an algorithm runs in exponential time
if it does not run in polynomial time.
Example 1: finding the determinant of a matrix
can be done in O(n3) steps.
 This is polynomial time.

38
Polynomial Time Algorithms
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.
Almost all of the algorithms presented in this class will be
polynomial time.
One can find an Eulerian cycle (if one exists) in O(m) steps.
There is no known polynomial time algorithm for finding a
min cost traveling salesman tour
39
On polynomial vs exponential time
We contrast two algorithm, one that takes 30,000 n3
steps, and one that takes 2n steps.
Suppose that we could carry out 1 billion steps per
second.
# of nodes
n = 30,
n = 40,
n = 50
n = 60

30,000 n3 steps 2n steps
0.81 seconds
1 second
1.92 seconds
17 minutes
3.75 seconds
12 days
6.48 seconds
31 years
40
On polynomial vs. exponential time
Suppose that we could carry out 1 trillion steps
per second, and instantaneously eliminate
99.9999999% of all solutions as not worth
considering

# of nodes
n = 70,
n = 80,
n = 90
n = 100

1,000 n10 steps
2.82 seconds
10.74 seconds
34.86 seconds
100 seconds

2n steps
1 second
17 minutes
12 days
31 years
41
Overview of today’s lecture
Eulerian cycles
Network Definitions
Network Applications
Introduction to computational complexity

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

43
MITOpenCourseWare
http://ocw.mit.edu

15.082J / 6.855J / ESD.78J Network Optimization
Fall 2010

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

More Related Content

PPT
Lecture#9
Ali Shah
 
PPT
5.1 greedy
Krish_ver2
 
PPT
Branch and bound
Dr Shashikant Athawale
 
DOC
Unit 3 daa
Nv Thejaswini
 
PPT
5.1 greedy 03
Krish_ver2
 
PPTX
Branch and bound technique
ishmecse13
 
PDF
EE gate-2016-set-1
meghasingh812
 
PDF
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
Roman Elizarov
 
Lecture#9
Ali Shah
 
5.1 greedy
Krish_ver2
 
Branch and bound
Dr Shashikant Athawale
 
Unit 3 daa
Nv Thejaswini
 
5.1 greedy 03
Krish_ver2
 
Branch and bound technique
ishmecse13
 
EE gate-2016-set-1
meghasingh812
 
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
Roman Elizarov
 

What's hot (20)

PDF
Backtracking & branch and bound
Vipul Chauhan
 
DOC
Branch and bound
Nv Thejaswini
 
PDF
013_20160328_Topological_Measurement_Of_Protein_Compressibility
Ha Phuong
 
PDF
Pyoneers - IITGN CSE Seminar Presentation
Vaidyanathan P. R.
 
PDF
Skiena algorithm 2007 lecture16 introduction to dynamic programming
zukun
 
PDF
Absorbing Random Walk Centrality
Michael Mathioudakis
 
PPTX
Randomized algorithms all pairs shortest path
Mohammad Akbarizadeh
 
PPT
Dijksatra
Tanmay Baranwal
 
PPTX
Dynamic Programming - Part II
Amrinder Arora
 
PPTX
Design and Analysis of Algorithms
Arvind Krishnaa
 
PPT
1524 elliptic curve cryptography
Dr Fereidoun Dejahang
 
PDF
Algorithmic Data Science = Theory + Practice
Two Sigma
 
PPTX
Lecture warshall floyd
Divya Ks
 
PDF
ACM ICPC 2015 NEERC (Northeastern European Regional Contest) Problems Review
Roman Elizarov
 
PDF
Graph Summarization with Quality Guarantees
Two Sigma
 
PDF
Animashree Anandkumar, Electrical Engineering and CS Dept, UC Irvine at MLcon...
MLconf
 
PDF
TRIEST: Counting Local and Global Triangles in Fully-Dynamic Streams with Fix...
Two Sigma
 
PPT
Muchtadi
Niranjan Patidar
 
PDF
Cs6402 design and analysis of algorithms may june 2016 answer key
appasami
 
PDF
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
Roman Elizarov
 
Backtracking & branch and bound
Vipul Chauhan
 
Branch and bound
Nv Thejaswini
 
013_20160328_Topological_Measurement_Of_Protein_Compressibility
Ha Phuong
 
Pyoneers - IITGN CSE Seminar Presentation
Vaidyanathan P. R.
 
Skiena algorithm 2007 lecture16 introduction to dynamic programming
zukun
 
Absorbing Random Walk Centrality
Michael Mathioudakis
 
Randomized algorithms all pairs shortest path
Mohammad Akbarizadeh
 
Dijksatra
Tanmay Baranwal
 
Dynamic Programming - Part II
Amrinder Arora
 
Design and Analysis of Algorithms
Arvind Krishnaa
 
1524 elliptic curve cryptography
Dr Fereidoun Dejahang
 
Algorithmic Data Science = Theory + Practice
Two Sigma
 
Lecture warshall floyd
Divya Ks
 
ACM ICPC 2015 NEERC (Northeastern European Regional Contest) Problems Review
Roman Elizarov
 
Graph Summarization with Quality Guarantees
Two Sigma
 
Animashree Anandkumar, Electrical Engineering and CS Dept, UC Irvine at MLcon...
MLconf
 
TRIEST: Counting Local and Global Triangles in Fully-Dynamic Streams with Fix...
Two Sigma
 
Cs6402 design and analysis of algorithms may june 2016 answer key
appasami
 
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
Roman Elizarov
 
Ad

Similar to Mit15 082 jf10_lec01 (20)

PDF
Introduction to Graph Theory
Yosuke Mizutani
 
PPT
transportation network analysis lecture 5
kiitokdm
 
PPT
mathematics of network science: basic definitions
phdutm2009
 
PPT
Network Models - modeling and simulation(lecture Three).ppt
nansambakuluthum7
 
PPTX
lecture09-graphs.pptx
NageshBabu34
 
PPTX
graphs data structure and algorithm link list
KamranAli649587
 
PDF
Algorithm Design
Laurie Smith
 
PDF
Class01_Computer_Contest_Level_3_Notes_Sep_07 - Copy.pdf
ChristianKapsales1
 
PPT
Graphs
amudha arul
 
PPTX
10.graph
jashobhan pradhan
 
PDF
Algorithm Design.pdf
Faisal Sal
 
PDF
GRAPH MATRIX APPLICATIONS.pdf
DurgaPrasad736072
 
PDF
Graph Matrices and Application: Motivational overview, matrix of graph, relat...
Rajalingam Balakrishnan
 
PPTX
12_Graph.pptx
TELAPROLULAKSHMISRIN
 
PDF
gsm nithya.pdf
mathematicssac
 
PPTX
Chapter 1
MeeraMeghpara
 
PPT
CST 504 Graphs
Neil MacIntosh
 
PPTX
theory of computation lecture 01
8threspecter
 
PDF
14 chapter9 graph_algorithmstopologicalsort_shortestpath
SSE_AndyLi
 
PDF
Algorithms andcomplexity
Hieu Pham
 
Introduction to Graph Theory
Yosuke Mizutani
 
transportation network analysis lecture 5
kiitokdm
 
mathematics of network science: basic definitions
phdutm2009
 
Network Models - modeling and simulation(lecture Three).ppt
nansambakuluthum7
 
lecture09-graphs.pptx
NageshBabu34
 
graphs data structure and algorithm link list
KamranAli649587
 
Algorithm Design
Laurie Smith
 
Class01_Computer_Contest_Level_3_Notes_Sep_07 - Copy.pdf
ChristianKapsales1
 
Graphs
amudha arul
 
Algorithm Design.pdf
Faisal Sal
 
GRAPH MATRIX APPLICATIONS.pdf
DurgaPrasad736072
 
Graph Matrices and Application: Motivational overview, matrix of graph, relat...
Rajalingam Balakrishnan
 
12_Graph.pptx
TELAPROLULAKSHMISRIN
 
gsm nithya.pdf
mathematicssac
 
Chapter 1
MeeraMeghpara
 
CST 504 Graphs
Neil MacIntosh
 
theory of computation lecture 01
8threspecter
 
14 chapter9 graph_algorithmstopologicalsort_shortestpath
SSE_AndyLi
 
Algorithms andcomplexity
Hieu Pham
 
Ad

Recently uploaded (20)

PPTX
IoT Sensor Integration 2025 Powering Smart Tech and Industrial Automation.pptx
Rejig Digital
 
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Software Development Company | KodekX
KodekX
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
Coupa-Overview _Assumptions presentation
annapureddyn
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
IoT Sensor Integration 2025 Powering Smart Tech and Industrial Automation.pptx
Rejig Digital
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Software Development Methodologies in 2025
KodekX
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Software Development Company | KodekX
KodekX
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
This slide provides an overview Technology
mineshkharadi333
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Coupa-Overview _Assumptions presentation
annapureddyn
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 

Mit15 082 jf10_lec01

  • 1. 15.082 and 6.855J Network Optimization Fall 2010 J.B. Orlin
  • 2. WELCOME! Welcome to 15.082/6.855J Introduction to Network Optimization Instructor: James B. Orlin TA: David Goldberg Textbook: Network Flows: Theory, Algorithms, and Applications by Ahuja, Magnanti, and Orlin referred to as AMO 2
  • 3. Quick Overview Next: The Koenigsberg Bridge Problem  Introduces Networks and Network Algorithms Some subject management issues Network flows and applications Computational Complexity Overall goal of today’s lecture: set the tone for the rest of the subject  provide background  provide motivation  handle some class logistics 3
  • 4. On the background of students Requirement for this class  Either Linear Programming (15.081J)  or Data Structures 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 4
  • 5. Some aspects of the class Fondness for Powerpoint animations Cold-calling as a way to speed up learning of the algorithms Talking with partners (the person next to you in in the classroom.) Class time: used for presenting theory, algorithms, applications  mostly outlines of proofs illustrated by examples (not detailed proofs)  detailed proofs are in the text 5
  • 6. The Bridges of Koenigsberg: Euler 1736 “Graph Theory” began in 1736 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 6
  • 7. The Bridges of Koenigsberg: Euler 1736 A 1 2 3 B 5 4 C 6 D 7 Is it possible to start in A, cross over each bridge exactly once, and end up back in A? 7
  • 8. The Bridges of Koenigsberg: Euler 1736 A 1 2 3 B 5 4 C 6 D 7 Conceptualization: Land masses are “nodes”. 8
  • 9. The Bridges of Koenigsberg: Euler 1736 A 1 2 3 B 5 4 6 D C 7 Conceptualization: Bridges are “arcs.” 9
  • 10. The Bridges of Koenigsberg: Euler 1736 A 1 2 3 B 5 4 6 D C 7 Is there a “walk” starting at A and ending at A and passing through each arc exactly once? 10
  • 11. Notation and Terminology Network terminology as used in AMO. 1 a 4 b c 2 1 e 3 d An Undirected Graph or Undirected Network a b 2 c e 4 3 d A Directed Graph or Directed Network Network G = (N, A) Node set N = {1, 2, 3, 4} Arc Set A = {(1,2), (1,3), (3,2), (3,4), (2,4)} In an undirected graph, (i,j) = (j,i) 11
  • 12. Path: Example: 5, 2, 3, 4. (or 5, c, 2, b, 3, e, 4) •No node is repeated. •Directions are ignored. 1 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. Directed Cycle: (1, 2, 3, 4, 1) or 1, a, 2, b, 3, c, 4, d, 1 •No node is repeated. •Directions are important. 5 c a b 2 c 1 a a 2 d 3 e 5 4 d b 3 e 4 2 b e 1 d 3 c 4 a 2 b e 1 d c 4 3
  • 13. Walks 1 a 4 b 2 c 1 e 3 d 5 a 4 b 2 c e 3 d 5 Walks are paths that can repeat nodes and arcs Example of a directed walk: 1-2-3-5-4-2-3-5 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. 13
  • 14. The Bridges of Koenigsberg: Euler 1736 A 1 2 3 B 5 4 6 D C 7 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. 14
  • 15. Adding two bridges creates such a walk A 1 8 2 B 4 5 6 3 C 9 D 7 Here is the walk. A, 1, B, 5, D, 6, B, 4, C, 8, A, 3, C, 7, D, 9, B, 2, A Note: the number of arcs incident to B is twice the number of times that B appears on the walk. 15
  • 16. On Eulerian Cycles 4 A 1 6 8 2 B 4 5 6 3 C 9 D 4 4 The degree of a node in an undirected graph is the number of incident arcs 7 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 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 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. 1 5 4 7 3 17
  • 18. More on Euler’s Theorem Sufficiency of the condition  Start at some node, and take a walk until a cycle C is found.  Consider G’ = (N, AC) the degree of each node is even  each component is connected  So, G’ is the union of Eulerian cycles Connect G’ into a single eulerian cycle by adding C. 5 4 7 3 18
  • 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. 19
  • 20. 15.082/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. A lot has happened since 1736 2. 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. 20
  • 21. Homework Sets and Grading Homework Sets  6 assignments  4 points per assignment  lots of practice problems with solutions Grading  homework:  Project  Midterm 1:  Midterm 2: 24 points 16 points 30 points 30 points 21
  • 22. Class discussion Have you seen network models elsewhere? Do you have any specific goals in taking this subject? 22
  • 23. Mental break 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 23
  • 24. Mental break 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 24
  • 25. Three Fundamental Flow Problems The shortest path problem The maximum flow problem The minimum cost flow problem 25
  • 26. The shortest path problem 2 4 4 2 2 1 1 2 3 4 6 6 2 3 3 5 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? 26
  • 27. The Maximum Flow Problem Directed Graph G = (N, A).  Source s  Sink t  Capacities uij on arc (i,j)  Maximize the flow out of s, subject to Flow out of i = Flow into i, for i ≠ s or t. 9 10 s 6 6 1 1 1 8 8 7 t 10 2 A Network with Arc Capacities (and the maximum flow) 27
  • 28. Representing the Max Flow as an LP 10, 9 1 1,1 s 6, 6 2 max v s.t xs1 + xs2 t 10,7 max = v -xs1 + x12 + x1t = 0 -xs2 - x12 + x2t = 0 -x1t - x2t Flow out of i - Flow into i = 0 for i ≠ s or t. 8,8 = -v 0 ≤ xij ≤ uij for all (i,j) s.t. v ∑ j xsj = ∑ j xij – ∑ j xji = v 0 for each i ≠ s or t s.t. - ∑ i xit = -v 0 ≤ xij ≤ uij for all (i,j) 28
  • 29. Min Cost Flows 5 2 $4 ,10 1 Flow out of i - Flow into i = b(i) 4 3 min s.t ∑ i,j cijxij ∑ j xij – ∑ j xji Each arc has a linear cost and a capacity = b(i) for each i 0 ≤ xij ≤ uij for all (i,j) Covered in detail in Chapter 1 of AMO 29
  • 30. Where Network Optimization Arises Transportation Systems  Transportation of goods over transportation networks  Scheduling of fleets of airplanes Manufacturing Systems  Scheduling of goods for manufacturing  Flow of manufactured items within inventory systems Communication Systems  Design and expansion of communication systems  Flow of information across networks Energy Systems, Financial Systems, and much more 30
  • 31. Next topic: computational complexity What is an efficient algorithm? How do we measure efficiency? “Worst case analysis” but first … 31
  • 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? Let’s measure it as precisely as we can as a function of n and m. Is it 2nm, or 3nm, or what? Worst case versus average case How do we measure the running time? What are the basic steps that we should count? 32
  • 33. Compute the running time precisely. Operation Number (as a function of m,n) Additions Assignments Comparisons Multiplications 33
  • 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). 34
  • 35. A Simpler Metric for Running Time. Operation Number (as a function of m,n) Additions ≤ c1 mn for some c1 and m, n ≥ 1  O(mn) steps Assignments ≤ c2 mn for some c2 and m, n ≥ 1  O(mn) steps Comparisons ≤ c3 mn for some c3 and m, n ≥ 1  O(mn) steps TOTAL ≤ c4 mn for some c4 and m, n ≥ 1  O(mn) steps 35
  • 36. Simplifying Assumptions and Notation 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). Integrality Assumption. All numbers are integral (unless stated otherwise.) 36
  • 37. Size of a problem The size of a problem is the number of bits needed to represent the problem. 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 2107 < aij < 2108, then K = 108. K = O( log (amax)). 37
  • 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. We say that an algorithm runs in exponential time if it does not run in polynomial time. Example 1: finding the determinant of a matrix can be done in O(n3) steps.  This is polynomial time. 38
  • 39. Polynomial Time Algorithms 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. Almost all of the algorithms presented in this class will be polynomial time. One can find an Eulerian cycle (if one exists) in O(m) steps. There is no known polynomial time algorithm for finding a min cost traveling salesman tour 39
  • 40. On polynomial vs exponential time We contrast two algorithm, one that takes 30,000 n3 steps, and one that takes 2n steps. Suppose that we could carry out 1 billion steps per second. # of nodes n = 30, n = 40, n = 50 n = 60 30,000 n3 steps 2n steps 0.81 seconds 1 second 1.92 seconds 17 minutes 3.75 seconds 12 days 6.48 seconds 31 years 40
  • 41. On polynomial vs. exponential time Suppose that we could carry out 1 trillion steps per second, and instantaneously eliminate 99.9999999% of all solutions as not worth considering # of nodes n = 70, n = 80, n = 90 n = 100 1,000 n10 steps 2.82 seconds 10.74 seconds 34.86 seconds 100 seconds 2n steps 1 second 17 minutes 12 days 31 years 41
  • 42. Overview of today’s lecture Eulerian cycles Network Definitions Network Applications Introduction to computational complexity 42
  • 43. Upcoming Lectures Lecture 2: Review of Data Structures  even those with data structure backgrounds are encouraged to attend. Lecture 3. Graph Search Algorithms.  how to determine if a graph is connected  and to label a graph  and more 43
  • 44. MITOpenCourseWare http://ocw.mit.edu 15.082J / 6.855J / ESD.78J Network Optimization Fall 2010 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

Editor's Notes

  • #21: This is a good time to discuss homework rules and what will be involved. It is also a good time to mention the project.
  • #31: See if I can tie this back to the student’s comments about thesis work.