1 | #include <string>
|
---|
2 | #include <boost/graph/adjacency_list.hpp>
|
---|
3 | #include <boost/graph/labeled_graph.hpp>
|
---|
4 |
|
---|
5 | namespace b = boost;
|
---|
6 |
|
---|
7 | struct vertex_data {
|
---|
8 | std::string name;
|
---|
9 | };
|
---|
10 |
|
---|
11 | typedef b::adjacency_list<b::vecS, b::listS, b::directedS, vertex_data> test_adjacency_list;
|
---|
12 | typedef b::labeled_graph<test_adjacency_list, std::string> graph;
|
---|
13 | typedef graph::vertex_descriptor vertex;
|
---|
14 |
|
---|
15 | int main() {
|
---|
16 | graph g;
|
---|
17 | g.add_vertex("foo");
|
---|
18 | g.remove_vertex("foo");
|
---|
19 | vertex v = g.add_vertex("foo");
|
---|
20 | g.graph()[v].name = "bar";
|
---|
21 | }
|
---|