Function to generate the tree
static int sumOfshortestPath ( int N , int E , int [ , ] edges ) { int [ , ] g = new int [ N , N ] ; for ( int i = 0 ; i < N ; i ++ ) { for ( int j = 0 ; j < N ; j ++ ) { g [ i , j ] = INF ; } }