• Advertisement
Sign in to follow this  

Node Tree Search Help

This topic is 2997 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have currently built a structure in C++ with a two dimensional array, with each cell stating whether there is a wall present or not. A search is then done through the array to add edges if the adjacent cell is not a wall, this is done looking norh, north east, east etc. The image shows an example of the connections. When searching through my depth first algorithm on a on a 30 x 30 grid, the destination node is found after 1518 steps, I guess this is because there is so many combinations to get there. Any suggestions on other algorithms that could be used to find a destination node? I have an image - how do I get this attached to the forum post?

Share this post


Link to post
Share on other sites
Advertisement
Hey pawikan!

Quote:
A search is then done through the array to add edges if the adjacent cell is not a wall, this is done looking norh, north east, east etc.

The image shows an example of the connections. When searching through my depth first algorithm on a on a 30 x 30 grid, the destination node is found after 1518 steps, I guess this is because there is so many combinations to get there.


I don't quite understand what you are trying to accomplish. Are you trying to generate data describing where walls are, or are you trying to get to a goal node?
If the former, I would probably try to search for walls and turn it and so many adjacent tiles to intraversable. If you do not have diagonal walls, you could implement your algorithm to try and "hug the wall" to hasten the process. Even better, you could just use an image map to directly describe which areas are blocked and which are not.

If you are trying to reach a goal node, implement the A* algorithm.

To attach an image, use the following syntax.
<img src="Image URL goes here" />

Cheers!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement