'Find nodes which are reachable from the starting node, after removing an edge'

def head_component(self, node, rest_edges):

    if (node not in self.head_nodes):
        self.head_nodes.append(node)
        for edge in rest_edges:
            if (edge[0] == node):
                self.head_component(edge[1], rest_edges)
