alpar@1956: /* -*- C++ -*- alpar@1956: * alpar@1956: * This file is a part of LEMON, a generic C++ optimization library alpar@1956: * alpar@1956: * Copyright (C) 2003-2006 alpar@1956: * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport alpar@1956: * (Egervary Research Group on Combinatorial Optimization, EGRES). alpar@1956: * alpar@1956: * Permission to use, modify and distribute this software is granted alpar@1956: * provided that this copyright notice appears in all copies. For alpar@1956: * precise terms see the accompanying LICENSE file. alpar@1956: * alpar@1956: * This software is provided "AS IS" with no warranty of any kind, alpar@1956: * express or implied, and with no claim as to its suitability for any alpar@1956: * purpose. alpar@1956: * alpar@1956: */ 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@1756: GRAPH_TYPEDEFS(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@1847: T.restart(); 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@1847: T.restart(); alpar@718: { alpar@718: Graph::EdgeMap flow(G); alpar@708: alpar@840: Preflow MF(G,nodes[0],nodes[1<