'Resolve a sequence of vertices (=pairs of node IDs) into a
sequence of non-recurrent paths
@param seq: the vertex sequence'

@staticmethod
def __resolve(seq):

    resolve = S3MultiPath.__resolve
    if seq:
        head = seq[0]
        tail = seq[1:]
        tails = []
        index = tail.index
        append = tails.append
        while (head in tail):
            pos = index(head)
            append(tail[:pos])
            tail = tail[(pos + 1):]
        append(tail)
        r = []
        append = r.append
        for tail in tails:
            nt = resolve(tail)
            for t in nt:
                append(([head] + t))
        return r
    else:
        return [seq]
