17
Networks and the Shortest Path Problem

Networks and the Shortest Path Problem. Physical Networks Road Networks Railway Networks Airline traffic Networks Electrical networks, e.g.,

Embed Size (px)

Citation preview

Networks and the Shortest Path Problem

Physical Networks Road Networks Railway Networks Airline traffic Networks Electrical networks, e.g., the power grid

Abstract networks organizational charts precedence relationships in projects

Others?

Networks and graphs are powerful modeling tools.

Most OR models have networks or graphs as a major aspect

Each representation has its advantages Major purpose of a representation

efficiency in algorithmsease of use

Many important optimization problems can be analyzed by means of graphical or network representation. In this chapter the following network models will be discussed:1. Shortest path problems2. Maximum flow problems3. CPM-PERT project scheduling models4. Minimum Cost Network Flow Problems5. Minimum spanning tree problems

Most efficient way to go from one point to another in a distance network or networks representing non-distance phenomenon, e.g., the “cost network” representing production, inventory, and other costsA

C

EB

D

Networks – consists of a set of points and a set of lines connecting certain points.

Nodes – The points in the network Arcs – The lines in the network Directed Arc – An arc for which flow is allowed in only one

direction Undirected Arc – An arc for which flow is allowed in both

directions Directed Network – A network with only directed arcs Undirected Network – A network with only undirected arcs Directed Path – A sequence of arcs from node i to node j such that

all arcs are directed towards node j Undirected Path – A sequence of arcs from node i to node j such

that all arcs can be directed either towards or away from node j

Cycle – A path that begins and ends at the same node Connected – Two nodes with at least one undirected path between

them Connected Network – A network where every pair of nodes is

connected Tree – A network without any cycles and with the number of

connected nodes being greater than the number of arcs Spanning Tree – A tree that is a connected network Arc Capacity – The maximum flow that can be carried on a

directed arc Supply Node – Flow out of the node exceeds flow into the node Demand Node – Flow into the node exceeds flow out of the node Transshipment Node – Flow into the node equals flow out of the

node

A minimum spanning tree is a spanning tree with minimum weight.

(a) undirected network

(b) spanning tree of (a)

(c) a tree of (a)

(d) directed network (e) tree of (d)

Consider an undirected and connected network with two special nodes called the origin and the destination.

Associated with each of the links (undirected arcs) is a nonnegative distance. The objective is to find the shortest path (the path with the minimum total distance) from the origin to the destination.

Objective of nth iteration: Find the nth nearest node to the origin (to be repeated for n = 1,2, . . . until the nth nearest node is the destination.)

Input for nth iteration: n - 1 nearest nodes to the origin (solved for at the previous iterations), including their shortest path and distance from the origin. (These nodes, plus the origin, will be called solved nodes; the others are unsolved nodes.)

Candidates for nth nearest node: Each solved node that is directly connected by a link to one or more unsolved nodes provides one candidate-the unsolved node with the shortest connecting link. (Ties provide additional candidates.)

Calculation of nth nearest node: For each such solved node and its candidate, add the distance between them and the distance of the shortest path from the origin to this solved node. The candidate with the smallest such total distance is the nearest node (ties provide additional solved nodes), and its shortest path is the one generating this distance.

Cars are not allowed into the park There is a narrow winding road system for

trams and for jeeps driven by the park rangers The road system is shown without curves in the

next slide Location O is the entrance into the park Other letters designate the locations of the ranger

stations The scenic wonder is at location T The numbers give the distance of these winding

roads in miles The park management wishes to determine

which route from the park entrance to station T has the smallest total distance for the operation of the trams

Consider an undirected and connected network with origin and destination nodes. Associated with every arc is a non-negative distance. The objective is to find the shortest path from the origin to the destination.

O

A

B

C

D

E

T2

1

2

3

4

7

41

7

5

5

4

1st iteration: Step 1: Neighboring Nodes = {A, B, C} Step 2: Shortest path from O to neighboring nodes Min {2, 5, 4} = 2 Step 3: The shortest path from O to A S = {O, A}

O

A

B

C

D

E

T2

1

2

3

4

7

41

7

5

5

4

A

B

C

B

C

2nd iteration: Step 1: Neighboring nodes = {B, C, D}

Step 2: Min (Min (2 + 2, 5), 4, (2 + 7)) = 4.

Step 3: Shortest path B to C S = {O, A, B, C}

O

A

B

C

D

E

T2

1

2

3

4

7

41

7

5

5

4

B

C

DD

3rd iteration: Step 1: Neighboring nodes = {D, E}. Only AD, BD, BE, and CE Step 2: Min(Min(2 + 7, 4+4), Min(4 + 3, 4+4)) = 7 Step 3: The shortest path to E S = {O, A, B, C, E}

O

A

B

C

D

E

T2

1

2

3

4

7

41

7

5

5

4

DD

E

4th iteration: Step 1: Include Nodes D and T. Include arcs AD, BD, ED, & ET Step 2: Min((min(2+7, 4+4, 7+1), (7+7))) = 8 Step 3: Shortest path from node O to D S = {O, A, B, C, E, D}

O

A

B

C

D

E

T2

1

2

3

4

7

41

7

5

5

4

D

TT