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

Method _build_adjacency_list

numpy_ml/utils/graphs.py:189–194  ·  view source on GitHub ↗

Encode directed graph as an adjancency list

(self)

Source from the content-addressed store, hash-verified

187 self._topological_ordering = []
188
189 def _build_adjacency_list(self):
190 """Encode directed graph as an adjancency list"""
191 # assumes no parallel edges
192 for e in self.edges:
193 fr_i = self._V2I[e.fr]
194 self._G[fr_i].add(e)
195
196 def reverse(self):
197 """Reverse the direction of all edges in the graph"""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected