title: how to calculate the network diameter
body: <p>I have data stored in relational database mysql and PHP.
  I have a table called "rel" which has two fields:</p>
  
  <pre><code>from_node  |  to_node
  =====================
  1               2
  1               3
  2               3
  </code></pre>
  
  <p>and so on......</p>
  
  <p>How can I calculate the network Diameter of a network. I know it is the longest or shortest path between any two pairs but how do I calculate it?
  Is there any PHP script or function which can help me to do it?</p>