| 1 | #include <cstdlib> | 
|---|
| 2 | #include <boost/graph/adjacency_list.hpp> | 
|---|
| 3 |  | 
|---|
| 4 | struct edge_t | 
|---|
| 5 | { | 
|---|
| 6 | unsigned long first; | 
|---|
| 7 | unsigned long second; | 
|---|
| 8 | }; | 
|---|
| 9 |  | 
|---|
| 10 | int main() | 
|---|
| 11 | { | 
|---|
| 12 | typedef boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS, boost::no_property, boost::property<boost::edge_weight_t, int> > undirected_graph; | 
|---|
| 13 | typedef boost::property_map<undirected_graph, boost::edge_weight_t>::type weight_map_type; | 
|---|
| 14 | typedef boost::property_traits<weight_map_type>::value_type weight_type; | 
|---|
| 15 |  | 
|---|
| 16 | typedef boost::graph_traits<undirected_graph>::vertex_descriptor vertex_descriptor; | 
|---|
| 17 | typedef boost::graph_traits<undirected_graph>::edge_descriptor edge_descriptor; | 
|---|
| 18 |  | 
|---|
| 19 | edge_t edges[] = {{1, 5}, {4, 5}, {5, 6}}; | 
|---|
| 20 | weight_type ws[] = {2, 3, 1}; | 
|---|
| 21 | undirected_graph g(edges, edges + 3, ws, 8, 3); | 
|---|
| 22 |  | 
|---|
| 23 | add_edge(5, 5, g); | 
|---|
| 24 | clear_vertex(5, g); | 
|---|
| 25 |  | 
|---|
| 26 | return EXIT_SUCCESS; | 
|---|
| 27 | } | 
|---|