Answered step by step
Verified Expert Solution
Question
1 Approved Answer
( 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started