

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


First, we start with some technical information. Recall the definition of a network model: G = (N, A). Suppose there are n nodes.
Path A path P in G is a sequence of nodes connected by edges in the network. In our study of Minimum Cost Path problems, we identified methods for determining the minimum cost paths in G from a given starting node s to all other nodes in the network.
Cycle A cycle is a set of edges that forms a closed loop in G; you can begin walking at some node, follow only edges in the cycle regardless of their direction, and then return to that node. Thus, a cycle C is a sequence of nodes, connected by edges, that are unique except that the first and last nodes in the sequence are the same.
Trees A tree T in G is a collection of edges such that all n nodes are connected, and no cycles exist. (All nodes connected implies the existence of a path between all pairs of nodes on T .) An equivalent definition of a tree is a set of n − 1 edges such that all nodes are connected. An important property of a tree is that it defines, for each pair of nodes, a unique path between them.
Minimum spanning tree A minimum spanning tree T ∗^ in a network where each edge (i, j) has a cost cij is a tree such that the total cost (sum) of all the arcs in the tree is minimized.
Question: Is the minimum spanning tree the same as the shortest path tree?
Answer: No. In the shortest path tree, the length of the path from some origin node to each other node is minimized. In the minimum spanning tree, the total cost of all the arcs in the tree is minimized. This is not the same thing.
Finding the minimum spanning tree Two algorithms that you can use. Both of them are quite fast, and easy to understand.
Kruskal’s algorithm
Initialization: T REE = ∅
Iterations:
(a) Add (i, j) to T REE if so doing does not create a cycle (b) If (number of edges in T REE) = n − 1, STOP.
At the end, T ∗^ ← T REE.
Basically, Kruskal’s algorithm looks at the lowest cost edges first and tries to include them in the tree, as long as doing so does not create a cycle (which would prevent a tree from being formed).
Prim’s algorithm
Initialization:
T REE = ∅
LIST = { 1 }
(In English, the set LIST contains node 1, while the set T REE is empty)
Iterations:
Do until (number of edges in T REE) = n − 1:
At the end, T ∗^ ← T REE.
Prim’s algorithm works by keeping a tree on a subset of the nodes and in each iteration expanding the tree to include another node at minimum cost.