benchmark/hcube.cc
changeset 1948 9e9c035a08be
parent 1756 b1f441f24d08
child 1956 a055123339d5
equal deleted inserted replaced
3:8b00946921c3 4:505d7b1ab74b
    50   int dim=atoi(argv[1]);
    50   int dim=atoi(argv[1]);
    51   
    51   
    52 //   cout << "Creating Hipercube ("<< (1<<dim) << " nodes, "
    52 //   cout << "Creating Hipercube ("<< (1<<dim) << " nodes, "
    53 //        << dim*(1<<dim) << " edges):";
    53 //        << dim*(1<<dim) << " edges):";
    54 
    54 
    55   T.reset();
    55   T.restart();
    56   vector<Node> nodes;
    56   vector<Node> nodes;
    57   addBiDirHyperCube(G,dim,nodes);
    57   addBiDirHyperCube(G,dim,nodes);
    58 
    58 
    59   PrintTime("GENGRAPH",T);
    59   PrintTime("GENGRAPH",T);
    60 
    60 
    61   T.reset();
    61   T.restart();
    62   Graph::EdgeMap<int> map(G);
    62   Graph::EdgeMap<int> map(G);
    63   for(int i=0;i<5;i++) {
    63   for(int i=0;i<5;i++) {
    64     Primes P;
    64     Primes P;
    65     for(int i=0;i<dim*(1<<dim);i++) P();
    65     for(int i=0;i<dim*(1<<dim);i++) P();
    66     
    66     
    82 //     }
    82 //     }
    83   }
    83   }
    84   
    84   
    85   PrintTime("GENLENGTHS",T);
    85   PrintTime("GENLENGTHS",T);
    86 
    86 
    87   T.reset();
    87   T.restart();
    88   {
    88   {
    89     Dijkstra<Graph> Dij(G,map);
    89     Dijkstra<Graph> Dij(G,map);
    90     for(int i=0;i<10;i++)
    90     for(int i=0;i<10;i++)
    91       Dij.run(nodes[0]);
    91       Dij.run(nodes[0]);
    92   }
    92   }
    93   PrintTime("DIJKSTRA",T);
    93   PrintTime("DIJKSTRA",T);
    94 
    94 
    95   T.reset();
    95   T.restart();
    96   {
    96   {
    97    Graph::EdgeMap<int> flow(G);
    97    Graph::EdgeMap<int> flow(G);
    98    
    98    
    99     Preflow<Graph,int> MF(G,nodes[0],nodes[1<<dim-1],map,flow);
    99     Preflow<Graph,int> MF(G,nodes[0],nodes[1<<dim-1],map,flow);
   100     for(int i=0;i<10;i++)
   100     for(int i=0;i<10;i++)