prints adjacency list representation of graaph >>> g = Graph() >>> g.print_graph() >>> g.add_edge(0, 1) >>> g.print_graph() 0 : 1
(self)
| 12 | self.vertices: dict[int, list[int]] = {} |
| 13 | |
| 14 | def print_graph(self) -> None: |
| 15 | """ |
| 16 | prints adjacency list representation of graaph |
| 17 | >>> g = Graph() |
| 18 | >>> g.print_graph() |
| 19 | >>> g.add_edge(0, 1) |
| 20 | >>> g.print_graph() |
| 21 | 0 : 1 |
| 22 | """ |
| 23 | for i in self.vertices: |
| 24 | print(i, " : ", " -> ".join([str(j) for j in self.vertices[i]])) |
| 25 | |
| 26 | def add_edge(self, from_vertex: int, to_vertex: int) -> None: |
| 27 | """ |
no outgoing calls
no test coverage detected