Skip to content

Several bugs in CSP.py, patch included #11

@GoogleCodeExporter

Description

@GoogleCodeExporter
Reproduce:
$ python
>>> from csp import *
>>> backtracking_search(australia, mcv=True, fc=True)
-> Results in wrong coloring 

Several issues:
- Forward checking and Arc Consistency are severely broken. The most severe
issue is in line 86, where information about pruned domains from previous
steps is wrongly discarded.
- Most constrained variable-heuristic has it backwards and orders the least
constrained variable first
- Least constraining value-heuristic fails to compile on modern python
- The map of USA is wrong (New York adjacent to California), some borders
missing

The included patch fixes the described issues plus adds
- The map of France by Regions
- Formulation of the Sudoku-Problem
- Some trivial testing code

Otherwise great book!

Original issue reported on code.google.com by edgar.ho...@gmail.com on 6 Jul 2009 at 12:17

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions