title: How to compute directed graph diameter in C++
body: <p>I have a directed graph given by a matrix and I need to write a program (C++) that computes it's diameter. I'm really lost when it comes to this. Is there a known algorithm for this? \</p>
  
  <p>How I think it should go:</p>
  
  <ul>
  <li>convert to undirected graph (for any directedMatrix[i][j] !=0 , with i from 1 to nrNodes and j from i+1 to nrNodes, make matrix[j][i]=matrix[i][j]=directedMatrix[i][j])</li>
  <li>compute max distance for any 2 nodes ( distaceMatrix[i][j] = max distance from node i to node j; distanceMatrix[i][i] = MIN)</li>
  <li>find the maxim value from the above matrix and that's our answer. </li>
  </ul>
  
  <p>Thoughts and optimizations? </p>