Show / Hide Table of Contents

Interface IConstraint

Namespace: SudokuSpice.ConstraintBased.Constraints
Assembly: SudokuSpice.dll
Syntax
public interface 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
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.

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