Adds a vertex to the graph
(self, vertex)
| 9 | self.adjacency = {} |
| 10 | |
| 11 | def add_vertex(self, vertex): |
| 12 | """ |
| 13 | Adds a vertex to the graph |
| 14 | |
| 15 | """ |
| 16 | if vertex not in self.adjacency: |
| 17 | self.adjacency[vertex] = {} |
| 18 | self.num_vertices += 1 |
| 19 | |
| 20 | def add_edge(self, head, tail, weight): |
| 21 | """ |