def random_eulerien_graph(n):
    """Generates some random eulerian graph

       :param int n: number of vertices
       :returns: undirected graph in listlist representation
       :complexity: linear
    """
    graphe = [[] for _ in range(n)]
    for v in range(n - 1):
        noeuds = random.sample(range(v + 1, n), random.choice(
            range(0 if len(graphe[v]) % 2 == 0 else 1, (n - v), 2)))
        graphe[v].extend(noeuds)
        for w in graphe[v]:
            if w > v:
                graphe[w].append(v)
    return graphe
Generates some random eulerian graph

       :param int n: number of vertices
       :returns: undirected graph in listlist representation
       :complexity: linear