def enumerate_vertices(graph):
    """Return the ordered list of vertices of `graph`

    Parameters
    ----------
    graph : input graph
    """
    if hasattr(graph, 'ordered_vertices'):
        assert graph.order() == len(graph.ordered_vertices)
        assert set(graph.nodes()) == set(graph.ordered_vertices)
        return graph.ordered_vertices
    else:
        setattr(graph, 'ordered_vertices', sorted(graph.nodes()))
        return graph.ordered_vertices
