SWAP-NODES-IN-PAIRS problem