Optimization, Algorithms, Heuristics, Operations Research, Python.
self.nodelist if not n.selected] def _new_node(self, i: int): if i not in self.N: self.N[i] = Node(i) def _new_edge(self, i: int, j: int): self._new_node(i) self._new_node(j) self.N[i].add_neighbor(self.N[j]) self.N[j].add_neighbor(self.N[i]) def select(self, node: Node): node.selected = True