Sei sulla pagina 1di 46

Lecture Day 6

Networks
Shortest-Route Problem

Minimum Spanning Tree Problem


Maximal Flow Problem

Networks

What is a
Network?

A network is a collection
of nodes or points
connected by arcs.

Many real-world problems


have a network structure or
can be modeled in network
form.

Why are
Networks
important?

Examples:
Physical distribution systems
Communication networks
Pipeline systems
City streets and traffic signals
Airline flight legs
Production assembly line systems

Network models are important


due to their solution efficiency.
Network models are at the
problem-solving frontiers
in terms of problem size and
solution speed.

The
Shortest-Route
Problem

The objective of this algorithm


is to find the shortest route
along arcs from one node
to one or more other nodes
in the network.

(The arcs usually represent


distances, but can also
represent times or costs).

This algorithm consists of two


parts, a labeling procedure
to determine the shortest
distance from the first node
to every other node, and a
backtracking procedure
to determine the actual route
from the first node to any other
node.

Example

Assuming that Node 1 is the


Head Office (HO) and the
other nodes represent the
companys branch offices
The objective is to determine
the shortest distance from the
HO to any of the branch offices
40

2
5

10
1

15

12

3
8
4

6
20

1.

Compute the distance from the


first node to all other nodes
that are connected directly to
the first node. Label the nodes
temporarily.

Steps Involved

40

The labels for the

nodes consist of an
ordered pair of
numbers, where the
first number indicates
the distance from the
first node, and the
second number
indicates the preceding
node on the route from
the first node.

2
5

10
1

15

12

3
8
4

6
20

2.

Steps Involved

(20, 1)

The labels for the

nodes consist of an
ordered pair of
numbers, where the
first number indicates
the distance from the
first node, and the
second number
indicates the preceding
node on the route from
the first node.

Set the distance portion of the


temporarily labeled nodes equal
to the distance to the first
node. Set the predecessor
portion of their labels equal to
node 1.
40

2
5

10
1

15

(15, 1)

12

8
4

(25, 1)

6
20

3.

Steps Involved

Permanently label the temporarily


labeled node whose distance from
node 1 is minimum. Break ties
(if any) arbitrarily.

(20, 1)

40

2
5

10
1

15

(15, 1)

12

8
4

(25, 1)

6
20

4.

Steps Involved

Identify all unlabeled or temporarily


labeled nodes that can be reached
directly from the new permanently
labeled node. Compute the new

distance for the node reached


by adding the distance label
of the permanently labeled node
to the distance from the permanently
labeled node to the node in question.
If the node in question is unlabeled,
temporarily label it with the newly
calculated distance. If the node in

question is already temporarily


labeled, update its current distance
label only if the newly calculated
distance is less that its previous
distance label. For any node whose
distance label is updated, set its
predecessor label equal to the new
permanently labeled node.

(20, 1)

40

2
5

10

15

(15, 1)

12

(25, 1)

6
20

(20, 1)

40

2
5

10

15

(15, 1)

12

(23, 3)

6
20

(45, 3)

(60, 2)

(20, 1)

40

2
5

10

15

(15, 1)

(40, 2)
12

(23, 3)

6
20

(45, 3)

(60, 2)

(20, 1)

40

2
5

10

15

(15, 1)

(40, 2)
12

(23, 3)

6
20

(45, 3)

(60, 2)

(20, 1)

40

2
5

10

15

(15, 1)

(40, 2)
12

(23, 3)

6
20

(43, 4)

(60, 2)

(20, 1)

40

2
5

10

15

(15, 1)

(40, 2)
12

(23, 3)

6
20

(43, 4)

(49, 5)

(20, 1)

40

2
5

10

15

(15, 1)

(40, 2)
12

(23, 3)

6
20

(43, 4)

(49, 5)

(20, 1)

40

2
5

10

15

(15, 1)

(40, 2)
12

(23, 3)

6
20

(43, 4)

5. After the labeling


process, each node
other than node 1
will have a
permanent distance
and predecessor label.

To determine the
shortest route from
node 1 to any other
node, say node j,
refer to the
predecessor label for
node j until you reach
back to node 1.

(49, 5)

(20, 1)

40

2
5

10

15

(15, 1)

(40, 2)
12

(23, 3)

6
20

(43, 4)

Shortest Route
Application

Consider a capital equipment leasing


decision in which a company must
choose between leasing new
equipment at higher leasing costs or
maintaining old equipment at higher
operating and maintenance costs.
Assume a four-year planning
horizon

Some possible alternatives:


1. Lease a new piece of
equipment at the beginning of
the first year and keep it until
the end of the fourth year.
2. Lease a new equipment each
year.
C15
C24

C12

C13

C23

C25
C34

C14

C35

C45

The
Minimum
Spanning Tree
Problem

This algorithm involves the


selection of a set of arcs that
will span (connect) all nodes of
a network and will minimize the
sum of the arc lengths. This
differs from the shortest-route
problem in that the arcs of the
network do not yet exist and
are still to be selected.

The
Minimum
Spanning Tree
Problem

This problem is particularly


useful in designing
transportation systems in which
the nodes of the network are
terminals and the arcs
represent highways, pipelines,
airways, etc. This is also
applicable to communication
and teleprocessing systems.

The
Minimum
Spanning Tree
Problem

The type of structure that will


connect all nodes in a network
and be of minimal length is a
tree. A tree is a graph in which
the arcs connect all nodes
(that is, provide paths along
which one node can eventually
reach any other node) and
form no closed loops.
A tree has the property that if it
spans a network graph with n
nodes, the tree will always
contain n-1 arcs.

The
Minimum
Spanning Tree
Problem

The minimum spanning tree


algorithm is a type of greedy
algorithm because each step
being greedy, that is, selecting
the minimal-length arc, will
lead to an optimal solution.
This type of problem cannot be
solved as an LP problem.

Example

Assuming that the nodes


represent dams and the arcs
are potential pipeline
connections (in miles)
The objective is to determine
the shortest length of pipes
necessary to connect the dams
2

80

120

90

200

Steps Involved:
1. Start with any node and select the shortest arc
leading to any other node. This forms a
connected segment of two nodes.
2. Select the shortest arc leading from the
connected segment to the unconnected segment
of arcs.
3. Add the unconnected node of the newly selected
arc to the list of connected nodes and delete it
from the list of unconnected nodes. If all nodes
are connected, stop; otherwise, go back to
Step 2.

80

120

90

200

80

120

90

200

80

120

90

200

80

120

90

200

80

120

90

200

80

120

90

200

80

120

90

200

Shortest length of pipes needed = 360 miles

The
Maximal Flow
Problem

The objective of this algorithm


is to determine the maximum
amount of flow (fluid, traffic,
information, etc.) that can be
transmitted through the nodes
and arcs of a network.
This algorithm has applications
in areas such as the study of
traffic flow, pipeline design,
communication network design,
and distribution systems. It is
particularly helpful in capacity
planning for these types of
systems.

The
Maximal Flow
Problem

In this algorithm, we assume a


single input node called the
source and a single output
node called the sink; all flows
commence at the source and
terminate at the sink.
The maximal flow is characterized
by the arcs of the network having
finite capacities that limit the
amount of flow that can pass
through the arc in a given amount
of time. The problem is to
determine the amount of flow
across each arc (subject to
capacity restrictions) that will
permit the maximal total flow from
source to sink.

Assuming that this is the street


network of a small village
where Node 1 is the entrance
and Node 7 is the exit.
The objective is to determine
the number of cars that the
network can accommodate.

Example

5
2

2
4

Steps Involved:
1. Find a path from source node to sink node with
positive flow capacity. If no paths with positive flow
capacity exist, stop, for the current flows are optimal.
2. Determine the arc in the path with minimum flow
capacity, Cmin. Increase the flow along the path by
Cmin.

The maximum amount that can flow from source to

sink along a given path is equal to the minimum


available capacity on any arc in the path.

3. Decrease the capacities in the direction of flow by Cmin


for all arcs in the path. Increase the capacities in the
opposite direction by Cmin for all arcs in the path. Go
back to Step 1.

5
2

2
4
Path

1-3-7

Cmin

5
2

2
4
Path

1-3-7
1-2-5-7

Cmin

4
2

5
2

2
4
Path

1-3-7
1-2-5-7
1-4-6-7

Cmin

4
2
2

5
2

2
4
Path

1
1
1
1

3
2
4
2

7
5-7
6-7
3-6-7

Cmin

4
2
2
1

5
2

2 0

6 4

2
4
Path

1
1
1
1

3
2
4
2

7
5-7
6-7
3-6-7

Cmin

4
2
2
1

6
Path

1-3-5-7

Cmin

5
2

2 0

6 4

2
4
Path

1
1
1
1

3
2
4
2

7
5-7
6-7
3-6-7

Cmin

4
2
2
1

6
Path

1-3-5-7
1-4-3-6-7

Cmin

2
2

5
2

2 0

6 4

2
4
Path

1
1
1
1

3
2
4
2

7
5-7
6-7
3-6-7

Cmin

4
2
2
1

6
Path

1-3-5-7
1-4-3-6-7

Cmin

2
2
13

End of Lecture Day 6

Potrebbero piacerti anche