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

Method __init__

project_euler/problem_107/sol1.py:44–48  ·  view source on GitHub ↗
(self, vertices: set[int], edges: Mapping[EdgeT, int])

Source from the content-addressed store, hash-verified

42 """
43
44 def __init__(self, vertices: set[int], edges: Mapping[EdgeT, int]) -> None:
45 self.vertices: set[int] = vertices
46 self.edges: dict[EdgeT, int] = {
47 (min(edge), max(edge)): weight for edge, weight in edges.items()
48 }
49
50 def add_edge(self, edge: EdgeT, weight: int) -> None:
51 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected