Changeset 1583:2b329fd595ef in lemon0.x for demo/sub_graph_adaptor_demo.cc
 Timestamp:
 07/22/05 17:15:29 (19 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@2085
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

demo/sub_graph_adaptor_demo.cc
r1577 r1583 1 // * c++ * 1 /* * C++ * 2 * demo/lp_maxflow_demo.cc  Part of LEMON, a generic C++ optimization library 3 * 4 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 5 * (Egervary Research Group on Combinatorial Optimization, EGRES). 6 * 7 * Permission to use, modify and distribute this software is granted 8 * provided that this copyright notice appears in all copies. For 9 * precise terms see the accompanying LICENSE file. 10 * 11 * This software is provided "AS IS" with no warranty of any kind, 12 * express or implied, and with no claim as to its suitability for any 13 * purpose. 14 * 15 */ 16 17 ///\ingroup demos 18 ///\file 19 ///\brief Computing maximum number of edgedisjoint shortest paths 20 /// 21 /// This program computes a maximum number of edgedisjoint shortest paths 22 /// between nodes \c s and \c t. 23 2 24 3 25 // Use a DIMACS max flow file as input. 4 26 // sub_graph_adaptor_demo < dimacs_max_flow_file 5 // This program computes a maximum number of edgedisjoint shortest paths6 // between s and t. 27 // Modified to eat lemon graph format! 28 7 29 8 30 #include <iostream> … … 17 39 #include <tight_edge_filter_map.h> 18 40 41 #include <lemon/graph_reader.h> 19 42 20 21 //#include <lemon/graph_reader.h>22 //#include <lemon/graph_writer.h>23 43 24 44 using namespace lemon; … … 31 51 if(argc<2) 32 52 { 33 std::cerr << "USAGE: sub_graph_adaptor_demo input_file.dim" << std::endl; 34 std::cerr << "The file 'input_file.dim' has to contain a max flow instance in DIMACS format (e.g. sub_graph_adaptor_demo.dim is such a file)." << std::endl; 53 std::cerr << "USAGE: sub_graph_adaptor_demo input_file.lgf" << std::endl; 54 std::cerr << "The file 'input_file.lgf' has to contain a max flow " 55 << "instance in \n LEMON format " 56 << "(e.g. sub_gad_input.lgf is such a file)." 57 << std::endl; 35 58 return 0; 36 59 } … … 52 75 LengthMap length(g); 53 76 54 readDimacs(is, g, length, s, t);77 //readDimacs(is, g, length, s, t); 55 78 56 // GraphWriter<SmartGraph> writer(std::cout, g);57 // writer.writeEdgeMap("length", length);58 // writer.writeNode("source",s);59 // writer.writeNode("target",t);60 // writer.run();61 79 62 // GraphReader<ListGraph> reader(is,g);63 //reader.readNode("source",s).readNode("target",t)64 //.readEdgeMap("length",length).run();80 GraphReader<SmartGraph> reader(is,g); 81 reader.readNode("source",s).readNode("target",t) 82 .readEdgeMap("length",length).run(); 65 83 66 84 cout << "edges with lengths (of form id, sourcelength>target): " << endl;
Note: See TracChangeset
for help on using the changeset viewer.