Skip to content

Commit

Permalink
In PropConnected and PropNbCC: modify the part that removes unreachab…
Browse files Browse the repository at this point in the history
…le nodes to ensure that it only removes nodes that are in the domain to the variables,. This was not the case and caused useless calls to removeNode
  • Loading branch information
dimitri-justeau authored and cprudhom committed Sep 7, 2021
1 parent 3604015 commit d0383f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ public void propagate(int evtmask) throws ContradictionException {
visited.clear();
int root = g.getMandatoryNodes().iterator().next();
helper.exploreFrom(root, visited);
for (int o = visited.nextClearBit(0); o < n; o = visited.nextClearBit(o + 1)) {
g.removeNode(o, this);
for (int o : g.getPotentialNodes()) {
if (!visited.get(o)) {
g.removeNode(o, this);
}
}

// 2 --- enforce articulation points and bridges that link two mandatory nodes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ public void propagate(int evtmask) throws ContradictionException {

// 1 --- remove unreachable nodes
int n = g.getNbMaxNodes();
for (int o = visitedMin.nextClearBit(0); o < n; o = visitedMin.nextClearBit(o + 1)) {
g.removeNode(o, this);
for (int o : g.getPotentialNodes()) {
if (!visitedMin.get(o)) {
g.removeNode(o, this);
}
}

// 2 --- enforce articulation points and bridges that link two mandatory nodes
Expand Down

0 comments on commit d0383f9

Please sign in to comment.