Skip to content

Commit

Permalink
add edge method
Browse files Browse the repository at this point in the history
  • Loading branch information
txiong000 committed Feb 4, 2019
1 parent 99b8b9a commit 2a06c29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion projects/graph/backup/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def __init__(self):
def add_vertex(self, vertex):
self.vertices[vertex] = set()
pass
def add_edge(self):
def add_edge(self, vert_1, vert_2):
self.vertices[vert_1].add(vert_2)
self.vertices[vert_2].add(vert_1)
pass

0 comments on commit 2a06c29

Please sign in to comment.