Replace ad-hoc swap technique with library version.
Rename edge => edges to allow formulation g.edge[i].