|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#2
|
|||
|
|||
|
Re: Dijkstra's(?) Algorithm help
Okay, I think I get it. Just a couple questions:
|
|
#3
|
|||
|
|||
|
Re: Dijkstra's(?) Algorithm help
1) Traditionally Dijkstra's is thought described in terms of a graph with vertices connected edges. The example with the in the previous post has the centers of each grid as vertices and all adjacent grid centers are connected by edges. (Pretend a chessboard was represented as a graph with each square being an edge)
For a map of line segments, each point at the end of a line segment would be the vertex. And the line segment would be the edge. It also follows that the length of the line segment would be the edge weight. 2) You could make a function that adds a "maneuver" cost to each edge, and the algorithm would work fine. (Ie it takes 2 seconds to turn to get to a line and 9 seconds to travel the line, so I just say the overall time it takes to go down a line is 11 seconds. 3) A* is another path-finding algorithm (There is a link in the previous post) with a much lower computational cost than Dijkstra's method. I recommend you first get a solid understanding of Dijkstra's and some basic graph theory before looking too deeply into A*. Last edited by hzheng_449 : 06-11-2014 at 20:09. |
|
#4
|
||||
|
||||
|
Re: Dijkstra's(?) Algorithm help
Quote:
2. Dijkstra's Algorithm explanations use the term "distance" because that's the easiest term to understand when beginning to learn path planning. However, it's important to realize that physical distance is often not the only factor when navigating from point to point. A better term to use is "cost" instead of "distance." This would let you factor in time for turning and even things like energy conservation and a risk factor for getting stuck. 3. hzheng_449 hit the nail on the head. If your algorithm is a bike on training wheels, Dijkstra is without training wheels, and A* is a motorcycle. It's best to learn to ride without training wheels before jumping on a motorcycle. |
|
#5
|
|||
|
|||
|
Re: Dijkstra's(?) Algorithm help
Interesting, I've been looking into both, dijkstras more so. Thank's ya'll very much!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|