Repository navigation
Commit 996652b
committed
Count constraint checks in CSP via self.nchecks (#1112)
The CSP class tracked nassigns but not the number of consistency checks, so
the constraint-check benchmarks from Figure 6.1 (BT, BT+MRV, FC, ...) could
not be reproduced. Expose the constraint relation through a constraints()
method that tallies every call in self.nchecks (the raw relation is kept as
self.constraint_relation). All callers - nconflicts, count_lost_values,
forward_checking, AC3/AC3b/AC4 - go through it, so nchecks measures the
total checks across backtracking and propagation. Add a test.1 parent 8c4a1cb commit 996652b
2 files changed
Lines changed: 27 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
64 | 75 | | |
65 | 76 | | |
66 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
704 | 719 | | |
705 | 720 | | |
0 commit comments