COIN-OR::LEMON - Graph Library

Changeset 1683:13648409b596 in lemon-0.x


Ignore:
Timestamp:
09/13/05 14:41:02 (19 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2205
Message:

Input file for coloring.

Location:
demo
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • demo/coloring.cc

    r1636 r1683  
    2929using namespace lemon;
    3030
    31 int main(int argc, char *argv[])
    32 {
    33   if(argc<2)
    34   {
    35       std::cerr << "USAGE: coloring input_file.lgf" << std::endl;
    36       std::cerr << "The file 'input_file.lgf' has to contain a graph in LEMON format together with a nodemap called 'coords' to draw the graph (e.g. sample.lgf is not such a file)." << std::endl;
    37       return 0;
    38   }
    39 
    40 
    41   //input stream to read the graph from
    42   std::ifstream is(argv[1]);
     31int main() {
    4332
    4433  typedef UndirSmartGraph Graph;
     
    4837  typedef Graph::IncEdgeIt IncEdgeIt;
    4938
     39  std::cout << "Six coloring of a plan graph" << std::endl;
     40  std::cout << "Input file: coloring.lgf" << std::endl;
     41  std::cout << "Output file: coloring.eps" << std::endl;
     42
    5043  Graph graph;
    5144
    52   UndirGraphReader<Graph> reader(is, graph);
     45  UndirGraphReader<Graph> reader("coloring.lgf", graph);
    5346  Graph::NodeMap<xy<double> > coords(graph);
    5447  reader.readNodeMap("coords", coords);
     
    9588  ColorSet colorSet;
    9689
    97   graphToEps(graph, "six_coloring.eps").
    98     title("Six Colored Graph").copyright("(C) 2005 LEMON Project").
     90  graphToEps(graph, "coloring.eps").
     91    title("Six Colored Plan Graph").copyright("(C) 2005 LEMON Project").
    9992    coords(coords).nodeColors(composeMap(colorSet, color)).
    100     scaleToA4().run();
     93    nodeScale(5.0).scaleToA4().run();
    10194
    10295  return 0;
Note: See TracChangeset for help on using the changeset viewer.