In researching potential path finding algorithms, I settled on the A-Star algorithm. For some reason, it just makes sense to me. As I designed my version of the algorithm, i implemented he open and closed lists as binary heaps. I did this because the graph (33 nodes, max, 45 edges, max) is very small and, there are (at most) five computer players. This means that the even though adding and subtracting data from the heaps might take a little bit of time, based on the above numbers, I can live with it for a while.

What I am having a problem with is the data that should be added to the Open and Closed heaps. I'm considering just storing pointers to the graph nodes in the heap. The other option would be create a simple structure and store select database from the graph nodes in the structure and THEN store either entire structure in the heap or store a pointer to the new structure in the heap. But, this later approach seems a little cumbersome to me.

I'm a little new to C++ but, as I understand pointers, I sort of think that the most efficient way to do this would be to just store the point to the original graph node.

Any advice on how to handle this problem of shifting data around? And, how have others handled this sort of situation?

]]>In researching potential path finding algorithms, I settled on the A-Star algorithm. For some reason, it just makes sense to me. As I designed my version of the algorithm, i implemented he open and closed lists as binary heaps. I did this because the graph (33 nodes, max, 45 edges, max) is very small and, there are (at most) five computer players. This means that the even though adding and subtracting data from the heaps might take a little bit of time, based on the above numbers, I can live with it for a while.

What I am having a problem with is the data that should be added to the Open and Closed heaps. I'm considering just storing pointers to the graph nodes in the heap. The other option would be create a simple structure and store select database from the graph nodes in the structure and THEN store either entire structure in the heap or store a pointer to the new structure in the heap. But, this later approach seems a little cumbersome to me.

I'm a little new to C++ but, as I understand pointers, I sort of think that the most efficient way to do this would be to just store the point to the original graph node.

Any advice on how to handle this problem of shifting data around? And, how have others handled this sort of situation?

]]>I don't think that I will go as far as to implement my own string classes. My educational background is History. The only subjects farther from computer science, I think, is the study of dead languages or perhaps acting.

Just as an update, I managed to get both the binary heap and the graph working correctly.

]]>Of course, I am running this code on a very small set of data. At the most, some of the datasets will only contain perhaps 100 elements. If I were coding against a very large (and/or complicated) set of data (i.e. pattern matching across thousands of elements is a good example) then I would rethink my using Boost.

]]>