ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ParallelGreedy.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*-------------------------- File ParallelGreedy.h -------------------------*/
3/*--------------------------------------------------------------------------*/
60/*--------------------------------------------------------------------------*/
61/*----------------------------- DEFINITIONS --------------------------------*/
62/*--------------------------------------------------------------------------*/
63
64#ifndef __ADS_ParallelGreedy
65 #define __ADS_ParallelGreedy
66/* self-identification: #endif constant */
67
68/*--------------------------------------------------------------------------*/
69/*------------------------------ INCLUDES ----------------------------------*/
70/*--------------------------------------------------------------------------*/
71
72#include "ADS/Contract.h"
78
79#include <cstddef>
80#include <utility>
81#include <vector>
82
83/*--------------------------------------------------------------------------*/
84/*--------------------------- NAMESPACE ------------------------------------*/
85/*--------------------------------------------------------------------------*/
86
87namespace ADS
88{
89
94[[nodiscard]] inline std::vector< int > randomOrder( int n ,
95 unsigned long long seed );
96
127template< Executor E , class W >
128[[nodiscard]] std::vector< int >
129parallelKruskal( E & ex , int n , const std::vector< WeightedEdge< W > > & A );
130
153template< Executor E , class W >
154[[nodiscard]] std::vector< int >
155filterKruskal( E & ex , int n , const std::vector< WeightedEdge< W > > & A );
156
172template< Executor E >
173[[nodiscard]] std::vector< int >
174spanningForest( E & ex , int n ,
175 const std::vector< std::pair< int , int > > & A );
176
201template< Executor E , class W , ArcLayout AL >
202[[nodiscard]] std::vector< int >
204 const std::vector< int > & pi );
205
234template< Executor E >
235[[nodiscard]] std::vector< int >
236maximalMatching( E & ex , int n ,
237 const std::vector< std::pair< int , int > > & A ,
238 const std::vector< int > & pi );
239
240/*--------------------------------------------------------------------------*/
241
242} // end( namespace ADS )
243
244/*--------------------------------------------------------------------------*/
245/*-------------------------- IMPLEMENTATION --------------------------------*/
246/*--------------------------------------------------------------------------*/
247
248#include "ADS/parallel/impl/ParallelGreedy.tpp"
249
250/*--------------------------------------------------------------------------*/
251
252#endif /* ParallelGreedy.h included */
253
254/*--------------------------------------------------------------------------*/
255/*------------------------ End File ParallelGreedy.h -----------------------*/
256/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The layer of execution of the parallel algorithms of ADS, beyond the book: an executor runs the calls...
The minimum spanning tree of an unoriented connected graph with weights on the edges (section 14....
The parallel sorts, beyond the book: sort( ex , A , less ) and stableSort( ex , A ,...
The deterministic reservations of Blelloch, Fineman, Gibbons and Shun, beyond the book: speculativeFo...
A static GRAPH for the engineered algorithms, beyond the book [see Graph.h]: the compressed sparse ro...
a static graph in compressed sparse rows, the arcs of each node sorted by head, their heads and their...
Definition StaticGraph.h:275
std::vector< int > maximalMatching(E &ex, int n, const std::vector< std::pair< int, int > > &A, const std::vector< int > &pi)
the places in of the edges of the greedy maximal matching in the order of the edges (the edge firs...
std::vector< int > randomOrder(int n, unsigned long long seed)
a random permutation of from the seed, the same on every machine (the shuffle of Fisher and Yates on...
std::vector< int > parallelKruskal(E &ex, int n, const std::vector< WeightedEdge< W > > &A)
the places in of the edges of the minimum spanning forest that Kruskal gives on the order ,...
std::vector< int > filterKruskal(E &ex, int n, const std::vector< WeightedEdge< W > > &A)
the forest of parallelKruskal() above, by filter-Kruskal
std::vector< int > maximalIndependentSet(E &ex, const StaticGraph< W, AL > &g, const std::vector< int > &pi)
the nodes of the greedy maximal independent set of in the order (the node first),...
std::vector< int > spanningForest(E &ex, int n, const std::vector< std::pair< int, int > > &A)
the places in of the edges of the spanning forest of the greedy algorithm in the order of ,...
Definition ADT.h:96
an edge of weight
Definition MinimumSpanningTree.h:94