A few fixes and improvements to neighbor topologies.

One notable fix: the logic on the Edge Swap algorithm was slightly off.
It was saying that some invalid swaps were actually valid. It wasn't
obvious until the Edge Swap code was used in a directed version of Edge
Swap, however.