Skip to content

[BUG] InvalidSolutionException on UndirectedGraphVar #1174

@kevin-delmas

Description

@kevin-delmas

Describe the bug
The following code is raising an InvalidSolutionException since the solver finds a solution that is not satisfying the isConnected constraint.
The bug is quite difficult to reproduce since it depends on the variable selection strategy.
The error message is:

FAILURE >> REIF_95 = 1=>connected ([PropConnected(q)]), !REIF_95 = 1=>OPPOSITE ([PropOpposite(q)])

To Reproduce
The following Scala code is providing the MWE (sorry, it is quite large but I failed to reduce it further).
https://github.com/onera/pml-analyzer/blob/73-develop-a-choco-backend/src/main/scala/onera/pmlanalyzer/views/interference/examples/MWEChocoError.scala

Expected behavior
The program should find exactly 90,112 solutions to this problem, all ensuring that isConnected is satisfied

Possible solution
I am a new user of Choco, so I may not use the API properly, nevertheless I "fixed" the issue by removing the runtime test (prod settings) and checking that solution satisfies the connectivity constraint.
Obviously, this fix is not satisfactory.

val  model: Model = Model(Settings.prod())
...
while (solver.solve() && isConnected.isSatisfied == ESat.TRUE) {}

Environment (please complete the following information):

  • Choco-solver version: 5.0.0-beta.1
  • JRE : 17.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions