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

Method __init__

graphs/graph_list.py:75–82  ·  view source on GitHub ↗

Parameters: directed: (bool) Indicates if graph is directed or undirected. Default is True.

(self, directed: bool = True)

Source from the content-addressed store, hash-verified

73 """
74
75 def __init__(self, directed: bool = True) -> None:
76 """
77 Parameters:
78 directed: (bool) Indicates if graph is directed or undirected. Default is True.
79 """
80
81 self.adj_list: dict[T, list[T]] = {} # dictionary of lists
82 self.directed = directed
83
84 def add_edge(
85 self, source_vertex: T, destination_vertex: T

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected