(self, n=0)
| 3 | |
| 4 | class Graph: |
| 5 | def __init__(self, n=0): # a graph with Node 0,1,...,N-1 |
| 6 | self.n = n |
| 7 | self.w = [ |
| 8 | [math.inf for j in range(n)] for i in range(n) |
| 9 | ] # adjacency matrix for weight |
| 10 | self.dp = [ |
| 11 | [math.inf for j in range(n)] for i in range(n) |
| 12 | ] # dp[i][j] stores minimum distance from i to j |
| 13 | |
| 14 | def add_edge(self, u, v, w): |
| 15 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected