|
| index_t | bfs (Graph &aGraph, Vertex *aStart=nullptr) |
| index_t | bfs (Graph &aGraph) |
| | Alternative implementation that also handles disconnected graphs by finding the maximum width across all connected components.
|
| void | clear (Cell< Vertex * > &aGraph) |
| | tidy up a graph
|
| proc_t | dfs (Graph &aGraph) |
| void | dfs_from_start (Graph &aGraph, Vertex *aStart) |
| index_t | find_connected_partitions (Graph &aGraph) |
| Vertex * | find_pseudo_peripheral_node (Graph &aGraph, Vertex *aStart) |
| Vertex * | find_pseudo_peripheral_vertex (Graph &aGraph, Vertex *aStart=nullptr) |
| | Finds a pseudo-peripheral vertex in the graph.
|
| void | metis_nd (Graph &aGraph) |
| | Performs nested dissection ordering on the graph using METIS_NodeND.
|
| void | metis_ndp (Graph &aGraph, const uint aNumPartitions) |
| | Performs nested dissection ordering with partitioning using METIS_NodeNDP.
|
| void | metis_partition (Graph &aGraph, const uint aNumPartitions, const bool aForceContinuousPartitions, Vector< proc_t > *aPartitions) |
| string | metis_status (const int aStatus) |
| Vertex * | multibfs (Cell< Vertex * > &aGraph, const proc_t aOwnerSubset) |
| void | parmetis_nd (Graph &aGraph) |
| void | ptscotch_nd (Graph &aGraph) |
| void | scotch_nd (Graph &aGraph) |
| void | scotch_partition (Graph &aGraph, const uint aNumPartitions) |
| void | sort (Graph &aGraph) |
| bool | spfa_difference_constraints (const index_t aNumVertices, const Cell< index_t > &aArcTails, const Cell< index_t > &aArcHeads, const Cell< int64_t > &aArcWeights, Cell< int64_t > &aTheta, Cell< index_t > &aNegativeCycle) |
| | Feasibility solver for a system of difference constraints.
|
| void | symrcm (Graph &aGraph, Vertex *aStart=nullptr) |
| | Performs Reverse Cuthill-McKee (RCM) ordering on the graph.
|
| void | apply_rcm_permutation (Graph &aGraph, const Cell< index_t > &aPermutation) |
| | Applies the RCM permutation to reorder the graph vertices.
|
| template<typename T> |
| void | apply_graph_permutation (Graph &aGraph, const Vector< T > &aPermutation) |
| template<typename T> |
| void | build_graph_adjacency (Graph &aGraph, Vector< T > &aVertices, Vector< T > &aEdges) |
| void | block_distribution (Graph &aGraph, const proc_t aCommSize) |
| | assign owners to an ownerless graph in contiguous blocks of graph order: the first aCommSize - ( N mod aCommSize ) ranks take N / aCommSize vertices, the remaining ranks one more ( the split DistMatrix uses for its rows ).
|
| template<typename T> |
| void | build_pargraph_adjacency (Graph &aGraph, Vector< T > &aDistribution, Cell< Vector< T > > &aVertices, Cell< Vector< T > > &aEdges) |
| void belfem::graph::metis_ndp |
( |
Graph & | aGraph, |
|
|
const uint | aNumPartitions ) |
Performs nested dissection ordering with partitioning using METIS_NodeNDP.
This variant creates a specified number of top-level partitions before applying nested dissection, which can produce better orderings for parallel factorization with many processors.
STRUMPACK documentation suggests this often works better than standard NodeND for certain problem types (use –sp_enable_METIS_NodeNDP).
The graph is reordered in-place. After calling this function:
- vertex->index() contains the new (permuted) index
- The graph Cell is sorted by the new indices
- vertex->id() is not touched; record the original index yourself before the call if you need the permutation
- Parameters
-
| aGraph | Cell containing all vertices (will be reordered) |
| aNumPartitions | Number of top-level partitions |
- Note
- Requires BELFEM_METIS to be defined ( set by USE_METIS ); without it, BELFEM_ERROR
| bool belfem::graph::spfa_difference_constraints |
( |
const index_t | aNumVertices, |
|
|
const Cell< index_t > & | aArcTails, |
|
|
const Cell< index_t > & | aArcHeads, |
|
|
const Cell< int64_t > & | aArcWeights, |
|
|
Cell< int64_t > & | aTheta, |
|
|
Cell< index_t > & | aNegativeCycle ) |
Feasibility solver for a system of difference constraints.
theta( head( a ) ) - theta( tail( a ) ) <= weight( a )
for every arc a, using the queue-based Bellman-Ford-Moore algorithm (SPFA), warm-started from a BFS spanning forest ( theta( head ) = theta( tail ) + w along tree arcs ) so that only off-tree violations need relaxing. Infeasibility is detected by amortized periodic scans of the predecessor graph; only a strictly negative predecessor cycle is accepted as proof.
Vertices are addressed by index in [ 0, aNumVertices ); vertices that appear in no arc are left untouched at theta = 0. The returned theta is A feasible solution ( difference constraints are shift-invariant ), not distances from a source.
- Parameters
-
| aNumVertices | size of the vertex index space |
| aArcTails | tail vertex of each arc |
| aArcHeads | head vertex of each arc |
| aArcWeights | signed weight of each arc |
| aTheta | output: feasible potentials, sized to aNumVertices ( valid only if return is true ) |
| aNegativeCycle | output: if infeasible, the arc indices of one negative cycle, in cycle order |
- Returns
- true if the system is feasible, false if a negative cycle exists ( certificate in aNegativeCycle )