diff --git a/cpp/switchchain.cpp b/cpp/switchchain.cpp index 8636b77157077b6bc1007496077d998cd1e1ab31..559d9fa4814dbd2f820d3479cb823654384822fc 100644 --- a/cpp/switchchain.cpp +++ b/cpp/switchchain.cpp @@ -56,26 +56,8 @@ class SwitchChain { // 1) e1.u - e1.v and e2.u - e2.v (original) // 2) e1.u - e2.u and e1.v - e2.v // 3) e1.u - e2.v and e1.v - e2.u - - // Note that it might be that these new edges already exist - // in which case we reject the move bool switchType = permutationDistribution(mt); - if (switchType) { - if (g.hasEdge({e1.u, e2.u}) || g.hasEdge({e1.v, e2.v})) - return false; // conflicting edges - } else { - if (g.hasEdge({e1.u, e2.v}) || g.hasEdge({e1.v, e2.u})) - return false; // conflicting edges - } - - // TODO - // rest of the switching process - - // int perm = permutationDistribution(mt); - // if (perm == 0) // Original permutation - // return false; - // return g.exchangeEdges(e1, e2, perm == 1); - return g.exchangeEdges(e1, e2, switchType); + return g.exchangeEdges(e1index, e2index, switchType); } Graph g;