Before revision:  It runs in O(n^{2\omega})\leq O(n^{4.75}) time, where \omega \approx  2.373  is the matrix multiplication exponent and n is the number of vertices and edges of G. We improve the running time to O(n\log n).
After revision:  It runs in O(n^{2\omega})\leq O(n^{4.75}) time, where \omega \approx 2.373 ) is the matrix multiplication exponent and n is the number of vertices and edges of G. We improve the running time to O(n\log n).