I think you will find the following resources very useful.
Primer Scheme
If you are not familiar with graph theory or need retraining, then look at the promotion. Overview of elementary graph theory: http://www.boost.org/doc/libs/1_58_0/libs/graph/doc/graph_theory_review.html
This primer is useful for understanding the terminology of how data structures represent graphs (adjacency matrix, adjacency list, etc.) and algorithms (width search, depth search, shortest path, etc.).
Sample code is described in detail
For an example graphing code that is described in detail, check out the next section of Boris Shaling's online book, The Boost C ++ Libraries: http://theboostcpplibraries.com/boost.graph-vertices-and-edges
Boris explains how to work with vertices and edges using adjacenty_list. The code is fully explained so you can understand each example.
Adjacency_list template parameter overview
It is important to understand the template options for adjacency_list. For example, do you need a directed or undirected graph? Do you want your graph to contain multiple edges with the same end nodes (i.e., Multigraphs)? Performance also comes into play. Boris's book explains some of them, but you will find more information about using adjacenty_list here: http://www.boost.org/doc/libs/1_58_0/libs/graph/doc/using_adjacency_list.html
Using custom objects for vertices, faces, or graphs
If you want to use custom objects for vertices, edges, or even the graph itself, then you will want to use related properties . The following links will be useful for using related properties: http://www.boost.org/doc/libs/1_58_0/libs/graph/doc/bundles.html
And perhaps this is also an example: adding custom vertices to the force graph
Detection of circular dependencies (loops)
There are many ways to detect circular dependencies, including:
Depth search : One simple way is to perform a depth search and determine if the search is already performed at a vertex already detected in the current search tree. The following is an example of detecting cyclic dependencies using depth depth searches: http://www.boost.org/doc/libs/1_58_0/libs/graph/doc/file_dependency_example.html#sec:cycles
Topological sorting : You can also detect loops using topological sorting . boost provides a topological algorithm: http://www.boost.org/doc/libs/1_58_0/libs/graph/doc/topological_sort.html
Topological sorting works on a directed acyclic graph (DAG). If the cyclic graph is passed, an exception is thrown, which indicates that the graph has a cyclic dependency. topological_sort includes a depth search, but also provides a linear order of vertices. Here is an example: http://www.boost.org/doc/libs/1_58_0/libs/graph/doc/file_dependency_example.html#sec:cycles
Strongly connected components : In addition, a search for strongly connected components may indicate whether the graph has cycles: http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/strongComponent.htm
The boost_components function computes strongly related components of a directed graph using the Tarjan algorithm. http://www.boost.org/doc/libs/1_58_0/libs/graph/doc/strong_components.htmlFile Dependency Example
Another useful link is one that has already been provided. - Enlarge the example of file dependencies, which shows how to set up the schedule of source code files, order them based on their compilation order (topological sorting), determine which files can be compiled at the same time, and determine the cyclic dependencies: http: //www.boost. org / doc / libs / 1_58_0 / libs / graph / doc / file_dependency_example.html