COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/work/deba/graph_io_test.cc @ 1032:9e903d3a1ef6

Last change on this file since 1032:9e903d3a1ef6 was 1032:9e903d3a1ef6, checked in by Balazs Dezso, 19 years ago

GraphReader? under construction
InversableMap?

File size: 556 bytes
Line 
1#include <lemon/smart_graph.h>
2#include <lemon/graph_reader.h>
3
4#include <iostream>
5#include <fstream>
6
7using namespace std;
8using namespace lemon;
9
10int main() {
11  ifstream input("test.lgf");
12  SmartGraph graph;
13  GraphReader<SmartGraph> reader(input, graph);
14  SmartGraph::NodeMap<int> cost(graph);
15  reader.readNodeMap("cost", cost);
16  SmartGraph::NodeMap<string> color(graph);
17  reader.readNodeMap("color", color);
18  reader.read();
19  for (SmartGraph::NodeIt it(graph); it != INVALID; ++it) {
20    cout << cost[it] << color[it] << endl;
21  }
22  return 0;
23}
Note: See TracBrowser for help on using the repository browser.