#include #include "graph_reader.h" #include #include using namespace std; using namespace lemon; int main() { ifstream input("test.lgf"); SmartGraph graph; GraphReader reader(input, graph); SmartGraph::NodeMap id(graph); reader.readNodeMap("id", id); SmartGraph::NodeMap cost(graph); reader.readNodeMap("cost", cost); SmartGraph::NodeMap color(graph); reader.readNodeMap("color", color); SmartGraph::NodeMap description(graph); reader.readNodeMap("description", description); SmartGraph::EdgeMap mmap(graph); reader.readEdgeMap("mmap", mmap); reader.skipEdgeMap("description"); try { reader.read(); } catch (IOException& e) { cerr << e.what() << endl; } catch (Exception e) { cerr << e.what() << endl; } for (SmartGraph::NodeIt it(graph); it != INVALID; ++it) { cout << cost[it] << ' ' << color[it] << ' ' << description[it] << endl; } for (SmartGraph::EdgeIt it(graph); it != INVALID; ++it) { cout << mmap[it] << ' ' << id[graph.source(it)] << ' ' << id[graph.target(it)] << endl; } return 0; }