Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge pull request #1 from careermonk/master #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spaden
Copy link

@spaden spaden commented Sep 20, 2019

Prims and Dijkstra's Algorithm heapq change

Add this method to Vertex class, since heapq doesn't support addition of class objects inside typles

def lt(ob1, ob2):
return ob1.getDistance() < ob2.getDistance()

For the Bellman-Ford Algorithm, the for loop is not needed. It just increases the compelxity
#Delete this line
for i in range(len(G) - 1):

Prims and Dijkstra's Algorithm heapq change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant