networkit.coarsening

class networkit.coarsening.GraphCoarsening

Bases: 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: GraphCoarsening

Coarsens graph according to a matching.

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

  • M (networkit.matching.Matching) – The matching, which is used for coarsening.

  • noSelfLoops (bool, optional) – If true, self-loops are not produced. Default: False

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

Bases: 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