private static double[][] createBwMatrix(TopologicalGraph graph,boolean directed){
  int nodes=graph.getNumberOfNodes();
  double[][] mtx=new double[nodes][nodes];
  for (int i=0; i < nodes; i++) {
    for (int j=0; j < nodes; j++) {
      mtx[i][j]=0.0;
    }
  }
  Iterator<TopologicalLink> iter=graph.getLinkIterator();
  while (iter.hasNext()) {
    TopologicalLink edge=iter.next();
    mtx[edge.getSrcNodeID()][edge.getDestNodeID()]=edge.getLinkBw();
    if (!directed) {
      mtx[edge.getDestNodeID()][edge.getSrcNodeID()]=edge.getLinkBw();
    }
  }
  return mtx;
}

private static double [ ] [ ] createBwMatrix ( TopologicalGraph graph , boolean directed ) { int nodes = graph . getNumberOfNodes ( ) ; double [ ] [ ] mtx = new double [ nodes ] [ nodes ] ; for ( int i = 0 ; i < nodes ; i ++ ) { for ( int j = 0 ; j < nodes ; j ++ ) { mtx [ i ] [ j ] = 0.0 ; } } Iterator < TopologicalLink > iter = graph . getLinkIterator ( ) ; while ( iter . hasNext ( ) ) { TopologicalLink edge = iter . next ( ) ; mtx [ edge . getSrcNodeID ( ) ] [ edge . getDestNodeID ( ) ] = edge . getLinkBw ( ) ; if ( ! directed ) { mtx [ edge . getDestNodeID ( ) ] [ edge . getSrcNodeID ( ) ] = edge . getLinkBw ( ) ; } } return mtx ; }
creates the matrix containing the available bandwidth between every pair of nodes .
