def _TMP_successor(l):
    """
    given a level sequence generate the next (Beyer-Hedetniemi)
    """
    p = len(l) - 1
    while p > 0 and l[p] == 1:
        p -= 1
    if p == 0:
        return False
    q = p - 1
    while q > 0 and l[q] != l[p] - 1:
        q -= 1
    diff = p - q
    ll = l[:p] + l[q:p] * ((len(l) - p) / diff)
    ll.extend(l[q:q + len(l) - len(ll)])
    return ll
