COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
07/22/05 17:15:29 (19 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2085
Message:

Documented some more demo programs.

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 edge-disjoint shortest paths
     20///
     21/// This program computes a maximum number of edge-disjoint shortest paths
     22/// between nodes \c s and \c t.
     23
    224
    325// Use a DIMACS max flow file as input.
    426// sub_graph_adaptor_demo < dimacs_max_flow_file
    5 // This program computes a maximum number of edge-disjoint shortest paths
    6 // between s and t.
     27// Modified to eat lemon graph format!
     28
    729
    830#include <iostream>
     
    1739#include <tight_edge_filter_map.h>
    1840
     41#include <lemon/graph_reader.h>
    1942
    20 
    21 //#include <lemon/graph_reader.h>
    22 //#include <lemon/graph_writer.h>
    2343
    2444using namespace lemon;
     
    3151  if(argc<2)
    3252  {
    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;
    3558      return 0;
    3659  }
     
    5275  LengthMap length(g);
    5376
    54   readDimacs(is, g, length, s, t);
     77  //readDimacs(is, g, length, s, t);
    5578
    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();
    6179
    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();
    6583
    6684  cout << "edges with lengths (of form id, source--length->target): " << endl;
Note: See TracChangeset for help on using the changeset viewer.