COIN-OR::LEMON - Graph Library

Changeset 1693:269f0cbfbcc8 in lemon-0.x for demo


Ignore:
Timestamp:
09/30/05 15:15:28 (19 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2219
Message:

Improving GridGraph? and HyperCubeGraph?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • demo/grid_graph_demo.cc

    r1681 r1693  
    4242    bfs.run(start, stop) << std::endl;
    4343
    44   GridGraph::NodeMap<xy<double> > coord(graph);
    45   for (int i = 0; i < graph.width(); ++i) {
    46     for (int j = 0; j < graph.height(); ++j) {
    47       coord[graph(i, j)] = xy<double>( i * 10.0, j * 10.0);
    48     }
    49   }
    50  
    51   FilteredGraph::EdgeMap<Color> color(filtered, Color(0.0, 0.0, 0.0));
     44  FilteredGraph::EdgeMap<bool> path(filtered, false);
    5245 
    5346  for (GridGraph::Node node = stop;
    5447       node != start; node = bfs.predNode(node)) {
    55     color[bfs.pred(node)] = Color(1.0, 0.0, 0.0);
     48    path[bfs.pred(node)] = true;
    5649  }
    5750 
     
    5952    title("Grid graph").
    6053    copyright("(C) 2005 LEMON Project").
    61     coords(coord).
     54    coords(scaleMap(indexMap(graph), 10)).
    6255    enableParallel().
    63     nodeScale(.45).
     56    nodeScale(0.5).
    6457    drawArrows().
    65     edgeColors(color).
     58    edgeColors(composeMap(ColorSet(), path)).
    6659    run();
    6760 
Note: See TracChangeset for help on using the changeset viewer.