Click here to Skip to main content
15,889,877 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Fast path finding algorithm Pin
AspDotNetDev27-May-11 7:31
protectorAspDotNetDev27-May-11 7:31 
AnswerRe: Fast path finding algorithm Pin
Luc Pattyn27-May-11 7:42
sitebuilderLuc Pattyn27-May-11 7:42 
GeneralRe: Fast path finding algorithm Pin
alikalik27-May-11 8:24
alikalik27-May-11 8:24 
AnswerRe: Fast path finding algorithm Pin
Luc Pattyn27-May-11 14:16
sitebuilderLuc Pattyn27-May-11 14:16 
QuestionRe: Fast path finding algorithm Pin
AspDotNetDev27-May-11 9:08
protectorAspDotNetDev27-May-11 9:08 
AnswerRe: Fast path finding algorithm Pin
David I Carter31-May-11 22:29
David I Carter31-May-11 22:29 
AnswerRe: Fast path finding algorithm Pin
Member 41945939-Aug-11 19:42
Member 41945939-Aug-11 19:42 
GeneralRe: Fast path finding algorithm Pin
Member 419459310-Aug-11 3:53
Member 419459310-Aug-11 3:53 
Sorry for the double post.

What was I thinking!

This will not work:

To identify the actual path from the first point to the second point, save (in a solution array that has the same size as the array) the x-y coordinates (or point ID of some kind) of the originating point that was being processed when this new point was flooded, into the array position for the new point. Do this for points starting from the first point (the first color). For the points starting from the second point (the second color), save the new point ID in the current point array position so the path is consistent. To walk the path, start at the second point in the solution array and backtrack to the first point. If you are processing blocks of points in a maze (i.e., 8x8), then you only need a solution array big enough for the number of blocks, not big enough for the number of pixels.


What it should read is:

To identify the actual path from the first point to the second point, save (in a solution array that has the same size as the array) the x-y coordinates (or point ID of some kind) of the current point that was being processed when this new point was flooded, into the array position for the new point. Do this for all flooded points starting from either direction. When the collision occurs between the two wave fronts, you have two adjacent positions marked with different flood fill colors. For each of these positions, backtrack to the originating point and mark the positions with a shortest path color, then scan the entire array and mark all positions that are in either flood fill color with the normal color of the hallway. You will be left with the walls, the halls, the start and end points, and the shortest path between the points. If you are processing blocks of points in a maze (i.e., 8x8 blocks in a 800x800 maze), then you only need a solution array big enough for the number of blocks, not big enough for the number of pixels.

Dave.
AnswerRe: Fast path finding algorithm Pin
BobJanova1-Jun-11 2:01
BobJanova1-Jun-11 2:01 
AnswerRe: Fast path finding algorithm Pin
dasblinkenlight1-Jun-11 6:52
dasblinkenlight1-Jun-11 6:52 
AnswerRe: Fast path finding algorithm Pin
YDaoust2-Jun-11 0:05
YDaoust2-Jun-11 0:05 
QuestionReal time peak identification Pin
Wjousts25-May-11 4:32
Wjousts25-May-11 4:32 
AnswerRe: Real time peak identification PinPopular
AspDotNetDev25-May-11 5:06
protectorAspDotNetDev25-May-11 5:06 
GeneralRe: Real time peak identification Pin
Wjousts25-May-11 7:54
Wjousts25-May-11 7:54 
AnswerRe: Real time peak identification PinPopular
Luc Pattyn25-May-11 5:30
sitebuilderLuc Pattyn25-May-11 5:30 
GeneralRe: Real time peak identification Pin
Wjousts25-May-11 8:43
Wjousts25-May-11 8:43 
AnswerRe: Real time peak identification Pin
Luc Pattyn25-May-11 13:45
sitebuilderLuc Pattyn25-May-11 13:45 
GeneralRe: Real time peak identification Pin
Wjousts26-May-11 8:45
Wjousts26-May-11 8:45 
AnswerRe: Real time peak identification Pin
Luc Pattyn26-May-11 9:09
sitebuilderLuc Pattyn26-May-11 9:09 
GeneralRe: Real time peak identification Pin
Wjousts26-May-11 9:20
Wjousts26-May-11 9:20 
AnswerRe: Real time peak identification Pin
Luc Pattyn26-May-11 9:44
sitebuilderLuc Pattyn26-May-11 9:44 
AnswerRe: Real time peak identification Pin
Peter_in_278025-May-11 13:38
professionalPeter_in_278025-May-11 13:38 
AnswerRe: Real time peak identification Pin
Luc Pattyn25-May-11 14:52
sitebuilderLuc Pattyn25-May-11 14:52 
GeneralRe: Real time peak identification Pin
Peter_in_278025-May-11 16:14
professionalPeter_in_278025-May-11 16:14 
GeneralRe: Real time peak identification Pin
Wjousts26-May-11 9:10
Wjousts26-May-11 9:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.