### R-MAT Graph Generation Example (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/scalable_rmat_generator Provides a complete C++ example demonstrating how to use `scalable_rmat_iterator` to create a distributed graph. It includes necessary Boost headers, defines a graph type using `compressed_sparse_row_graph` with distributed properties, and initializes the graph with R-MAT generated edges using MPI. ```cpp #include #include #include #include using boost::graph::distributed::mpi_process_group; typedef compressed_sparse_row_graph > Graph; typedef boost::scalable_rmat_iterator RMATGen; int main() { boost::minstd_rand gen; mpi_process_group pg; int N = 100; boost::parallel::variant_distribution distrib = boost::parallel::block(pg, N); // Create graph with 100 nodes and 400 edges Graph g(RMATGen(pg, distrib, gen, N, 400, 0.57, 0.19, 0.19, 0.05), RMATGen(), N, pg, distrib); return 0; } ``` -------------------------------- ### R-MAT Graph Generation Example (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/sorted_rmat_generator An example demonstrating how to use the `sorted_rmat_iterator` to generate a graph with 100 nodes and 400 edges using `boost::minstd_rand` as the random number generator. It initializes a `compressed_sparse_row_graph` with R-MAT generated edges. ```cpp #include #include #include typedef boost::compressed_sparse_row_graph<> Graph; typedef boost::sorted_rmat_iterator RMATGen; int main() { boost::minstd_rand gen; // Create graph with 100 nodes and 400 edges Graph g(RMATGen(gen, 100, 400, 0.57, 0.19, 0.19, 0.05), RMATGen(), 100); return 0; } ``` -------------------------------- ### Example: Creating a Graph with Unique R-MAT Generator (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/unique_rmat_generator Demonstrates how to use the `unique_rmat_iterator` to create a Boost `adjacency_list`. It initializes a graph with 100 vertices and 400 edges using `boost::minstd_rand` as the random generator and specifies the R-MAT quadrant probabilities. This example shows the typical setup for generating a scale-free graph. ```cpp #include #include #include typedef boost::adjacency_list<> Graph; typedef boost::unique_rmat_iterator RMATGen; int main() { boost::minstd_rand gen; // Create graph with 100 nodes and 400 edges Graph g(RMATGen(gen, 100, 400, 0.57, 0.19, 0.19, 0.05,), RMATGen(), 100); return 0; } ``` -------------------------------- ### R-MAT Graph Generation Example (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/sorted_unique_rmat_generator An example demonstrating the use of `sorted_unique_rmat_iterator` to create a distributed compressed sparse row graph using MPI. It initializes the graph with a specified number of nodes and edges, utilizing R-MAT probabilities and an edge filter for distributed environments. ```cpp #include #include #include #include using boost::graph::distributed::mpi_process_group; typedef compressed_sparse_row_graph > Graph; typedef keep_local_edges, mpi_process_group::process_id_type> EdgeFilter; typedef boost::sorted_unique_rmat_iterator RMATGen; int main() { boost::minstd_rand gen; mpi_process_group pg; int N = 100; boost::parallel::variant_distribution distrib = boost::parallel::block(pg, N); mpi_process_group::process_id_type id = process_id(pg); // Create graph with 100 nodes and 400 edges Graph g(RMATGen(gen, N, 400, 0.57, 0.19, 0.19, 0.05, true, true, EdgeFilter(distrib, id)), RMATGen(), N, pg, distrib); return 0; } ``` -------------------------------- ### Distributed Property Map Access and Synchronization Operations Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_property_map Free functions for getting, putting, and synchronizing values in a distributed property map. The get function retrieves values potentially from remote processes, put writes to remote owners, local_put writes locally, and synchronize ensures consistency across all processors. ```cpp reference get(distributed_property_map pm, const key_type& key); void put(distributed_property_map pm, const key_type& key, const value_type& value); local_put(distributed_property_map pm, const key_type& key, const value_type& value); void request(distributed_property_map pm, const key_type& key); void synchronize(distributed_property_map& pm); ``` -------------------------------- ### Use distributed_queue for Parallel Processing C++ Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_queue Example usage pattern demonstrating how to parallelize sequential queue-based processing using distributed_queue. The code shows initialization with a value, loop processing with synchronization at empty() calls, and automatic message handling across processes. ```cpp distributed_queue<...> Q; Q.push(x); while (!Q.empty()) { // do something, that may push a value onto Q } ``` -------------------------------- ### Invoke Dijkstra's Algorithm with BGL for Shortest Paths Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/dijkstra_example Invokes Dijkstra's algorithm to find the shortest paths from a specified start vertex. It uses `property maps` to store predecessor and distance information for each vertex. The algorithm automatically uses edge weights defined in the graph. ```cpp // Keeps track of the predecessor of each vertex std::vector p(num_vertices(g)); // Keeps track of the distance to each vertex std::vector d(num_vertices(g)); vertex_descriptor s = vertex(A, g); dijkstra_shortest_paths (g, s, predecessor_map( make_iterator_property_map(p.begin(), get(vertex_index, g))). distance_map( make_iterator_property_map(d.begin(), get(vertex_index, g))) ); ``` -------------------------------- ### Send Out-of-Band Message with Reply in Parallel BGL Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/process_group Demonstrates sending an out-of-band message with immediate reply from a remote process. The sending process blocks until the receiver responds, enabling synchronous request-response communication within the current superstep. In this example, a process requests a vertex descriptor by name from the owning process. ```C++ std::string name; vertex_descriptor descriptor; send_oob_with_reply(process_group, owner, msg_get_descriptor_by_name, name, descriptor); ``` -------------------------------- ### Add Edge with Named Vertices (Example) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_adjacency_list This code snippet demonstrates how to add an edge between two named vertices ('Indianapolis' and 'Chicago') in a graph. It shows how the `add_edge` function automatically resolves vertex names to their corresponding descriptors. ```cpp add_edge("Indianapolis", "Chicago", Highway("I-65", 4, 65, 151), map); ``` -------------------------------- ### R-MAT Graph Generation with Boost Adjacency List Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/rmat_generator Complete example demonstrating R-MAT graph generation using Boost Graph Library. Creates a 100-vertex, 400-edge graph with scale-free properties using minstd_rand random number generator and probability parameters (0.57, 0.19, 0.19, 0.05) for quadrant distribution. ```cpp #include #include #include typedef boost::adjacency_list<> Graph; typedef boost::rmat_iterator RMATGen; int main() { boost::minstd_rand gen; // Create graph with 100 nodes and 400 edges Graph g(RMATGen(gen, 100, 400, 0.57, 0.19, 0.19, 0.05), RMATGen(), 100); return 0; } ``` -------------------------------- ### Boost Graph Parallel Breadth-First Search Functions Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/breadth_first_search These C++ template functions perform a distributed breadth-first traversal of a graph. They offer both named and non-named parameter versions for flexibility. The algorithm is level-synchronized, processing all vertices at a given level before moving to the next. It requires a Distributed Graph, a starting vertex, a distributed BFS visitor, and a distributed property map for color tracking. A distributed queue is used for managing vertices. ```cpp // named parameter version template void breadth_first_search(Graph& G, typename graph_traits::vertex_descriptor s, const bgl_named_params& params); // non-named parameter version template void breadth_first_search(const Graph& g, typename graph_traits::vertex_descriptor s, Buffer& Q, BFSVisitor vis, ColorMap color); ``` -------------------------------- ### Fruchterman Reingold Force-Directed Layout - Tiling Overload Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/fruchterman_reingold Template function overload for force-directed layout with spatial tiling support for improved computational efficiency on distributed graphs. Includes all parameters from the basic overload plus a simple_tiling parameter for domain decomposition. ```cpp namespace graph { namespace distributed { template void fruchterman_reingold_force_directed_layout (const Graph& g, PositionMap position, typename property_traits::value_type const& origin, typename property_traits::value_type const& extent, AttractiveForce attractive_force, RepulsiveForce repulsive_force, ForcePairs force_pairs, Cooling cool, DisplacementMap displacement, simple_tiling tiling); } } ``` -------------------------------- ### Loading a METIS Graph with metis_reader and metis_distribution (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/metis Demonstrates how to load a METIS graph and its partitioning using `metis_reader` and `metis_distribution`. It reads graph data from `argv[1]` and partition data from `argv[2]`, then constructs a distributed graph `g`. Assumes the input stream is in METIS partition file format and partitioned for the same number of processes as in `pg`. ```C++ std::ifstream in_graph(argv[1]); metis_reader reader(in_graph); std::ifstream in_partitions(argv[2]); metis_distribution dist(in_partitions, process_id(pg)); Graph g(reader.begin(), reader.end(), reader.weight_begin(), reader.num_vertices(), pg, dist); ``` -------------------------------- ### Fruchterman Reingold Force-Directed Layout - Basic Template Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/fruchterman_reingold Template function for computing force-directed layout of distributed graphs using attractive and repulsive forces. Accepts a graph, position map, layout bounds, force functors, cooling schedule, and displacement map. This is the base overload without tiling support. ```cpp namespace graph { namespace distributed { template void fruchterman_reingold_force_directed_layout (const Graph& g, PositionMap position, typename property_traits::value_type const& origin, typename property_traits::value_type const& extent, AttractiveForce attractive_force, RepulsiveForce repulsive_force, ForcePairs force_pairs, Cooling cool, DisplacementMap displacement); } } ``` -------------------------------- ### Dijkstra Visitor Event Points Descriptions Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/dijkstra_shortest_paths This section details the seven event points triggered by the Dijkstra Visitor concept in the Boost Graph Library. These events, such as initialize_vertex, discover_vertex, examine_vertex, examine_edge, edge_relaxed, edge_not_relaxed, and finish_vertex, are crucial for understanding the execution flow of both sequential and distributed Dijkstra's algorithms. ```text initialize_vertex(s, g) This will be invoked by every process for each local vertex. discover_vertex(u, g) This will be invoked each type a process discovers a new vertex `u`. Due to incomplete information in distributed property maps, this event may be triggered many times for the same vertex `u`. examine_vertex(u, g) This will be invoked by the process owning the vertex `u`. This event may be invoked multiple times for the same vertex when the graph contains negative edges or lookahead is employed. examine_edge(e, g) This will be invoked by the process owning the source vertex of `e`. As with `examine_vertex`, this event may be invoked multiple times for the same edge. edge_relaxed(e, g) Similar to `examine_edge`, this will be invoked by the process owning the source vertex and may be invoked multiple times (even without lookahead or negative edges). edge_not_relaxed(e, g) Similar to `edge_relaxed`. Some `edge_not_relaxed` events that would be triggered by sequential Dijkstra's will become `edge_relaxed` events in distributed Dijkstra's algorithm. finish_vertex(e, g) See documentation for `examine_vertex`. Note that a "finished" vertex is not necessarily finished if lookahead is permitted or negative edges exist in the graph. ``` -------------------------------- ### Construct Graph with Weighted Edges using BGL Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/dijkstra_example Constructs a directed graph using `adjacency_list`. It defines nodes, edges with source and target pairs, and their corresponding integral weights. The graph is initialized using arrays of edges and weights. ```cpp typedef std::pair Edge; const int num_nodes = 5; enum nodes { A, B, C, D, E }; char name[] = "ABCDE"; Edge edge_array[] = { Edge(A, C), Edge(B, B), Edge(B, D), Edge(B, E), Edge(C, B), Edge(C, D), Edge(D, E), Edge(E, A), Edge(E, B) }; int weights[] = { 1, 2, 1, 2, 7, 3, 1, 1, 1 }; int num_arcs = sizeof(edge_array) / sizeof(Edge); graph_t g(edge_array, edge_array + num_arcs, weights, num_nodes); ``` -------------------------------- ### get Free Function (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_property_map Retrieves the value associated with a given global key from a local_property_map. The key must refer to a property local to the current process. ```cpp reference get(const local_property_map& pm, key_type key); ``` -------------------------------- ### Get Value from Distributed Property Map (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_property_map Retrieves the value associated with a specific key from a distributed property map. It takes a property map and a key as input and returns the corresponding value. ```cpp reference get(iterator_property_map pm, const key_type& key); ``` -------------------------------- ### Get and put operations for distributed iterator property map Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_property_map Free functions for retrieving and storing values in a distributed iterator property map using the same semantics as standard distributed property maps. ```cpp reference get(iterator_property_map pm, const key_type& key); void put(iterator_property_map pm, const key_type& key, const value_type& value); ``` -------------------------------- ### Construct Parallel BGL Graph from METIS Reader (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/metis Demonstrates how to construct a Parallel BGL graph `g` on-the-fly using a `metis_reader`. It reads edges and weights from a METIS file specified by `argv[1]`. ```c++ std::ifstream in_graph(argv[1]); metis_reader reader(in_graph); Graph g(reader.begin(), reader.end(), reader.weight_begin(), reader.num_vertices()); ``` -------------------------------- ### Get Value from Safe Iterator Property Map (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_property_map Retrieves the value associated with a given key from a distributed safe iterator property map. This function ensures index bounds checking before accessing the value. ```cpp reference get(safe_iterator_property_map pm, const key_type& key); ``` -------------------------------- ### metis_distribution Constructor (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/metis The constructor for `metis_distribution`. It initializes a new METIS distribution object from an input stream and the current process's ID within a process group. ```C++ metis_distribution(std::istream& in, process_id_type my_id); ``` -------------------------------- ### Getting Owning Process ID with operator() (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/metis The `operator()` overload for `metis_distribution` returns the ID of the process responsible for storing a given vertex number `n`. ```C++ process_id_type operator()(size_type n); ``` -------------------------------- ### METIS Reader Constructor (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/metis Constructs a `metis_reader` instance, initializing it with an input stream `in`. Throws `metis_input_exception` if errors occur during initial parsing. ```c++ metis_reader(std::istream& in); ``` -------------------------------- ### Getting Block Size with block_size (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/metis Member function `block_size` returns the number of vertices that a specific process (`id`) will store. The second parameter is unused. ```C++ size_type block_size(process_id_type id, size_type) const; ``` -------------------------------- ### Get Number of Processes Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/process_group Returns the total number of processes participating in the given process group. This count is used to determine the valid range for process IDs. ```C++ int num_processes(const ProcessGroup& pg); ``` -------------------------------- ### Distributed BFS Discovery Visitor with Property Map Role (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/breadth_first_search An enhanced C++ template class for a distributed BFS visitor. It extends the sequential visitor by setting the property map's role to 'vertex_distance' to handle distributed reductions, ensuring the smallest distance is always chosen. It requires a DistanceMap and the Boost.Graph library. ```cpp template struct bfs_discovery_visitor : bfs_visitor<> { bfs_discovery_visitor(DistanceMap distance) : distance(distance) { set_property_map_role(vertex_distance, distance); } template void tree_edge(Edge e, const Graph& g) { std::size_t new_distance = get(distance, source(e, g)) + 1; put(distance, target(e, g), new_distance); } private: DistanceMap distance; }; ``` -------------------------------- ### Getting Local Vertex Index with local (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/metis The `local` member function returns the local index of a vertex `n` within the owning process's data structures. ```C++ size_type local(size_type n) const; ``` -------------------------------- ### Distributed Depth-First Visit Template Functions Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/tsin_depth_first_visit Template function signatures for performing distributed depth-first traversal on graphs. Includes the basic depth_first_visit() function and multiple overloads of tsin_depth_first_visit() with varying parameters for color mapping, parent tracking, exploration state, and edge iteration. These functions work with distributed graphs and require a DFS visitor that accounts for process-distributed vertices. ```cpp template void depth_first_visit(const DistributedGraph& g, typename graph_traits::vertex_descriptor s, DFSVisitor vis); namespace graph { template void tsin_depth_first_visit(const DistributedGraph& g, typename graph_traits::vertex_descriptor s, DFSVisitor vis); template void tsin_depth_first_visit(const DistributedGraph& g, typename graph_traits::vertex_descriptor s, DFSVisitor vis, VertexIndexMap index_map); template void tsin_depth_first_visit(const DistributedGraph& g, typename graph_traits::vertex_descriptor s, DFSVisitor vis, ColorMap color, ParentMap parent, ExploreMap explore, NextOutEdgeMap next_out_edge); } ``` -------------------------------- ### Get Base Process Group Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/process_group Retrieves the 'base' process group associated with the current process group. This base group is a copy that does not reference any specific distributed data structure. ```C++ ProcessGroup base() const; ``` -------------------------------- ### Constructor - Distributed Queue with Full Parameters Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_queue Explicit constructor that initializes a distributed queue with specified process group, buffer, and polling mode. The queue communicates over the given process group with a local queue initialized via the provided buffer. ```cpp explicit distributed_queue(const ProcessGroup& process_group = ProcessGroup(), const Buffer& buffer = Buffer(), bool polling = false); ``` -------------------------------- ### Getting Global Vertex Index (Current Process) with global (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/metis This overload of the `global` member function returns the global index of a local vertex `n` belonging to the current process. ```C++ size_type global(size_type n) const; ``` -------------------------------- ### Get Graph Property in C++ Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_adjacency_list Retrieves a property associated with the graph itself, identified by `GraphPropertyTag`. This function is currently marked as TODO (not implemented). The `graph_property` traits class is defined in `boost/graph/adjacency_list.hpp`. ```cpp template typename graph_property::type& get_property(adjacency_list& g, GraphPropertyTag); template const typename graph_property::type& get_property(const adjacency_list& g, GraphPropertyTag); ``` -------------------------------- ### Getting Global Vertex Index (Specific Process) with global (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/metis This overload of the `global` member function returns the global index of a local vertex `n` belonging to a specific process identified by `id`. ```C++ size_type global(process_id_type id, size_type n) const; ``` -------------------------------- ### local_property_map Constructor (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_property_map The constructor for local_property_map initializes the map with a process group and a local map for property storage. ```cpp explicit local_property_map(const ProcessGroup& process_group = ProcessGroup(), const LocalMap& local_map = LocalMap()); ``` -------------------------------- ### Local Subgraph Construction and Base Access (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/local_subgraph Provides the constructor for the `local_subgraph` class and member functions to access the underlying distributed graph. This allows for initialization and retrieval of the original graph from the adaptor. ```cpp local_subgraph(DistributedGraph& g); DistributedGraph& base() { return g; } const DistributedGraph& base() const { return g; } ``` -------------------------------- ### Get Number of Edges in Process (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_adjacency_list Returns the count of edges in graph `g` that are stored within the currently executing process. This provides a measure of the local edge density in a parallel graph. ```cpp edges_size_type num_edges(const adjacency_list& g); ``` -------------------------------- ### Get Number of Vertices in Process (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_adjacency_list Returns the count of vertices in graph `g` that are stored within the currently executing process. This is a fundamental metric for understanding the local portion of a distributed graph. ```cpp vertices_size_type num_vertices(const adjacency_list& g); ``` -------------------------------- ### Sequential BFS Discovery Visitor (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/breadth_first_search A C++ template class for a sequential BFS visitor that records the distance from the source vertex to all other vertices in a property map. It requires a DistanceMap type and updates distances via the 'tree_edge' event. ```cpp template struct bfs_discovery_visitor : bfs_visitor<> { bfs_discovery_visitor(DistanceMap distance) : distance(distance) {} template void tree_edge(Edge e, const Graph& g) { std::size_t new_distance = get(distance, source(e, g)) + 1; put(distance, target(e, g), new_distance); } private: DistanceMap distance; }; ``` -------------------------------- ### Get Specific Vertex/Edge Property Value in C++ Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_adjacency_list Fetches the property value for a given entity (vertex or edge) identified by descriptor `x`. The entity must be local. The `PropertyTag` specifies which property to retrieve. ```cpp template typename property_traits::const_type>::value_type get(PropertyTag, const adjacency_list& g, X x); ``` -------------------------------- ### Get Edge Iterator Range (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_adjacency_list Returns an iterator-range providing access to the edge set of a graph `g` stored in the current process. This function is essential for iterating over all edges within a distributed graph structure. ```cpp std::pair edges(const adjacency_list& g); ``` -------------------------------- ### Get value from distributed property map Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_property_map Retrieves an element from a distributed property map by key. Returns the actual value for locally stored keys, or a ghost cell value for remote keys. If no ghost cell exists and no reduction operation with default values is set, the call aborts. ```cpp reference get(distributed_property_map pm, const key_type& key); ``` -------------------------------- ### Dense Boruvka MST Algorithm (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/dehne_gotz_min_spanning_tree Implements a parallel version of Boruvka's MST algorithm for dense graphs. It involves creating supervertices, finding minimum weight edges, and performing all-reduce operations. This algorithm emits the complete MST edge list on all processes. ```cpp namespace graph { template OutputIterator dense_boruvka_minimum_spanning_tree(const Graph& g, WeightMap weight_map, OutputIterator out, VertexIndexMap index, RankMap rank_map, ParentMap parent_map, SupervertexMap supervertex_map); template OutputIterator dense_boruvka_minimum_spanning_tree(const Graph& g, WeightMap weight_map, OutputIterator out, VertexIndex index); template OutputIterator dense_boruvka_minimum_spanning_tree(const Graph& g, WeightMap weight_map, OutputIterator out); } ``` -------------------------------- ### Get Trigger Context Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/process_group Retrieves the current context of the process group regarding trigger invocations. It indicates if no triggers are active or provides details on the context of an ongoing trigger execution (synchronization, asynchronous receive, or out-of-band message). ```C++ trigger_receive_context trigger_context() const; ``` -------------------------------- ### Boruvka Then Merge MST Algorithm (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/dehne_gotz_min_spanning_tree Combines the Boruvka algorithm with a merging strategy for MST computation. This approach leverages Boruvka's initial parallelization followed by a merging phase to achieve the global MST. It provides flexibility in MST construction. ```cpp namespace graph { template OutputIterator boruvka_then_merge(const Graph& g, WeightMap weight, OutputIterator out, VertexIndexMap index, RankMap rank_map, ParentMap parent_map, SupervertexMap supervertex_map); template inline OutputIterator boruvka_then_merge(const Graph& g, WeightMap weight, OutputIterator out, VertexIndexMap index); template inline OutputIterator boruvka_then_merge(const Graph& g, WeightMap weight, OutputIterator out); } ``` -------------------------------- ### METIS Distribution Class Definition (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/metis Defines the `metis_distribution` class, used for reading METIS graph partitioning information. It includes types for process IDs and sizes, and member functions to determine vertex distribution and locality. ```c++ class metis_distribution { public: typedef int process_id_type; typedef std::size_t size_type; metis_distribution(std::istream& in, process_id_type my_id); size_type block_size(process_id_type id, size_type) const; process_id_type operator()(size_type n); size_type local(size_type n) const; size_type global(size_type n) const; size_type global(process_id_type id, size_type n) const; private: std::istream& in; process_id_type my_id; std::vector vertices; }; ``` -------------------------------- ### Get Process ID (Rank) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/process_group Retrieves the unique ID, also known as the rank, of the calling process within the specified process group. Process IDs range from 0 to num_processes(pg) - 1 and are used for initiating communication. ```C++ int process_id(const ProcessGroup& pg); ``` -------------------------------- ### Free Function for Local Subgraph Creation (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/local_subgraph Defines the free function `make_local_subgraph` which constructs and returns a `local_subgraph` instance. This function provides a convenient way to obtain a view of the local portion of a distributed graph. ```cpp template local_subgraph make_local_subgraph(DistributedGraph& g); ``` -------------------------------- ### Get Size of Distributed Queue Local Queue Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_queue Returns the size of the local queue with behavior equivalent to empty(), returning the local queue size when empty() would return true, and zero when empty() would return false. ```cpp size_type size() const; ``` -------------------------------- ### Request remote element availability after synchronization Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_property_map Requests that an element be available after the next synchronization step. For non-local keys, establishes a ghost cell and initiates the request to the owning process. ```cpp void request(distributed_property_map pm, const key_type& key); ``` -------------------------------- ### Register Trigger with Reply Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/process_group Registers a trigger similar to 'trigger', but it must return a value that is sent back to the initiating process. This is intended for messages requiring immediate responses and should be used with 'send_oob_with_reply'. ```C++ template void trigger_with_reply(int tag, const Handler& handler); ``` -------------------------------- ### Get Out-Degree of a Vertex (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_adjacency_list Returns the number of edges originating from vertex `u`. The vertex `u` must reside in the process executing this function. This provides a simple count of outgoing connections for a specific vertex in a parallel graph. ```cpp degree_size_type out_degree(vertex_descriptor u, const adjacency_list& g); ``` -------------------------------- ### Save and Load Distributed Graph using Boost.Serialization Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_adjacency_list Provides functionality to serialize (save) and deserialize (load) the distributed graph to/from Boost.Serialization archives. The `filename` parameter specifies a directory where process-specific archive files will be stored. The archive types must be constructible from `std::ostream` and `std::istream` respectively. ```cpp template void save(std::string const& filename) const; template void load(std::string const& filename); ``` -------------------------------- ### Vertex List Graph Adaptor Class and Factory Functions (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/vertex_list_adaptor Defines the `vertex_list_adaptor` class template and its associated factory functions `make_vertex_list_adaptor`. This adaptor enables algorithms requiring a vertex list graph representation to operate on distributed vertex list graphs by providing a global view of vertices. ```c++ template class vertex_list_adaptor { public: vertex_list_adaptor(const Graph& g, const GlobalIndexMap& index_map = GlobalIndexMap()); }; template vertex_list_adaptor make_vertex_list_adaptor(const Graph& g, const GlobalIndexMap& index_map); template vertex_list_adaptor make_vertex_list_adaptor(const Graph& g); ``` -------------------------------- ### Get Adjacent Vertices Iterator Range (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_adjacency_list Returns an iterator-range for vertices adjacent to a given vertex `u` in graph `g`. The vertex `u` must be local to the process executing this function. This is useful for exploring the neighborhood of a vertex in a parallel graph. ```cpp std::pair adjacent_vertices(vertex_descriptor u, const adjacency_list& g); ``` -------------------------------- ### Dijkstra Shortest Paths Function Signatures (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/dijkstra_shortest_paths Provides the C++ function signatures for the Dijkstra's shortest paths algorithm. It includes both named parameter and non-named parameter versions, designed for distributed graphs. ```C++ // named parameter version template void dijkstra_shortest_paths(Graph& g, typename graph_traits::vertex_descriptor s, const bgl_named_params& params); // non-named parameter version template void dijkstra_shortest_paths (const Graph& g, typename graph_traits::vertex_descriptor s, PredecessorMap predecessor, DistanceMap distance, WeightMap weight, VertexIndexMap index_map, CompareFunction compare, CombineFunction combine, DistInf inf, DistZero zero, DijkstraVisitor vis); ``` -------------------------------- ### Get In-Degree of a Vertex (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/distributed_adjacency_list Returns the number of edges terminating at vertex `u`. This functionality requires the graph to be specified with `bidirectionalS`. The vertex `u` must be local to the executing process. This function is used to count incoming connections for a vertex in a parallel graph. ```cpp degree_size_type in_degree(vertex_descriptor u, const adjacency_list& g); ``` -------------------------------- ### Define Boost Graph METIS Reader Classes (C++) Source: https://www.boost.org/doc/libs/latest/libs/graph_parallel/doc/html/metis Defines the core classes for the METIS reader functionality within the Boost Graph Library. Includes reader, exception, and distribution classes. ```c++ namespace boost { namespace graph { class metis_reader; class metis_exception; class metis_input_exception; class metis_distribution; } } ```