def is_successor(graph, node2, node1):

    """Is node 2 the successor of node 1 on a directed graph?"""

    successors = graph.successors(node1)
    successors.append(node1)
    if (node2 in successors): return True
    else: return False