MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / clear_graph

Method clear_graph

graphs/graph_adjacency_matrix.py:191–196  ·  view source on GitHub ↗

Clears all vertices and edges.

(self)

Source from the content-addressed store, hash-verified

189 return self.adj_matrix[u][v] == 1
190
191 def clear_graph(self) -> None:
192 """
193 Clears all vertices and edges.
194 """
195 self.vertex_to_index = {}
196 self.adj_matrix = []
197
198 def __repr__(self) -> str:
199 first = "Adj Matrix:\n" + pformat(self.adj_matrix)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected