On Fri, Jul 13, 2012 at 10:00 AM, Max Harms <raeli...@gmail.com> wrote: > You're suggesting that the lengths of each path be handled in a different > data structure than the paths themselves, yes? That could work, but I'm not > convinced it's actually cleaner than my implementation. While it's true > that it makes things more homogeneous, it also introduces a new verb to > calculate (real, not approximate) distances, and the need to ensure the > path list and the distance list are aligned correctly.
Yes... If it's only two verbs to represent the details of exploration it might be good to present them as a gerund. If we need large suite of them, probably a class would be the best way to represent them. I'll draft up something like this that deals with the cases you have illustrated and the cases that I have been thinking about. (I think I know how to implement my "can be a* but does not have to be" approach without getting too complex.) > I think this may be a case of different good solutions to the same problem. > If you want to restructure it like that, be my guest. It's hard to say > which is better without an implementation, but I'm pretty satisfied with > the one I have. ^_^ It really depends on where you see yourself going with this. It's clear, of course, from your coding decisions that you have some criteria you are basing your decisions on. Currently, I'm thinking of this as "finding a path given a graph and an estimator of path goodness" but the graph itself is more than just the data. The mechanisms we use to describe its exploration are a reflection of our concepts of the graph. Anyways, I'll try and put my thoughts into code. Thanks, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm