1 | #include <cassert>
|
---|
2 | #include <iostream>
|
---|
3 | #include <boost/graph/adjacency_list.hpp>
|
---|
4 | #include <boost/graph/graphviz.hpp>
|
---|
5 | #include <boost/graph/graph_utility.hpp>
|
---|
6 |
|
---|
7 | using namespace boost;
|
---|
8 |
|
---|
9 | typedef adjacency_list<vecS, vecS, directedS, property<vertex_name_t, std::string> > graph_t;
|
---|
10 |
|
---|
11 | int main()
|
---|
12 | {
|
---|
13 | std::ifstream ifs("a.dot");
|
---|
14 | assert(ifs.good());
|
---|
15 | dynamic_properties p;
|
---|
16 | graph_t g;
|
---|
17 | p.property("id", get(vertex_name, g));
|
---|
18 | read_graphviz(ifs, g, p, "id");
|
---|
19 | assert(num_vertices(g) == 2);
|
---|
20 | print_graph(g, get(vertex_name, g));
|
---|
21 | write_graphviz(std::cout, g, p, std::string("id"));
|
---|
22 | return 0;
|
---|
23 | }
|
---|