Class RowUniquenessConstraint
Enforces the constraint that all values in a row must be unique.
Inheritance
System.Object
RowUniquenessConstraint
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: SudokuSpice.ConstraintBased.Constraints
Assembly: SudokuSpice.dll
Syntax
public class RowUniquenessConstraint : IConstraint
Methods
| Improve this Doc View SourceTryConstrain(IReadOnlyPuzzle, ExactCoverGraph)
Adds necessary IObjectives and links to the given
graph
in order to solve the given puzzle
according to this constraint. The details here are implementation-specific.
Declaration
public bool TryConstrain(IReadOnlyPuzzle puzzle, ExactCoverGraph graph)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyPuzzle | puzzle | The puzzle to solve. |
ExactCoverGraph | graph | The exact-cover graph to constrain. |
Returns
Type | Description |
---|---|
System.Boolean | False if the constraint could not be satisfied by the given puzzle, else true. |
Remarks
This should skip adding objectives that are already satisfied by the given
puzzle
. Instead, it should drop the relevant
Possibilitys that are no longer possible.
Note: See ExactCoverGraph to understand how the graph works.