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

Method __init__

numpy_ml/utils/graphs.py:267–283  ·  view source on GitHub ↗

A generic undirected graph object. Parameters ---------- V : list A list of vertex IDs. E : list of :class:`Edge ` objects A list of edges connecting pairs of vertices in ``V``. For any edge con

(self, V, E)

Source from the content-addressed store, hash-verified

265
266class UndirectedGraph(Graph):
267 def __init__(self, V, E):
268 """
269 A generic undirected graph object.
270
271 Parameters
272 ----------
273 V : list
274 A list of vertex IDs.
275 E : list of :class:`Edge <numpy_ml.utils.graphs.Edge>` objects
276 A list of edges connecting pairs of vertices in ``V``. For any edge
277 connecting vertex `u` to vertex `v`, :class:`UndirectedGraph
278 <numpy_ml.utils.graphs.UndirectedGraph>` will assume that there
279 exists a corresponding edge connecting `v` to `u`, even if this is
280 not present in `E`.
281 """
282 super().__init__(V, E)
283 self.is_directed = False
284
285 def _build_adjacency_list(self):
286 """Encode undirected, unweighted graph as an adjancency list"""

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected