def __edge_exists__(i, j, g):
    """
    Checks if the edge i --> j exists in the graph, g.

    :param i: Index of a node.
    :param j: Index of a node.
    :param g: Graph.
    :return: A boolean indicating if j is a successor of i.
    """
    return j in list(g.successors(i))