/* -*- C++ -*- * * This file is a part of LEMON, a generic C++ optimization library * * Copyright (C) 2003-2006 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * * Permission to use, modify and distribute this software is granted * provided that this copyright notice appears in all copies. For * precise terms see the accompanying LICENSE file. * * This software is provided "AS IS" with no warranty of any kind, * express or implied, and with no claim as to its suitability for any * purpose. * */ #include #include #include #include #include #include"bench_tools.h" using namespace std; using namespace lemon; inline int numOfOnes(int n,int dim) { int s=0; for(int i=0;i>=1; } return s; } inline int numOfZeros(int n,int dim) { int s=dim; for(int i=0;i>=1; } return s; } int main(int argc, char *argv[]) { // typedef ListGraph Graph; typedef SmartGraph Graph; GRAPH_TYPEDEFS(Graph); Graph G; Timer T; if(argc!=2) { cout << "Usage: " << argv[0] << " dim\n"; return 1; } int dim=atoi(argv[1]); // cout << "Creating Hipercube ("<< (1< nodes; addBiDirHyperCube(G,dim,nodes); PrintTime("GENGRAPH",T); T.restart(); Graph::EdgeMap map(G); for(int i=0;i<5;i++) { Primes P; for(int i=0;i Dij(G,map); for(int i=0;i<10;i++) Dij.run(nodes[0]); } PrintTime("DIJKSTRA",T); T.restart(); { Graph::EdgeMap flow(G); Preflow MF(G,nodes[0],nodes[1<