networkit.coarsening

class networkit.coarsening.GraphCoarsening

Bases: networkit.base.Algorithm

Abstract base class for coarsening measures

getCoarseGraph()

Returns the coarse graph

Returns

Coarse graph.

Return type

networkit.Graph

getCoarseToFineNodeMapping()

Returns the coarse graph

Returns

Map containing node from coarse graph and all its mappings from finer graph

Return type

dict(int : list(int))

getFineToCoarseNodeMapping()

Returns the coarse graph

Returns

List containing mapping, whereas index represents node u from fine graph and value represents node v from coarse graph

Return type

list(dict(int : int))

class networkit.coarsening.MatchingCoarsening(G, M, noSelfLoops=False)

Bases: networkit.coarsening.GraphCoarsening

Coarsens graph according to a matching.

Parameters
class networkit.coarsening.ParallelPartitionCoarsening(G, zeta, parallel=True)

Bases: networkit.coarsening.GraphCoarsening

Coarsens graph according to a partition.

Parameters
  • G (networkit.Graph) – The input graph.

  • zeta (networkit.Partition) – The partition, which is used for coarsening.

  • parallel (bool, optional) – If true, algorithm runs in parallel. Default: True