Difference between revisions of "Boost/BGL"
From ProgrammingExamples
< Boost
Daviddoria (Talk | contribs) (Created page with ' === Basics === * Create a graph - This is the most fundamental process of using BGL - creating a graph. This example explains 3 methods of creating a g…') |
Daviddoria (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | |||
=== Basics === | === Basics === | ||
* [[CPP/Boost/CreateGraph|Create a graph]] - This is the most fundamental process of using BGL - creating a graph. This example explains 3 methods of creating a graph, using adjacency_list directly, and also using the directed_graph and undirected_graph subclasses. | * [[CPP/Boost/CreateGraph|Create a graph]] - This is the most fundamental process of using BGL - creating a graph. This example explains 3 methods of creating a graph, using adjacency_list directly, and also using the directed_graph and undirected_graph subclasses. | ||
− | |||
* [[CPP/Boost/BGL/EdgeExists|Check if an edge exists]] - If it does, you also get the edge_descriptor | * [[CPP/Boost/BGL/EdgeExists|Check if an edge exists]] - If it does, you also get the edge_descriptor | ||
* [[CPP/Boost/BGL/CopyAGraph|Copy a graph]] | * [[CPP/Boost/BGL/CopyAGraph|Copy a graph]] | ||
Line 18: | Line 16: | ||
* [[CPP/Boost/BGL/MakeBFSVisitor|Breadth first search with make_bfs_visitor]] | * [[CPP/Boost/BGL/MakeBFSVisitor|Breadth first search with make_bfs_visitor]] | ||
* [[CPP/Boost/BGL/DepthFirstSearch|Depth first search (DFS)]] | * [[CPP/Boost/BGL/DepthFirstSearch|Depth first search (DFS)]] | ||
+ | |||
+ | === Directed graphs === | ||
+ | * [[CPP/Boost/BGL/IterateEdges|Iterate over all edges in a directed graph]] | ||
+ | |||
+ | === Undirected graphs === | ||
+ | * [[CPP/Boost/BGL/Undirected/IterateEdges|Iterate over all edges in an undirected graph]] | ||
=== I/O === | === I/O === |
Revision as of 18:58, 15 November 2011
Basics
- Create a graph - This is the most fundamental process of using BGL - creating a graph. This example explains 3 methods of creating a graph, using adjacency_list directly, and also using the directed_graph and undirected_graph subclasses.
- Check if an edge exists - If it does, you also get the edge_descriptor
- Copy a graph
- Access an edge
- Remove a vertex from a graph
- Remove an edge from a graph
- Add properties to edges
- Add properties to vertices
- Bundled properties
- Get a list of neighboring (adjacent) vertices
- Directed graphs only give access to out edges
- Bidirectional graphs give access to both in and out edges
- Number of incoming, outgoing, and total edges
- Breadth first search (BFS with a custom visitor)
- Breadth first search with make_bfs_visitor
- Depth first search (DFS)
Directed graphs
Undirected graphs
I/O
- Read a graph from a file
- Write a graph to a file
- Relabel input vertices read from a dot file so they match the labels used in the file
Algorithms
- Find the shortest path (Dijkstra) from a specified vertex to all other vertices in a directed graph
- Find the shortest path (Dijkstra) from a specified vertex to all other vertices in an undirected graph
- Find the shortest path (Dijkstra) from one specified vertex to another specified vertex in a graph
- Cluster a graph using betweenness centrality