Click here to Skip to main content
15,887,451 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Shortest path related Pin
Alivemau526-Oct-09 5:20
Alivemau526-Oct-09 5:20 
GeneralRe: Shortest path related Pin
Alan Balkany26-Oct-09 5:36
Alan Balkany26-Oct-09 5:36 
GeneralRe: Shortest path related Pin
Alivemau526-Oct-09 7:22
Alivemau526-Oct-09 7:22 
GeneralRe: Shortest path related Pin
Alan Balkany26-Oct-09 8:20
Alan Balkany26-Oct-09 8:20 
GeneralRe: Shortest path related Pin
Alan Balkany26-Oct-09 8:23
Alan Balkany26-Oct-09 8:23 
GeneralRe: Shortest path related Pin
Alivemau527-Oct-09 6:19
Alivemau527-Oct-09 6:19 
GeneralRe: Shortest path related Pin
ely_bob27-Oct-09 6:32
professionalely_bob27-Oct-09 6:32 
GeneralRe: Shortest path related Pin
Alan Balkany28-Oct-09 5:06
Alan Balkany28-Oct-09 5:06 
In general, rotate your direction vector right at each step, and when you hit an obstacle rotate left.

With your right hand on the wall, you try to rotate right (into the wall) at each step. Since you can't go into the wall, you then rotate left, and your resulting path is a straight line along the wall.

If you come to a corner, when you rotate right you turn right, which takes you around the corner.

If you come to an obstacle, rotating right doesn't work, so you rotate left (aiming straight ahead). Since there's an obstacle, going straight doesn't work, so you rotate left again. If that path is clear, you proceed in that direction (left from your original direction). If that path is also blocked (a dead end), you rotate left again (facing backwards) and advance back the way you came.
GeneralRe: Shortest path related Pin
Alivemau530-Oct-09 11:20
Alivemau530-Oct-09 11:20 
GeneralRe: Shortest path related Pin
Alan Balkany28-Oct-09 5:11
Alan Balkany28-Oct-09 5:11 
GeneralRe: Shortest path related Pin
Alivemau528-Oct-09 12:57
Alivemau528-Oct-09 12:57 
GeneralRe: Shortest path related Pin
Member 419459328-Oct-09 15:55
Member 419459328-Oct-09 15:55 
GeneralRe: Shortest path related Pin
Alivemau528-Oct-09 16:29
Alivemau528-Oct-09 16:29 
GeneralRe: Shortest path related Pin
Member 419459328-Oct-09 17:26
Member 419459328-Oct-09 17:26 
GeneralRe: Shortest path related Pin
Alivemau528-Oct-09 18:48
Alivemau528-Oct-09 18:48 
GeneralRe: Shortest path related Pin
Member 419459329-Oct-09 5:02
Member 419459329-Oct-09 5:02 
GeneralRe: Shortest path related Pin
Alivemau530-Oct-09 5:09
Alivemau530-Oct-09 5:09 
GeneralRe: Shortest path related [modified] Pin
Alivemau530-Oct-09 5:50
Alivemau530-Oct-09 5:50 
GeneralRe: Shortest path related Pin
Alivemau530-Oct-09 11:19
Alivemau530-Oct-09 11:19 
GeneralRe: Shortest path related Pin
Member 419459330-Oct-09 6:05
Member 419459330-Oct-09 6:05 
GeneralRe: Shortest path related Pin
Rozis29-Oct-09 12:31
Rozis29-Oct-09 12:31 
GeneralRe: Shortest path related Pin
novice__geek29-Oct-09 23:34
novice__geek29-Oct-09 23:34 
AnswerRe: Shortest path related Pin
ely_bob27-Oct-09 6:28
professionalely_bob27-Oct-09 6:28 
GeneralRe: Shortest path related Pin
Alivemau527-Oct-09 10:37
Alivemau527-Oct-09 10:37 
GeneralRe: Shortest path related Pin
Luc Pattyn27-Oct-09 11:23
sitebuilderLuc Pattyn27-Oct-09 11:23 

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.