On Sunday 07 May 2006 17:09, sean yang wrote:
Yeah, I agree with you. For the first question, I think I'd better to save the strings to an vector and build a relationship between strings in this vector and vertices in the graph.
I think that's a reasonable approach. I suggested a set since it would automatically take care of the problem of duplicates, but you obviously know your application better than I do.
Thanks for the reply. I have a question for concept requirements. For example, if I declare a Graph representation by typedef adjacency_list
, property > Graph; How can I know if this Graph satisfies the reqirement of a certain concept, say AdjacencyMatrix ?
The answer is slightly complex because of the nature of concepts. A concept is
a set of syntactic and semantic requirements a type must satisfy to qualify
as an argument to a generic function. For example, if objects of type Graph
are to qualify as arguments to a function that requires the AdjacencyMatrix
concept, the expression edge( u, v, g ) must compile. This can obviously be
checked by the compiler, and the BGL makes it easy to do so:
#include