| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@MrDupin Nice work, but just some suggestions:
With that said, my ideia for the code was something like this: def make_arc_consistent(Xj, Xk, csp):
"""Make arc between parent (Xj) and child (Xk) consistent under the csp's constraints,
by removing the possible values of Xj that cause inconsistencies."""
for val1 in csp.domains[Xj]:
for val2 in csp.domains[Xk]:
if not csp.constraints(Xj, val1, Xk, val2):
csp.prune(Xj, val1)
return csp.curr_domains[Xj]But again, this will require calling the support_prunning method. But this is just an idea.
|
Sorry, something went wrong.
|
@lucasmoura: Thanks for the feedback.
|
Sorry, something went wrong.
|
Accidentally deleted branch, will now make new PR. Sorry about that. New PR is #434. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Completed the implementation of tree_csp_solver and added tests. In detail:
Note: I had to add two new lines to the algorithm for initialization purposes. If that's an issue, I can work them into the called functions, but it will be ugly.