3

I'm looking at using Boost Graph Library as the basis for a dag graph. I haven't really used it all that much before, so not too familiar with how it works.

Although I don't need edge weights and clever traversing algorithms, I would quite like to get the serialisation for free, plus the constraints enforcing dag graphs and disallowing parallel arcs.

Planning on abstracting the complexities of the BGL, but is this overkill for this kind of thing, as I'll only be selecting a node and recursing over all of its children?

I would also like to be able to have isolated nodes that aren't connected to other nodes in the graph, but still be able to iterate over these in the graph. Is this something that is provided, or would I have to store my own collection of nodes?

1 Answer 1

2

Iteration over nodes in a graph is provided. There's an interface that returns a begin, end pair of iterators over the nodes (and a similar one over the edges):

std::pair<vertex_iterator, vertex_iterator> vertices(const adjacency_list& g)

From the documentation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.