Simplify the declarations of the Python code.

This commit is contained in:
krahets
2023-05-22 22:03:57 +08:00
parent 081b76d620
commit e196962d0a
27 changed files with 88 additions and 87 deletions

View File

@ -88,8 +88,8 @@ class GraphAdjMat:
if __name__ == "__main__":
# 初始化无向图
# 请注意edges 元素代表顶点索引,即对应 vertices 元素索引
vertices: list[int] = [1, 3, 2, 5, 4]
edges: list[list[int]] = [[0, 1], [0, 3], [1, 2], [2, 3], [2, 4], [3, 4]]
vertices = [1, 3, 2, 5, 4]
edges = [[0, 1], [0, 3], [1, 2], [2, 3], [2, 4], [3, 4]]
graph = GraphAdjMat(vertices, edges)
print("\n初始化后,图为")
graph.print()