On Sat, Nov 10, 2012 at 12:16 PM, Michal D. <michal.dobrog...@gmail.com> wrote: > Here X is telling us to use the constraint c1 (presumably b/c C is not > shown) between the variables 1 and 3 (0 based). Likewise, use the > transpose going the other direction (3,1).
Ouch, you are correct, I did not specify C. On retesting, though, it looks like my results stay the same when I use: arccon=:3 :0 'D c1 X'=: y 'n d'=: $D adj =: ((<@#)&(i.n)) @ (0&<) A =: adj X C=: a: , c1 ; (|:c1) ac =: > @ (1&{) @ (revise^:_) @ ((i.n)&;) ac D ) For longer scripts like this, I really need to get into the habit of restarting J for every test. So that probably means I should be using jhs. > Given the structure of X, only variables 1 and 3 can possibly change. So if > they are all changing something is definitely wrong. This line of thinking does not make sense to me. I thought that the requirement was that a 1 in D exists only when there is a valid relationship along a relevant arc. If a 1 in D can also exist in the absence of any relevant arc, I am back to needing a description of the algorithm. > Unfortunately I've run out of time to read the rest of your response but > hopefully I can get through it soon. I've also wanted to write a simpler > version of the algorithm where the right argument of ac is only D and it > runs through all the arcs in the problem instead of trying to be smart > about which ones could have changed. Yes... I am currently suspicious of the "AC-3 algorithm". In the case of symmetric consistency, I think that it's unnecessary complexity, because the system converges on the initial iteration. In the case of asymmetric consistency, I think that the work involved in maintaining the data structures needed for correctness will almost always exceed the work saved. But I could be wrong. I am not sure yet if I understand the underlying algorithm! -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm