swap pair of nodes