Note that there are some explanatory texts on larger screens.

plurals
  1. PORunning time of BFS-based path-finding algorithm
    primarykey
    data
    text
    <p>I came up with a BFS-based path-finding algorithm intended as an alternate to Diskjstra's (to be honest, I suspect other have come up with it in the past, but I can't find any mention of it online anywhere). I'm trying to figure out what the running time is, but my friends and I are debating it and haven't been able to come up with a definitive answer. Here's a link to a description and implementation of the algorithm in Go: <a href="https://github.com/joshlf13/bfspath" rel="nofollow">https://github.com/joshlf13/bfspath</a></p> <p>I am under the impression that the running time is e + e^2 + e^4 + ... + e^2d where e is the average number of edges per vertex and d is the distance of the final shortest path (giving O(e^2d)). The problem is, this relies on the result of the algorithm which, as my friend points out, shouldn't be included in a consideration of running time.</p> <p>My reasoning is this: each pass of the BFS increases the number of vertices considered by a multiple of e. Further, each time a vertex is considered, it's e operations. Thus, each pass is v (number of vertices in pass) times e. And if v is 1 then e then e^2, etc, v*e is e + e^2 + e^4, etc.</p> <p>A different approach is to consider the running time in terms of number of edges considered. An edge of length N takes N operations. Thus, for a graph with E edges and an average edge-length of N, it's O(N*E). However, this only applies to the portion of the graph which is considered during operation of the algorithm, and the size of that subset doesn't scale linearly with the distance between the start and endpoints, which makes a true consideration of O() difficult.</p> <p>Ideas...?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload