alpar@708: // -*- mode:C++ -*- alpar@708: alpar@1632: #include alpar@921: #include alpar@921: #include alpar@921: #include alpar@921: #include alpar@729: alpar@711: #include"bench_tools.h" alpar@708: alpar@708: using namespace std; alpar@921: using namespace lemon; alpar@708: alpar@718: inline int numOfOnes(int n,int dim) alpar@718: { alpar@718: int s=0; alpar@718: for(int i=0;i>=1; alpar@718: } alpar@718: return s; alpar@718: } alpar@718: alpar@718: inline int numOfZeros(int n,int dim) alpar@718: { alpar@718: int s=dim; alpar@718: for(int i=0;i>=1; alpar@718: } alpar@718: return s; alpar@718: } alpar@718: alpar@708: int main(int argc, char *argv[]) alpar@708: { alpar@708: // typedef ListGraph Graph; alpar@708: typedef SmartGraph Graph; alpar@708: alpar@708: ///\bug GRAPH_TYPEDEF_FACTORY(Graph); alpar@708: GRAPH_TYPEDEF_FACTORY_NOTYPENAME(Graph); alpar@708: alpar@708: Graph G; alpar@708: alpar@708: Timer T; alpar@708: alpar@708: if(argc!=2) { alpar@708: cout << "Usage: " << argv[0] << " dim\n"; alpar@708: return 1; alpar@708: } alpar@708: alpar@708: int dim=atoi(argv[1]); alpar@708: alpar@718: // cout << "Creating Hipercube ("<< (1< nodes; alpar@1689: addBiDirHyperCube(G,dim,nodes); alpar@718: alpar@718: PrintTime("GENGRAPH",T); alpar@718: alpar@708: T.reset(); alpar@708: Graph::EdgeMap map(G); alpar@729: for(int i=0;i<5;i++) { alpar@708: Primes P; alpar@708: for(int i=0;i Dij(G,map); alpar@729: for(int i=0;i<10;i++) alpar@729: Dij.run(nodes[0]); alpar@708: } alpar@718: PrintTime("DIJKSTRA",T); alpar@718: alpar@718: T.reset(); alpar@718: { alpar@718: Graph::EdgeMap flow(G); alpar@708: alpar@840: Preflow MF(G,nodes[0],nodes[1<