Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TheAlgorithms/Python
/ __init__
Method
__init__
graphs/directed_and_undirected_weighted_graph.py:265–266 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
263
264
class
Graph:
265
def
__init__(self):
266
self.graph = {}
267
268
# adding vertices and edges
269
# adding the weight is optional
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected