Boost logo

Boost Users :

From: sean yang (seanatpurdue_at_[hidden])
Date: 2006-05-06 15:14:04

I am a newbie using BGL and only read a couple of example source code. I
have a question about class representing a graph. It seems adjacency_list
represent a graph, but it seems there is a class hierarchy (as shown in (2)
) to represent a graph. What is their relationship?

(1) adjacency_list can represent a graph, e.g.,
typedef adjacency_list<vecS, vecS, bidirectionalS, no_property,
property<edge_weight_t, float> > Graph;

And the online manual give a list of Graph representation. I guess it's a
hierarchical class representation. i.e., Graph <--Incidence Graph
<--Bidirectional Graph. Am I right? But if so, I did not find the
constructor of these classes.
Furthermore, this class hierarchy has give a full classification of graph,
why is there a adjacency_list representation?

Chapter 11. The Boost Graph Interface
   1. Graph
   2. Incidence Graph
   3. Bidirectional Graph
   4. Adjacency Graph
   5. Vertex List Graph
   6. Edge List Graph
   7. Vertex and Edge List Graph
   8. Mutable Graph
   9. Property Graph
  10. Mutable Property Graph

(3) There is an exmple of UndirectedGraph in the book of "User guide and
reference manual"
UndirectedGraph undigraph(V);
add_edge(0, undigraph);

is there a way not specifying vertice number when defining an object and
dynamically adding vertex when according to user input? i.e, something like

UndirectedGraph undigraph( );
while (getline(in, line)){
add_edge(line, undigraph);

Express yourself instantly with MSN Messenger! Download today - it's FREE!

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at