I am coding an implementation of Prim's algorithm for deriving a Minimum Spanning Tree. My Graph is a Map<String, ArrayList>
in which they keys correspond to the state name and the values are the edges which hold pointers to both links.
Prim's Algorithm says I should start with a Tree only containing the starting node then loop until my tree is equivalent to my graph. How can I determine equivalence of a TreeMap<String, ArrayList>
and Map<String, ArrayList>
?