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

The partitions of KaHIP (https://github.com/KaHIP/KaHIP) of a StaticGraph, beyond the book: partition( g , k , o ) calls kaffpa(), the multilevel partitioner of KaHIP, on the compressed rows of \( g \) and gives back a Partition [see interop/Csr.h], the part of each node and the weight of the edges cut, whose order() relabels the graph part by part through StaticGraph::relabel(). More...

#include "ADS/Contract.h"
#include "ADS/graph/StaticGraph.h"
#include "ADS/interop/Csr.h"
#include <kaHIP_interface.h>
#include <cstddef>
#include <vector>

Go to the source code of this file.

Classes

struct  ADS::kahip::Options
 the options of a partition by KaHIP More...

Namespaces

namespace  ADS
namespace  ADS::kahip

Typedefs

using ADS::kahip::Input = CsrInput< kahip_idx , kahip_idx >
 the arrays of a graph for KaHIP: in place where the layouts agree

Functions

template<class G>
Partition ADS::kahip::partition (const G &g, const Input &I, int k, const Options &o=Options())
 the partition of the nodes of \( g \) into \( k \) parts by kaffpa(), on the input \( I \) of \( g \) (whose arrays it reads in place, or the copies of CsrInput)
template<class G>
Partition ADS::kahip::partition (const G &g, int k, const Options &o=Options())
 the partition of the nodes of \( g \) into \( k \) parts by kaffpa(), on the rows of \( g \) read in place where the layouts agree

Detailed description

The partitions of KaHIP (https://github.com/KaHIP/KaHIP) of a StaticGraph, beyond the book: partition( g , k , o ) calls kaffpa(), the multilevel partitioner of KaHIP, on the compressed rows of \( g \) and gives back a Partition [see interop/Csr.h], the part of each node and the weight of the edges cut, whose order() relabels the graph part by part through StaticGraph::relabel().

KaHIP takes the arrays of METIS, xadj, adjncy and adjcwgt of the type kahip_idx, i.e., int32_t unless KaHIP was built with KAHIP_64BIT: in the first case it reads offsets() and heads() of a graph of the separate layout in place, and weightData() too if the weights are of that type; it reads every other layout through a copy [see CsrInput], as the header of METIS does. kaffpa() takes its arrays as pointers to non-constant data, and builds its own graph from them.

ADS has no partitioner of graphs, and this header gives none: it lets KaHIP run on the graphs of ADS, whose rows it shares.

This header is of the set interop: no entry point of ADS includes it, and it needs KaHIP (3.0 or later), found by CMake when ADS_WITH_KAHIP is AUTO or ON (the target ADS::KaHIP). The contracts [see Contract.h]: the graph is unoriented, without loops, with positive integral weights if any; \( 1 \le k \le n \); the library linked has the kahip_idx of its header.

See also
P. Sanders, C. Schulz, Think locally, act globally: highly balanced graph partitioning, Proc. SEA 2013, LNCS 7933, 164-175, 2013, doi:10.1007/978-3-642-38527-8_16
Author
Donato Meoli
Dipartimento di Informatica
Università di Pisa