question 2 (20 points)\nlisten\nthe following graph represents the computers in an office building and the…

question 2 (20 points)\nlisten\nthe following graph represents the computers in an office building and the length of wire needing to connect them in yards. use kruskals algorithm to connect all the computers.\ndetermine the total amount of wire needed to connect the computers.
Answer
Explanation:
Step1: List all edges and their weights
We have the following edges and weights: ((v_1,v_2,9),(v_1,v_3,12),(v_2,v_3,8),(v_2,v_4,4),(v_2,v_5,7),(v_3,v_5,5),(v_3,v_6,2),(v_4,v_5,2),(v_4,v_7,10),(v_5,v_6,11),(v_5,v_7,2),(v_5,v_8,4),(v_7,v_8,4),(v_7,v_9,3),(v_8,v_9,13))
Step2: Sort edges by weight in ascending order
((v_3,v_6,2),(v_4,v_5,2),(v_5,v_7,2),(v_2,v_4,4),(v_5,v_8,4),(v_7,v_8,4),(v_7,v_9,3),(v_2,v_5,7),(v_3,v_5,5),(v_1,v_2,9),(v_1,v_3,12),(v_4,v_7,10),(v_5,v_6,11),(v_8,v_9,13))
Step3: Select edges for the minimum - spanning tree
Start adding edges one by one as long as they don't create a cycle.
- First, add ((v_3,v_6)) with weight 2.
- Then add ((v_4,v_5)) with weight 2.
- Then add ((v_5,v_7)) with weight 2.
- Then add ((v_7,v_9)) with weight 3.
- Then add ((v_2,v_4)) with weight 4.
- Then add ((v_5,v_8)) with weight 4.
Step4: Calculate the total weight
The total weight of the selected edges is (2 + 2+2 + 3+4 + 4=17)
Answer:
17