Click this link to download an archive containing the Xcode project with my code for Dijkstra's algorithm. You are going to use this code as the starting point for the assignment.
Rewrite the code for this example program to implement Prim's algorithm instead of Dijkstra's algorithm. Remove the dijkstra() method from the graph class and replace it with a prim() method. Note that Prim's algorithm assumes an undirected graph. You can use the edge and vertex classes I provided to implement an undirected graph by representing each undirected edge in the graph as a pair of directed edges running in opposite directions. The prim() method should print a list of edges in the MST to the console as it runs.
You will also need to replace the contents of the vertices.txt and edges.txt files. Replace them with a pair of files that describe the graph that appears in figure 21.5 in the textbook.