Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/subbarayudu-j/TheAlgorithms-Python
/ add_edge
Method
add_edge
Graphs/graph_matrix.py:10–12 ·
view source on GitHub ↗
(self, u, v)
Source
from the content-addressed store, hash-verified
8
self.graph = [[0] * vertex
for
i in range(vertex) ]
9
10
def
add_edge(self, u, v):
11
self.graph[u - 1][v - 1] = 1
12
self.graph[v - 1][u - 1] = 1
13
14
def
show(self):
15
Callers
1
graph_matrix.py
File · 0.45
Calls
no outgoing calls
Tested by
no test coverage detected