Show / Hide Table of Contents

Class BoxUniquenessConstraint

Enforces the constraint that all values in a box must be unique.

Inheritance
System.Object
BoxUniquenessConstraint
Implements
IConstraint
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 BoxUniquenessConstraint : IConstraint

Methods

| Improve this Doc View Source

TryConstrain(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.

Implements

IConstraint
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX