An alternative algorithm for finding a minimal undirected spanning tree of a graph of (n) vertices is
Question:
An alternative algorithm for finding a minimal undirected spanning tree of a graph of \(n\) vertices is called Prim's algorithm. Begin with a single vertex. At any stage, check edges not in the spanning tree that have one vertex in the current incomplete tree (and one not in it). Add the edge of smallest cost of this kind, and add the new vertex of that edge to the vertex set. Continue until the candidate has \(n-1\) edges. Write a command in Mathematica to implement Prim's algorithm, and use your command to find a minimal spanning tree in the graph of Figure 1.1.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Introduction To The Mathematics Of Operations Research With Mathematica
ISBN: 9781574446128
1st Edition
Authors: Kevin J Hastings
Question Posted: