set the number of vertices in boost:graph -


given empty boost::graph g, want set number of vertices in graph , add edges then. documentation, cannot find related functions. examples found defines size of vertices in initialization (like graph g(10) defines graph 10 vertices). don't know size when define graph. want first define graph g, , set size later.

the simplest approach call boost::add_vertex( graph ) method each vertex want.

here nice place start using c++ boost's graph library

note not have add vertices 1 one. if care edges, add_edge() add missing vertices you.


Comments