Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The function for finding the Minimum Spanning Tree (mst) in the minmax file seems to be in error: one of the edges is displayed twice in the mst.
I have rewritten the function for finding the mst and deleted the earlier one; the edges are now correctly displayed. Additionally, the weight of the mst is also displayed.
The MinSpanningTree branch contains this rewritten function in place of the original mst function. The difference between the output of the functions in the two versions is demonstrated with the help of an example:
g = graph()
g.add_node('A')
g.add_node('B')
g.add_node('C')
g.add_node('D')
g.add_node('E')
g.add_edge(('A', 'C'), 10, 'AC')
g.add_edge(('A', 'D'), 7, 'AD')
g.add_edge(('B', 'D'), 32, 'BD')
g.add_edge(('C', 'D'), 9, 'CD')
g.add_edge(('D', 'E'), 23, 'DE')
using the current function:{'A': 'D', 'C': 'D', 'B': 'D', 'E': 'D', 'D': 'B'}
using the new function in MinSpanningTree branch [('A', 'D'), ('D', 'C'), ('D', 'E'), ('D', 'B'), 71]