/
AllDifferentFWC.java
55 lines (44 loc) · 1.52 KB
/
AllDifferentFWC.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* mini-cp is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License v3
* as published by the Free Software Foundation.
*
* mini-cp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with mini-cp. If not, see http://www.gnu.org/licenses/lgpl-3.0.en.html
*
* Copyright (c) 2018. by Laurent Michel, Pierre Schaus, Pascal Van Hentenryck
*/
package minicp.engine.constraints;
import minicp.engine.core.AbstractConstraint;
import minicp.engine.core.IntVar;
import minicp.state.StateInt;
import minicp.util.exception.NotImplementedException;
import java.util.stream.IntStream;
/**
* Forward Checking filtering AllDifferent Constraint
*
* Whenever one variable is fixed, this value
* is removed from the domain of other variables.
* This filtering is weaker than the {@link AllDifferentDC}
* but executes faster.
*/
public class AllDifferentFWC extends AbstractConstraint {
private IntVar[] x;
public AllDifferentFWC(IntVar... x) {
super(x[0].getSolver());
this.x = x;
}
@Override
public void post() {
throw new NotImplementedException("AllDifferentFWC");
}
@Override
public void propagate() {
// TODO use the sparse-set trick as seen in Sum.java
throw new NotImplementedException("AllDifferentFWC");
}
}