Question: Use Prim s algorithm to compute the minimum spanning tree of G . You can use the following table to describe the execution of the

Use Prims algorithm to compute the minimum spanning tree of G.
You can use the following table to describe the execution of the algorithm. The algorithm maintains a set S of vertices. The d value of a vertex v / in S is minu in S:(u,v) in E w(u, v).
The \pi value of a vertex v is the vertex u in S such that d(v)= w(u, v); if d(v)=\infty ,
then \pi (v)=.
You can try to complete the value of the table following the Prim algorithm in
our lecture notes, the edges in the MST are , and the total weight is
.
1
iteration vertex added to S a b c d e
d \pi d \pi d \pi d \pi d \pi
1 s 12 s \infty 20 s \infty 6 s
2
3
4
5
Table 1: Prims Algorithm for Minimum Spanning Tree
(b)(6 points) Use Dijkstras algorithm to compute the shortest paths from s to all
other vertices in G.
You can use the following table to describe the execution of the algorithm on the
instance. The algorithm maintains a set S of vertices. The d value of a vertex v / in S
is minu in S:(u,v) in E(d(u)+ w(u, v)). The \pi value of a vertex v is the vertex u in S such
that d(v)= d(u)+ w(u, v); if d(v)=\infty , then \pi (v)=.
iteration vertex added to S a b c d e
d \pi d \pi d \pi d \pi d \pi
1 s 12 s \infty 20 s \infty 6 s
2
3
4
5
Table 2: Dijkstras algorithm for Shortest Paths
The parents of vertices are:
a b c d e
parent
You can try to complete the value of the above two tables following the Dijkstras
algorithm in our lecture notes. The shortest paths to a is , and the length
is ; The shortest paths to b is , and the length is ;
The shortest paths to c is , and the length is ; The shortest
paths to d is , and the length is ; The shortest paths to e is
, and the length is

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!