0% found this document useful (0 votes)
107 views

4 - Networks Model and Shortest Path

1. The document outlines Dijkstra's algorithm for finding the shortest path in a network. 2. It provides examples to demonstrate how the algorithm works by selecting the next closest node at each step. 3. The algorithm initializes costs and predecessors for all nodes, then updates the costs and predecessors of neighboring nodes if a shorter path is found at each step.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views

4 - Networks Model and Shortest Path

1. The document outlines Dijkstra's algorithm for finding the shortest path in a network. 2. It provides examples to demonstrate how the algorithm works by selecting the next closest node at each step. 3. The algorithm initializes costs and predecessors for all nodes, then updates the costs and predecessors of neighboring nodes if a shorter path is found at each step.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

1.

225J
1.225J (ESD 225) Transportation Flow Systems

Lecture 4

Introduction to Network Models


and
Shortest Paths

Profs. Ismail Chabini and Amedeo Odoni

Lecture 4 Outline

‰ Conceptual Networks: Definitions


‰ Representation of an Urban Road Network (Supply)
‰ Shortest Paths (Reading: pp. 359-367, 6.2.3 and 6.2.4 of R6)
• Introduction
• Dijkstra’s algorithm: example
• Dijkstra’s algorithm: statement
• Observations
‰ Extensions to Classical Shortest Path Problems
‰ All-or-nothing traffic assignment
‰ Zoning and Analysis Periods (Demand)
‰ Motivation for more advanced traffic assignment models
‰ Summary

1.225, 11/07/02 Lecture 4, Page 2

1
Conceptual Networks: Definitions
‰ A network is:
• a set of nodes N and a set of links A
• nodes are also called vertices or points
• links are also called arcs or edges
‰ Examples:
Net 1 Net 2
1 2
1 2
3
3 4
4 5

‰ Directed networks: all links are directed


‰ Path: a sequence of links from one node to another node
(i.e., (5,4)-(4,3)-(3,2))
‰ A network is connected if there is at least one path from one node to
another node (Net1 is connected whereas Net2 is not)
1.225, 11/07/02 Lecture 4, Page 3

Representation of an Urban Road Network


‰ Physical ‰ Conceptual
Intersections Nodes
Streets Links
Zones Centroids

‰ Simple node representation

1.225, 11/07/02 Lecture 4, Page 4

2
Intersection Representations
‰ Simple node representation:
• no direction differenciation
• no conflicting movement

‰ Subnetwork representation:
• explicit direction representation
• conflicting turns in an intersection
are captured by internal links and
their impedances
‰ Conceptual representation is not unique and
depends on:
• type of analysis
• data availability to build, validate, and apply model
• accuracy vs. computation time trade-off
1.225, 11/07/02 Lecture 4, Page 5

Shortest Path Problems


‰ Basic problem: find a shortest path and the shortest distance between
two nodes
‰ Basic problem is called the one-to-one shortest path problem
‰ Types of shortest path problems:
• One-to-one
• One-to-all: find shortest paths from one node to all nodes
• All-to-one: find shortest paths from all nodes to one node
• Many-to-many: find shortest paths from many nodes to many
other nodes
• All-to-all: find shortest paths from all node pairs
‰ “Shortest” also denotes minimum general cost
‰ There are hundreds of shortest path algorithms, but they are similar
‰ Some algorithms work for non-negative costs only

1.225, 11/07/02 Lecture 4, Page 6

3
Dijkstra’
Dijkstra’s Shortest Paths Algorithm: Example

7
Mixed network b f 6
3 5 5 5 h
2
1
a c e j
8 8
1
6
5 2 6
i
d g 4
4
7
Directed network b f 6
3 5 5 h
5 2
1
a c e j
8
8
1
6 6
5 2
i
d g 4
4

1.225, 11/07/02 Lecture 4, Page 7

First Shortest Path Algorithm (Dijkstra


(Dijkstra’’s Algorithm)

‰ Notation:
• s: source node
• d(j): length of shortest path from s to j discovered so far
• p(j): immediate predecessor to node j on shortest path from s to j
discovered so far
• k: last node selected by algorithm

‰ Step 1: Initialization
• d(s) = 0, p(s) = *
• d(j) = ∝, p(j) = -, for all other nodes j ≠ s
• k=s

1.225, 11/07/02 Lecture 4, Page 8

4
Dijkstra’
Dijkstra’s Shortest Paths Algorithm: Example
7 (∝,-)
(3,a)+
1st iteration b f 6
(∝,-)
3 5 5 h
5 2
(∝,-)
(0,*)+ 1
a c e j (∝,-)
(8,-) 8
8
1
6 6
5 2
i
d g 4 (∝,-)
(5,-) 4 (∝,-)

7 (10,-)
2nd iteration (3,a)+ b f 6
(∝,-)
3 5 5 h
5 2
(∝,-)
(0,*)+ 1
a c e j (∝,-)
(8,-) 8
8
1
6 6
5 2
i
d g 4 (∝,-)
(5,a)+ 4 (∝,-)

1.225, 11/07/02 Lecture 4, Page 9

First Shortest Path Algorithm (Dijkstra


(Dijkstra’’s Algorithm)
‰ Step 2: Update labels of neighbors in open state
• For all (k, j), if j is open do:
If d(j) < d(k) + l(k, j) then
d(j) = d(k) + l(k, j)
p(j) = k
‰ Step 3
• Find a open state node i such that d(i) = min{d(j), j is an open node)}
‰ Step 4
• Find a closed state node j* such that d(i) = d(j*) + l(j*,i)
‰ Step 5
• Node i is closed. If no node in open state , STOP.
Otherwise k = i, return to Step 2

1.225, 11/07/02 Lecture 4, Page 10

5
Shortest Paths Algorithm: Example
7 (10,-)
3rd iteration (3,a)+ b f 6
(∝,-)
3 5 5 h
5 2
(∝,-)
(0,*)+ 1
a c e j (∝,-)
(7,d)+ 8
8
1
6 6
5 2
i
d g 4 (∝,-)
(5,a)+ 4 (9,-)

7 (10,-)
4th iteration (3,a)+ b f 6
(∝,-)
3 5 5 h
5 2
(15,-)
(0,*)+ 1
a c e j (∝,-)
(7,d)+ 8
8
1
6 6
5 2
i
d g 4 (∝,-)
(5,a)+ 4 (9,d)+

1.225, 11/07/02 Lecture 4, Page 11

Shortest Paths Algorithm: Example


7 (10,b)+
5th iteration (3,a)+ b f 6
(∝,-)
3 5 5 h
5 2
(15,-)
(0,*)+ 1
a c e j (∝,-)
(7,d)+ 8
8
1
6 6
5 2
i
d g 4 (13,-)
(5,a)+ 4 (9,d)+

7 (10,b)+
6th iteration (3,a)+ b f 6
(16,-)
3 5 5 h
5 2
(15,-)
(0,*)+ 1
a c e j (∝,-)
(7,d)+ 8
8
1
6 6
5 2
i
d g 4 (13,g)+
(5,a)+ 4 (9,d)+

1.225, 11/07/02 Lecture 4, Page 12

6
Shortest Paths Algorithm: Example
7 (10,b)+
7th iteration (3,a)+ b f 6
(16,-)
3 5 5 h
5 2
(14,i)+
(0,*)+ 1
a c e j (19,-)
(7,d)+ 8
8
1
6 6
5 2
i
d g 4 (13,g)+
(5,a)+ 4 (9,d)+

7 (10,b)+
8th iteration (3,a)+ b f 6
(15,e)+
3 5 5 h
5 2
(14,i)+
(0,*)+ 1
a c e j (∝,-)
(7,d)+ 8
8
1
6 6
5 2
i
d g 4 (13,g)+
(5,a)+ 4 (9,d)+

1.225, 11/07/02 Lecture 4, Page 13

Shortest Paths Algorithm: Example


7 (10,b)+
9th iteration (3,a)+ b f 6
(15,e)+
3 5 5 h
5 2
(14,i)+
(0,*)+ 1
a c e j (17,h)+
(7,d)+ 8
8
1
6 6
5 2
i
d g 4 (13,g)+
(5,a)+ 4 (9,d)+

7 (10,b)+
(3,a)+ b f
Shortest-path tree
(15,e)+
3 h
2
(14,i)+
(0,*)+ 1
a c e j (17,h)+
(7,d)+
1
5 2
i
d g 4 (13,g)+
(5,a)+ 4 (9,d)+
1.225, 11/07/02 Lecture 4, Page 14

7
Observations about Dijkstra’
Dijkstra’s Algorithm

‰ Dijkstra’s algorithm is in general not valid if some l(i, j) < 0


‰ Shortest paths form a tree
‰ The algorithm can also solve the all-to-one problem
‰ If you solve for a one-to-many problem, stop the algorithm when all
destination nodes are closed
‰ Shortest path problem is an LP problem, but it is more efficient and
intuitive to look at it as a network problem as we did in class

1.225, 11/07/02 Lecture 4, Page 15

Extensions of Shortest Path Problem

‰ There is a huge number of potential extensions of the classical


shortest path problem
‰ Problems on dynamic networks (link lengths change over time)
‰ Problems on probabilistic networks (link lengths are random
variables assuming discrete values or a continuous range of values)
‰ Combinations thereof
‰ Solutions to these problems depend on the assumptions regarding the
state of knowledge and on the relative magnitude of the parameters
involved
‰ The meaning of “shortest path” is also an issue in some cases

1.225, 11/07/02 Lecture 4, Page 16

8
A Traffic Assignment Problem

2
2

1
4 1

8 4
1 4 5

2
3 1 2 3 4 5
6
1 - 30 35 40 15
3 2 10 - 15 12 10
3 50 40 - 35 20
4 25 30 35 - 40
5 45 30 35 40 -
1.225, 11/07/02 Lecture 4, Page 17

“All-
All-or-
or-nothing”
nothing” Traffic Assignment
130

47
85
2
115
130
235
52 127
120 130
150
1 4 5

130 85
50 180
170
35

3 Does this make


120
145
sense?

1.225, 11/07/02 Lecture 4, Page 18

9
Traffic Assignment Models
‰ Conceptual definition:

(input) Supply/Demand (input)


Supply Demand
Interaction
• Network representation of • Origin-destination flows
transportation network • Zoning
• Link performance functions output

Flows and Travel Times

‰ Principles of assignment to represent the interaction


• User Optimal (U.O.): O-D flows are assigned to paths with
minimum travel time
• System Optimal (S.O.): O-D flows are assigned such that total
travel time on the network is minimum
1.225, 11/07/02 Lecture 4, Page 19

Zoning
‰ Physical zones ‰ Zone-to-zone Flows
10 11 12
Zone 1 Zone 2 Zone 3 Zone 4
Zone 1 Zone 2 Zone 1 0 90 120 80
13 14 15 Zone 2 100 0 60 130
Zone 3 Zone 4 Zone 3 120 180 0 50
16 17 18
Zone 4 40 70 150 0

‰ Centroid nodes and Connectors ‰ O/D Flows


10 11 12
1 2 3 4
1 2 1 0 90 120 80
13 14 15 2 100 0 60 130
3 4 3 120 180 0 50
16 17 18
4 40 70 150 0

1.225, 11/07/02 Lecture 4, Page 20

10
Analysis Periods
flows

time of day
Morning-peak Midday period Evening-peak
period period

‰ Over an analysis period, flows are assumed constant in order for steady-
state analysis to apply
‰ The duration of a period is longer than a trip
‰ Typical analysis periods: morning-peak, midday, evening-peak
1.225, 11/07/02 Lecture 4, Page 21

Lecture 4 Summary

‰ Conceptual Networks: Definitions


‰ Representation of an Urban Road Network (Supply)
‰ Shortest Paths (Reading: pp. 359-367, 6.2.3 and 6.2.4 of R6)
• Introduction
• Dijkstra’s algorithm: example
• Dijkstra’s algorithm: statement
• Observations
‰ Extensions to Classical Shortest Path Problems
‰ All-or-nothing traffic assignment
‰ Zoning and Analysis Periods (Demand)
‰ Motivation for more advanced traffic assignment models

1.225, 11/07/02 Lecture 4, Page 22

11

You might also like