MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / __init__

Method __init__

Graphs/graph_matrix.py:6–8  ·  view source on GitHub ↗
(self, vertex)

Source from the content-addressed store, hash-verified

4class Graph:
5
6 def __init__(self, vertex):
7 self.vertex = vertex
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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected