Question

Consider the following weighted undirected graph.


Consider the following weighted undirected graph. 

image.png

(a) Explain why edge (B, D) is safe. In other words, give a cut where the edge is the cheapest edge crossing the cut. 

(b) We would like to run the Kruskal's algorithm on this graph. List the edges appearing in the Minimum Spanning Tree (MST) in the order they are added to the MST. For simplicity, you can refer to each edge as its weight. 

(c) 1We would like to run the Prim's algorithm on this graph using A as initial vertex. List the edges appearing in the Minimum Spanning Tree (MST) in the order they are added to the MST. For simplicity, you can refer to each edge as its weight.

3 0
Add a comment Improve this question Transcribed image text
Answer #1

a)

The edge (B,D) is safe because it is a part of minimal spanning tree and its removal leads to making the a new edge in minimum spanning tree.that means the weight of edge used instead of edge(B,D) will be higher

b)

Order of adding :

The edges are listed based on the increasing order:

BE,AD,DG,BD,GE,AF,FG,AB,FD,EC,EH,CH,BC,GH

as per the algorithm there is n-1 edges in the minimum spanning tree,where n is the number of edges.

from the above list edges are considered in the increasing order of their weights.

if the edge is the edge with minimum weight and its including doesn't form any cycle then the edge is added to the list edges of minimum spanning tree.

BE,AD,DG,BD,AF,EC,EH

C)

Order of adding:

Edge starting from the vertex A is considered.edge with minimum weight starting from A is considered.the process is repeated without forming any cycles untill number of edges is n-1 where n is the number of vertices.

In this case edge AD is the minimum weighted edge.all the edges from both these vertex is considered in the next iteration.

AD,DG,BD,BE,AF,EC,EH

hope the answer is satisfactory

any doubts please comment

please give me a thumbs up

answer is updated.

Add a comment
Know the answer?
Add Answer to:
Consider the following weighted undirected graph.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problem A: Consider the following graph.

    Problem A: Consider the following graph. (a). Find a minimum spanning tree of the graph using Kruskal's algorithm. List the edges in the order they are put into the tree. (b). Apply Prim's algorithm to the same graph starting with node A. List the edges, in order added to the MST. (c). Suppose the cost of every edge touching node A is increased by a constant. Are we guaranteed that the MST remains the MST? Explain.

  • 3. In this problem, you will show the execution of the minimum spanning tree algorithms that...

    3. In this problem, you will show the execution of the minimum spanning tree algorithms that you studied in class on the following graph: START 10 40 5 20 35 15 6 30 62 12 (a) (5 points) Trace the execution of Prim's algorithm to find the minimum spanning tree for this graph. At each step, you should show the vertex and the edge added to the tree and the resulting values of D after the relaxation operation. Use START...

  • You are given an undirected graph G with weighted edges and a minimum spanning tree T of G.

    You are given an undirected graph G with weighted edges and a minimum spanning tree T of G. Design an algorithm to update the minimum spanning tree when the weight of a single edge is increased. The input to your algorithm should be the edge e and its new weight: your algorithm should modify T so that it is still a MST. Analyze the running time of your algorithm and prove its correctness.

  • You are given an undirected graph G with weighted edges and a minimum spanning tree T of G.

    You are given an undirected graph G with weighted edges and a minimum spanning tree T of G. Design an algorithm to update the minimum spanning tree when the weight of a single edge is decreased. The input to your algorithm should be the edge e and its new weight; your algorithm should modify T so that it is still a MST. Analyze the running time of your algorithm and prove its correctness.

  • Given the following weighted graph G. use Prim's algorithm to determine the Minimum-Cost Spanning Tree (MCST)...

    Given the following weighted graph G. use Prim's algorithm to determine the Minimum-Cost Spanning Tree (MCST) with node 1 as the "root". List the vertices in the order in which the algorithm adds them to the solution, along with the edge and its weight used to make the selection, one per line. Each line should look like this: add vertex y: edge = (x,y), weight = 5 When the algorithm ends there are, generally, edges left in the heap. List...

  • Consider the following weighted graph G:

    Consider the following weighted graph G: Use Prim's algorithm to find a minimal spanning tree T of this graph starting at the vertex s. You do not need to show every step of the algorithm, but to receive full credit you should: list the edges of T in the order in which they're added; redraw G and indicate which edges belong to T; compute the cost of T.

  • Consider the weighted graph below: Demonstrate Prim's algorithm starting from vertex A. Write the edges in...

    Consider the weighted graph below: Demonstrate Prim's algorithm starting from vertex A. Write the edges in the order they were added to the minimum spanning tree. Demonstrate Dijkstra's algorithm on the graph, using vertex A as the source. Write the vertices in the order which they are marked and compute all distances at each step.

  • Given a graph below draw MST in BOLD using either Kruskal's or Prim's algorithm. How many...

    Given a graph below draw MST in BOLD using either Kruskal's or Prim's algorithm. How many edges are in MST? _ What is the length of MST? _ What are the neighbors in the minimum spanning tree (MST) of the node a _ and the node f _

  • Problem 3's picture are given below. 5. (a) Let G = (V, E) be a weighted connected undirected simple graph. For n...

    Problem 3's picture are given below. 5. (a) Let G = (V, E) be a weighted connected undirected simple graph. For n 1, let cycles in G. Modify {e1, e2,.. . ,en} be a subset of edges (from E) that includes no Kruskal's algorithm in order to obtain a spanning tree of G that is minimal among all the spanning trees of G that include the edges e1, e2, . . . , Cn. (b) Apply your algorithm in (a)...

  • Run Prim (starting from vertex "f") and Kruskal algorithms on the graph below: 3 2 9...

    Run Prim (starting from vertex "f") and Kruskal algorithms on the graph below: 3 2 9 3 . (5 points) Prim's algorithm: draw a table that shows the vertices in the queue at each iteration, similar to example from the notes (2 points) Prim's algorithm: using the table from the first part, list the order in which edges are added to the tree (3 points) Kruskal's algorithm: list the order in which edges are added to the tree

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT