https://1library.net/document/zp7m3o7z-partitioning-a-permutation-graph-algorithms-and-an-application.html