dimod icon indicating copy to clipboard operation
dimod copied to clipboard

Add experimental support for != constraints

Open arcondello opened this issue 3 years ago • 2 comments

See also https://github.com/dwavesystems/dimod/issues/1030

arcondello avatar Nov 03 '22 19:11 arcondello

we need to add something like this:

            elif sense is Sense.Ne:
                # hard-coding violation of not equal constraints to 1
                violation = 0 if activity != 0 else 1

In the function iter_constraint_data in constrained.py

alexzucca90 avatar Nov 03 '22 19:11 alexzucca90

I would also raise a ValueError when trying to add a constraint with real values, unless we think they make sense.

alexzucca90 avatar Nov 03 '22 20:11 alexzucca90