ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
Csr.h File Reference

The compressed rows of a StaticGraph handed to a library that takes them as plain arrays, and the partition that a partitioner of graphs gives back, beyond the book: what the adapters of METIS, KaHIP and GraphBLAS share, which includes no library. More...

#include "ADS/Contract.h"
#include "ADS/graph/StaticGraph.h"
#include <cstddef>
#include <type_traits>
#include <vector>

Go to the source code of this file.

Classes

class  ADS::CsrInput< X, Y >
 the offsets and the heads of a graph as arrays of X, and its weights as an array of Y, in place where the layouts agree and copied otherwise More...
struct  ADS::CsrInput< X, Y >::Copies
 which arrays were copied More...
struct  ADS::Partition
 a partition of the nodes of a graph into \( k \) parts More...

Namespaces

namespace  ADS

Detailed description

The compressed rows of a StaticGraph handed to a library that takes them as plain arrays, and the partition that a partitioner of graphs gives back, beyond the book: what the adapters of METIS, KaHIP and GraphBLAS share, which includes no library.

  • CsrInput< X , Y > holds the offsets and the heads of a graph as arrays of the index type X, and its weights as an array of Y: a pointer into the graph itself when the types and the layout agree, i.e., X is int and the graph satisfies CsrArrays (a StaticGraph of the separate layout or an ArrayGraph), and Y is its type of the weights; a copy of \( n + 1 \) offsets, \( a \) heads or \( a \) weights otherwise, for \( a \) arcs, made in \( O( n + a ) \) time. Hence an unweighted graph of the separate layout reaches METIS (with idx_t of 32 bits) and KaHIP with no copy, a weighted one too if its weights are of the index type, and an interleaved graph, whose heads and weights alternate in one array, is copied. copied() tells which arrays were copied.
  • Partition is the part of each node and the weight of the edges cut; order() is the permutation that numbers the nodes part by part, which StaticGraph::relabel() applies, so that the nodes of each part become consecutive in the rows (an order of locality for the parallel algorithms, and the blocks of the processes of the distributed layer).

The contracts [see Contract.h]: the graph outlives a CsrInput and is not changed while it lives; the parts are in \( [ 0 , k ) \). The functions are defined in this file.

Author
Donato Meoli
Dipartimento di Informatica
Università di Pisa