For the graph pictured below, complete two things:
a. The list of edges, in tabular form, of the MST for Kruskal's Algorithm.
b. The list of edges, in tabular form, of the MST for Prim's Algorithm. Start from vertex 8.
8 14
2. Answer:
a. How does Kruskal's Algorithm implement cycle detection?
b. How does Prim's Algorithm implement cycle detection?
c. What would happen if you tried to use Prim's Algorithm cycle detection in Kruskal's Algorithm? Demonstrate by completing the above graph for Kruskal's Algorithm but use errors in the MST occurs.
3. What happens if you apply Kruskal and Prim's algorithm to a directed graph? In the event that one of them does not work, reproduce the algorithm and highlight where the error occurs and use it to explain your answer.
4. Reproduce the code for Prim's Algorithm and Eager Prim's Algorithm. Explain the differences in these two implementations by highlighting the changed parts (from naive to eager) and explain how this affects space and time complexities. Explain all of the changes, including the switch from vertices to edges.