dominosort (pypi): Sort sequences with respect to the similarity of consecutive items.
Keywords: sort|sorting|algorithm