Question: ( 5 0 ) [ Prim ' s MST algorithm: tracing ] Run the Prim's algorithm implemented using a priority queue ( see below )
Prims MST algorithm: tracing Run the Prim's algorithm implemented using a
priority queue see below against the graph shown below. Give your answers as follows.
a Run the algorithm assuming the node is picked as the start node s and show the algorithm
run trace see the specification below
b Run the algorithm assuming the node is picked as the start node and show the algorithm
run trace see the specification below
c Draw the resulting minimum spanning tree on the graph. Show the included edges in colored
or thick lines.
Specification of the algorithm run tracing: For each algorithm run tracing, show the content of
the cut S the content of the MST T and the content of the priority queue Q at the end of the
While loop in each iteration. Specifically, show the content of as a set of nodes, the content of
as a set of edges, and the content of as a set of ordered pairs of a node number and a priority
key. For ease of grading, please show the end nodes of an edge in the alphabetical order eg
and list the priority queue elements in the alphabetic order of node number. For example,
when the start node is their contents before the iteration is and
Initialize of with for each node in
Pick an arbitrary node as the start node s
SlarrTlarr
while is not empty
ExtractMin
Add to
if then add the edge to pred "predecessor"
for each edge such that inS
if
pred
ChangeKeyQ w
endwhile
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
