CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

# Thread: Algorithm for a car race using BFS

1. Junior Member
Join Date
Nov 2009
Posts
1

## Algorithm for a car race using BFS

Ok, so here's the problem I am having. Say I have a boolean maze, where ofcourse T are the place I can traverse on and F are the areas I cannot. The goal is to find the shortest parth from 0,0 to other corner i.e. m,n corner. Well that's just the first part of it. The other problem in the mix is the car can jump between the cells and even obstacles, also the speed can be 1+ more than its previous speed. The real goal is to find a path with the shortest amount of traversed cells with jumps.

Thinking about the problem, I can understand I can do a BFS search, but how exactly do I do a BFS search taking the shortest path with the jumps in it?

2. ## Re: Algorithm for a car race using BFS

What do you mean with BFS search?
Breath First Search is an algorithm to traverse a tree. So, you'll first have to define what your tree will look like. What is the information contained in each node and what are the children of each node?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

Click Here to Expand Forum to Full Width