def remove_node(self, node): children = nx.descendants(self.graph, node) self.graph.remove_node(node) return children