UNPKG

dancing-links

Version:

Fastest JS solver for exact cover problems using Dancing Links

27 lines (26 loc) 1.17 kB
/** * Simple constraint handler for columns-only mode * * Zero branching - columnIndices is always number[], columnValues is always BinaryNumber[] */ import { ConstraintRow, BinaryNumber, SimpleSolverConfig, ConstraintHandler, SparseConstraintBatch, BinaryConstraintBatch } from '../../types/interfaces.js'; export declare class SimpleConstraintHandler<T> implements ConstraintHandler<T, 'simple'> { private config; readonly mode: "simple"; private constraints; private validationEnabled; private numColumns; constructor(config: SimpleSolverConfig); validateConstraints(): this; addSparseConstraint(data: T, columnIndices: number[]): this; addSparseConstraints(constraints: SparseConstraintBatch<T, 'simple'>): this; addBinaryConstraint(data: T, columnValues: BinaryNumber[]): this; addBinaryConstraints(constraints: BinaryConstraintBatch<T, 'simple'>): this; addRow(row: ConstraintRow<T>): this; addRows(rows: ConstraintRow<T>[]): this; getConstraints(): ConstraintRow<T>[]; getNumPrimary(): number; getNumSecondary(): number; getConfig(): SimpleSolverConfig; isValidationEnabled(): boolean; }