MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / add_edge

Method add_edge

graphs/boruvka.py:49–52  ·  view source on GitHub ↗

Adds an edge in the format [first, second, edge weight] to graph.

(self, u_node: int, v_node: int, weight: int)

Source from the content-addressed store, hash-verified

47 self.m_component: dict[int, int] = {}
48
49 def add_edge(self, u_node: int, v_node: int, weight: int) -> None:
50 """Adds an edge in the format [first, second, edge weight] to graph."""
51
52 self.m_edges.append([u_node, v_node, weight])
53
54 def find_component(self, u_node: int) -> int:
55 """Propagates a new component throughout a given component."""

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected