exact_cover_dlx 0.1.1 copy "exact_cover_dlx: ^0.1.1" to clipboard
exact_cover_dlx: ^0.1.1 copied to clipboard

Generic exact cover solver based on Dancing Links (DLX).

example/main.dart

import 'package:exact_cover_dlx/exact_cover_dlx.dart';

void main() {
  final problem = ExactCoverProblem(
    primaryColumns: {'A', 'B', 'C', 'D'},
    secondaryColumns: {'tag:x'},
    rows: {
      'row_1': {'A', 'D'},
      'row_2': {'B', 'C'},
      'row_3': {'A', 'C', 'tag:x'},
      'row_4': {'B', 'D'},
    },
  );

  const solver = DlxExactCoverSolver<String, String>();
  final result = solver.solve(problem, maxSolutions: 10);

  for (final solution in result.solutions) {
    print(solution.selectedRows);
  }
}
0
likes
150
points
26
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Generic exact cover solver based on Dancing Links (DLX).

Repository (GitHub)
View/report issues

Topics

#exact-cover #dlx #dancing-links #sudoku #algorithms

License

MIT (license)

More

Packages that depend on exact_cover_dlx