I have a table that is an image of directed graph.
John, Peter
John, Dan
Peter, John
Dan, John
How to arrange rows in a such way that pairs would appear next to each other. The result should look like:
John, Peter
Peter, John
(this gap is for the sake of clarity)
Dan, John
John, Dan