From 8153539d5b3010d220a43b48e3fc7f6a9aa88e3d Mon Sep 17 00:00:00 2001 From: ITCharge Date: Thu, 17 Mar 2022 16:40:38 +0800 Subject: [PATCH] Update Graph-Adjacency-Matrix.py --- Templates/08.Graph/Graph-Adjacency-Matrix.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Templates/08.Graph/Graph-Adjacency-Matrix.py b/Templates/08.Graph/Graph-Adjacency-Matrix.py index 63d14923..9c1582ec 100644 --- a/Templates/08.Graph/Graph-Adjacency-Matrix.py +++ b/Templates/08.Graph/Graph-Adjacency-Matrix.py @@ -36,8 +36,8 @@ def printGraph(self): print(str(vi) + ' - ' + str(vj) + ' : ' + str(val)) -graph = Graph(6) -edges = [[1, 4, 3],[1, 3, 9],[3, 4, 6],[2, 5, 4],[4, 5, 2]] +graph = Graph(5) +edges = [[1, 2, 5],[2, 1, 5],[1, 3, 30],[3, 1, 30],[2, 3, 14],[3, 2, 14],[2, 4, 26], [4, 2, 26]] graph.creatGraph(edges) print(graph.get_edge(3, 4)) graph.printGraph() \ No newline at end of file