I am confused about how to actually create a Graph using the boost library, I have looked at the example code and there are no comments explaining what it does.
How do you make a graph, and add vertices and edges as you go?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s a simple example, using an adjacency list and executing a topological sort:
I agree that the boost::graph documentation can be intimidating, but it’s worth having a look.
I can’t recall if the contents of the printed book is the same, I suspect it’s a bit easier on the eyes. I actually learnt to use boost:graph from the book. The learning curve can feel pretty steep though. The book I refer to and reviews can be found here.