Fix Issue #1270 - Failing Unit Tests #1389
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR, we fix Issue #1270
The root cause of the problem is most likely the randomized nature of the test. To reduce nondeterminism, we now rely on fixed graphs from
input/, testing one unweighted and one weighted instance. However, randomness cannot be eliminated entirely, since it is inherently used by the underlying solver.Additionally, this fix reduces the number of tests. Previously, the test was also run on directed graphs. However, to my understanding, the algebraic distance on a graph is only defined for undirected graphs. Therefore, omitting these directed cases does not constitute a loss in test coverage.
I also added a check in the
AlgebraicDistanceconstructor to ensure that the input graph is undirected, since this should not be allowed, and added a corresponding test.