Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following graph G with non - negative edge weights. 1 2 a s b c e d 1 2 3 1 0 2

Consider the following graph G with non-negative edge
weights.
12 a s
b c e
d
123
10206
7
118
(a)(6 points) 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 exec

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

Students also viewed these Databases questions