Optimization, Algorithms, Heuristics, Operations Research, Python.
class Node: neighbors: List['Node'] index: int selected: bool def __init__(self, index): self.index = index self.neighbors = [] self.selected = False def __repr__(self) -> str: return f"N{self.index}" def add_neighbor(self, node: 'Node'): if node not in self.neighbors: self.neighbors.append(node)