Class RandomSparsifier

Inheritance Relationships

Base Type

Class Documentation

class RandomSparsifier : public NetworKit::Sparsifier

Produces sparsified graphs that contain approximately a given percentage of edges of the original graph. The edges are selected unformly at random.

Public Functions

RandomSparsifier(const Graph &graph, double ratio)

Creates a new instance of the Random Sparsifier.

Parameters:
  • graph – the input graph

  • ratio – edge ratio in [0,1] to be kept in the sparse graph.

virtual void run() override

REQ: Needs to fill outputGraph and set hasOutput to true.