Skip to content

Correct least constraints value implementation#1192

Merged
dmeoli merged 7 commits into
aimacode:masterfrom
dsaw:correct-lcv
Jun 26, 2026
Merged

Correct least constraints value implementation#1192
dmeoli merged 7 commits into
aimacode:masterfrom
dsaw:correct-lcv

Conversation

@dsaw

@dsaw dsaw commented Jul 5, 2020

Copy link
Copy Markdown
Contributor

PR for #1089 - have added a method for lcv based on implementation in aima-java.
The implementation has two loops for checking constraints in both directions, which might need refactoring to make it more Pythonic.
Also included a straightforward method test on the heuristic.

Please review & suggest any changes.
@antmarakis @norvig

dsaw and others added 7 commits December 27, 2018 00:04
lcv previously sorted by nconflicts (conflicts with already-assigned
neighbours), which is degenerate during a consistent search. Add
CSP.count_lost_values(var, val, assignment) - the number of values ruled out
in unassigned neighbours' domains - and order lcv by it, matching the AIMA
definition. Clean snake_case implementation; tests updated. Closes aimacode#1089.
@dmeoli dmeoli merged commit 91d3fe3 into aimacode:master Jun 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants