Wikunia / ConstraintSolver.jl

ConstraintSolver in Julia: Blog posts ->
https://opensourc.es/blog/constraint-solver-1
MIT License
136 stars 13 forks source link

Wish list for indicators/reification #205

Open hakank opened 3 years ago

hakank commented 3 years ago

Issue 202 (https://github.com/Wikunia/ConstraintSolver.jl/issues/202 ) got a little sidetracked so here is a cleaner wish list.

1) The constraints using indicator/reification should not require that the user must create binary variables. Here is an example that would be really great if supported.

function all_different_except_0(m, a)
    len = length(a)
    for i in 2:len, j in 1:i-1
        @constraint(m, (a[i] != 0 && a[j] != 0) => {a[i] != a[j]} ) 
    end
end

2) Support for && and || (or & and |) as well as != in both LHS and RHS of an indicator/reification constraint. See the example above.

Wikunia commented 2 years ago

Similar to #248