in reply to Re^2: better algorithm: bitwise reordering
in thread better algorithm: bitwise reordering
Here's what I mean
The problem statement (as I read it) doesn't make mention of going back and forth between two squares (though it would be a valid variation upon a given walk), so you could probably prune a bunch of possibilities because you've already been there.
I would look at writing a better problem statement. Basically, are you only counting walks that minimize the number of squares touched? I would add the stipulation that you can only touch any square a maximum of two times. (One could add the once-per-square stipulation, but that may eliminate desired outcomes. I don't know enough about the problem domain to say with any certainty.)
The reason I suggest this option is because it sounds like you're not happy with your data structure which, in turn, is causing serious headaches with your algorithm.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: better algorithm: bitwise reordering
by hv (Prior) on Aug 25, 2004 at 17:39 UTC | |
by dragonchild (Archbishop) on Aug 25, 2004 at 18:03 UTC |