chocoteam / chocoteam/choco-solver

PropagationGuidedNeighborhood computes the wrong value of logSum

Open
#647 14 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
779
Forks
159
Avg merge
6d 9h
Merged PRs (30d)
10

Description

It looks like someone forgot to delete lines 106 to 108 in [PropagationGuidedNeighborhood.java](https://github.com/chocoteam/choco-solver/blob/ab04ff513e8c278916105baa4ab4334dd4d22c8a/src/main/java/org/chocosolver/solver/search/loop/lns/neighbors/PropagationGuidedNeighborhood.java#L106).

In previous versions, line 105 was `logSum = 0` but was at some point this updated to be `logSum = Arrays.stream(variables).mapToDouble(v -> Math.log(v.getDomainSize())).sum();`, which directly computes the logSum and makes lines 106 to 108 obsolete.
However, because lines 106 to 108 remain and increase the value of logSum, the resulting value is actually two times the intended value.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.