Tuesday, 15 May 2012

Algorithm for diameter of graph? -


If you have a graph, and need to find it in diameter (which is the maximum distance between the two nodes) How can you do this in O (log v * (v + e)) complexity.

Wikipedia says that you call it binary heap . But I do not understand how it works. Can anyone please explain?

Or show a pseudoepod?

g = (v, e) for the general graph none < Code> O (Log V * (V + E)) The time-intensity algorithm known to calculate the diameter is the current best solution O (V * V * V) , for example, Computing all the least paths with the Floyd Warshal algorithm. For the rare graph, that is when e is in o (N * N) , then Johnson's algorithm gives you the O (V * V * log (V) + V with E) The complexity of a better time.

If you have certain properties in the graph, then you can be better.

So the bad news is that, Dish would not be enough in the general case ...

No comments:

Post a Comment