Network Models: Minimum Spanning Tree

Network Optimization Problems:
Models and Algorithms
This handout:
• Minimum Spanning Tree Problem
Terminology of Graphs
• A graph (or network) consists of
– a set of points
– a set of lines connecting certain pairs of the points.
The points are called nodes (or vertices).
The lines are called arcs (or edges or links).
• Example:
Terminology of Graphs: Paths
• A path between two nodes is a sequence of distinct
nodes and edges connecting these nodes.
Example:
a
b
Terminology of Graphs:
Cycles, Connectivity and Trees
• A path that begins and ends at the same node is called a cycle.
Example:
•
•
•
•
Two nodes are connected if there is a path between them.
A graph is connected if every pair of its nodes is connected.
A graph is acyclic if it doesn’t have any cycle.
A graph is called a tree if it is connected and acyclic.
Example:
Minimum Spanning Tree Problem
• Given:
Graph G=(V, E), |V|=n
Cost function c: E  R .
Find a minimum-cost spanning tree for V
i.e., find a subset of arcs E*  E which
connects any two nodes of V
with minimum possible cost.
• Goal:
• Example:
2
b
3
a
4
G=(V,E)
3
d
8
5
7
c
4
e
Min. span. tree: G*=(V,E*)
3
b
d
2
8
a
3
5
7
4
e
c
4
Red bold arcs are in E*
Algorithm for solving
the Minimum Spanning Tree Problem
• Initialization: Select any node arbitrarily,
connect to its nearest node.
• Repeat
– Identify the unconnected node
which is closest to a connected node
– Connect these two nodes
Until all nodes are connected
Note: Ties for the closest node are broken arbitrarily.
The algorithm applied to our example
• Initialization: Select node a to start.
Its closest node is node b. Connect nodes a and b.
3
b
d
2
8
Red bold arcs are in E*;
a
3
5
4
c
thin arcs represent potential links.
7
4
e
• Iteration 1: There are two unconnected node closest to a
connected node: nodes c and d
3
b
d
(both are 3 units far from node b).
2
8
a
3
Break the tie arbitrarily by
5
connecting node c to node b.
7
4
e
c
4
The algorithm applied to our example
• Iteration 2: The unconnected node closest to a connected
node is node d (3 far from node b). Connect nodes b and d.
3
b
d
2
8
a
3
5
4
7
e
4
• Iteration 3: The only unconnected node left is node e. Its
closest connected node is node c
3
b
d
(distance between c and e is 4).
2
8
Connect node e to node c.
a
3
5
• All nodes are connected. The bold
7
4
e
c
arcs give a min. spanning tree.
4
c