Click here to Skip to main content
15,920,383 members
Home / Discussions / Algorithms
   

Algorithms

 
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 
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 
Store your maze as a 2D image (I bet it already is). Paint the walls in black, the starting pixel in red, the ending pixel in green and all others in white.

Keep an "active list" with the (coordinates of) pixels that can be reached from the starting point in at most N steps.

---- Initialize the active list with the ending pixel (N=0).

---- For increasing N, scan the active list:
-------- For every pixel in the list:
------------ Consider its white neighbors, if any
------------ Paint them in navy, ecru, wheat or salmon, depending on the neighbor-to-pixel direction
------------ Replace the pixel by its neighbors in the list

---- Stop as soon as you meet the red pixel.

The pixel colors will allow you to trace the path.

Properly implemented with arrays using a compiled language, this will run in about 100 ms or less for a 800x800 image.
QuestionReal time peak identification Pin
Wjousts25-May-11 4:32
Wjousts25-May-11 4:32 
AnswerRe: Real time peak identification Pin
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 Pin
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 
AnswerRe: Real time peak identification [modified] Pin
Peter_in_278029-May-11 14:17
professionalPeter_in_278029-May-11 14:17 
GeneralRe: Real time peak identification Pin
Wjousts31-May-11 3:55
Wjousts31-May-11 3:55 
AnswerRe: Real time peak identification Pin
InfRes31-May-11 21:31
InfRes31-May-11 21:31 

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.