> i thought the hardest part of question 5 would be getting everything read into the 
>queues and
stuff,
> i did not realize how much emphasis there would be on the priority function.
>
> i am assuming there is a lot to do there
> because my program runs 5 times for dataset 1, says no solution after 16 runs for 
>dataset 2 but
> never finishes for dataset 3, 6, 7, 8.....just keeps processing.
> this is because my priority is not good enough?
> do you know roughly how many boards need to be processed for any of those datasets?
> or maybe my datastructures are too process intensive... i was storing a board object 
>as a 2
> dimensional array, and i keep a linked list of previous boards..? is that bad?

I haven't tried it out myself yet, so I don't know how long everything takes, or 
whether or not
there are solutions. But if your program "runs forever" there may be some bug. Easiest 
way to check
this: add some code to absolutely make sure
that no duplicates boards are ever entered in the priority queue or in the
previous boards list.
Storing previous boards as linked list is fine. Storing a board as 2-dim integer array 
should be
fine too.
The total number of possible boards is still rather small: 25*(21!/(4!*17!)) = 149625 
(with 4
indistinguishable robots, 1 astronaut). Multiply that with the size of a board, to get 
a sense of
the (extremely unlikely) worst case space requirements.

Hans






Reply via email to