MCPcopy Create free account
hub / github.com/ddbourgin/numpy-ml / __init__

Method __init__

numpy_ml/utils/graphs.py:51–58  ·  view source on GitHub ↗
(self, V, E)

Source from the content-addressed store, hash-verified

49
50class Graph(ABC):
51 def __init__(self, V, E):
52 self._I2V = {i: v for i, v in zip(range(len(V)), V)}
53 self._V2I = {v: i for i, v in zip(range(len(V)), V)}
54 self._G = {i: set() for i in range(len(V))}
55 self._V = V
56 self._E = E
57
58 self._build_adjacency_list()
59
60 def __getitem__(self, v_i):
61 return self.get_neighbors(v_i)

Callers

nothing calls this directly

Calls 1

_build_adjacency_listMethod · 0.95

Tested by

no test coverage detected