>>> graph = Graph(2) >>> graph.vertices 2 >>> len(graph.graph) 2 >>> len(graph.graph[0]) 2
(self, vertices: int)
| 3 | |
| 4 | class Graph: |
| 5 | def __init__(self, vertices: int) -> None: |
| 6 | """ |
| 7 | >>> graph = Graph(2) |
| 8 | >>> graph.vertices |
| 9 | 2 |
| 10 | >>> len(graph.graph) |
| 11 | 2 |
| 12 | >>> len(graph.graph[0]) |
| 13 | 2 |
| 14 | """ |
| 15 | self.vertices = vertices |
| 16 | self.graph = [[0] * vertices for _ in range(vertices)] |
| 17 | |
| 18 | def print_solution(self, distances_from_source: list[int]) -> None: |
| 19 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected