On Sun, Nov 4, 2012 at 5:32 PM, Michal D. <michal.dobrog...@gmail.com> wrote: >> If D were instead a list of 81 by 9 bits, with extra copies of D being >> introduced as necessary, the "multiple answer" case could be addressed >> by having an extra item in D for every valid solution. Here, the >> initial D would have shape 1 81 9 and a final D would have shape n,81 >> 9 where n is a (hopefully small) non-negative integer. >> >> But that's not what you are doing here? >> > > TODO ;-) > > Although this could potentially be dangerous. For example the completely > empty sudoku puzzle has very many solutions and I doubt my computer would > have the patience to go through them all.
Ok, but I am still stuck on making sure I understand what "arc consistent" means. My guess, since you are using a universal quantifier, is that since these solutions are inconsistent with each other, that some sudoku puzzles which have multiple solution would not have an arc consistent representation. So I think that you would have "all 0s" for some of your rows in D in that case. Does that sound right? That said, I think I tried your algorithm on the empty sudoku case and it returned (i. 0);81 9$1 Here's the specific values I used: n=:81 d=:9 D=: 81 9 $ 1 c1=: ~:/~ i. 9 COL=: , |: 9#,:i.9 ROW=: ,9#,:i.9 BOX=: ,3#3#"1 i.3 3 A=: ((2*>/~i.81)+</~i.81) * (+. |:) (COL =/ ROW) +. (COL =/BOX ) +. (ROW =/ BOX) So consistent, here, does not mean what I expected -- I was expecting (i.0);81 9 $ 0 So, when you say: > Arc consistent means that for every pair of adjacent variables, x and y, > every value in Dx is compatible with at least one value in Dy. > > Put another way, there is no value v in Dx such that the v is not > consistent with any value w in Dy. I am beginning to think you mean for all w in Dy there exists a v in Dx such that the relationship v compare w is true. Does this sound right? Thanks, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm