3

What is best (in terms of time complexity) known algorithm (approximate or exact) for finding diameter of a large undirected graph?

The diameter is defined as longest of shortest paths between any two nodes.

I know that naive solution takes O(nm) steps and is basically taking pairs of all vertices and finds distances between them.

This is very slow for large graphs, 2^20 nodes or more.

An example graph

http://snap.stanford.edu/data/com-Orkut.html

Raphael
  • 72,336
  • 29
  • 179
  • 389
php--
  • 131
  • 1
  • 2
    Especially when you also care about approximate methods, best in what sense? – Juho Jan 14 '15 at 18:45
  • Best in terms of time complexity – php-- Jan 14 '15 at 19:01
  • 1
    If you're willing to settle for a 2-approximation, you can run BFS from an arbitrary node. – Yuval Filmus Jan 14 '15 at 20:56
  • How would 2 approximation work in this case? Looks like it would give different answer in each case. – php-- Jan 14 '15 at 21:39
  • @RB It is a worst-case 2-approximation. It will return a value between the actual diameter and 2x the actual diameter. – Tom van der Zanden Jan 15 '15 at 09:20
  • @TomvanderZanden but of course this approach cannot output a value which is higher than the real diameter. Therefore, the above 2-approximation returns a value between the diameter and 0.5x the actual diameter. – Ran G. Jan 16 '15 at 06:33
  • There are several studies about this topic. For example, I suggest this paper. http://dl.acm.org/citation.cfm?id=1455266 – Bangye Jan 16 '15 at 09:25

0 Answers0