Skip to content

Commit

Permalink
Alternative symmetry breaker, refs #27
Browse files Browse the repository at this point in the history
  • Loading branch information
phspo committed Apr 25, 2018
1 parent 7a204e7 commit d04d9b4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/ILPSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,18 @@ long ILPSolver::solve(const ClusterEditingInstance& inst, ClusterEditingSolution
}


//Naive symmetry breaking -> Simply force node with id 0 to be in cluster with id 0
M.add(y[0] == 1);
//Symmetry-Breaker
//Force each node to be in a cluster with index smaller than its own id
for (FullGraph::NodeIt i(g); i != INVALID; ++i) {

int nodeID = g.id(i);

if (nodeID+1 > _clusterCount-1) continue;

for (int j = nodeID+1; j < _clusterCount; ++j) {
M.add(y[j*g.nodeNum()+ g.id(i)] == 0);
}
}

//Even more Constraints:
/** Those are adapted from Bulhões et al. 2017 (http://dx.doi.org/10.1016/j.dam.2016.10.026)
Expand Down

0 comments on commit d04d9b4

Please sign in to comment.