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

Method to_adj_dict

numpy_ml/utils/graphs.py:98–103  ·  view source on GitHub ↗

Return an adjacency dictionary representation of the graph

(self)

Source from the content-addressed store, hash-verified

96 return adj_mat
97
98 def to_adj_dict(self):
99 """Return an adjacency dictionary representation of the graph"""
100 adj_dict = defaultdict(lambda: list())
101 for e in self.edges:
102 adj_dict[e.fr].append(e)
103 return adj_dict
104
105 def path_exists(self, s_i, e_i):
106 """

Callers 1

__init__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected