All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
NetworKit::RandomSparsifier Class Reference

Produces sparsified graphs that contain approximately a given percentage of edges of the original graph. More...

#include <Sparsifiers.h>

Public Member Functions

 RandomSparsifier (const Graph &graph, double ratio)
 Creates a new instance of the Random Sparsifier. More...
 
virtual void run () override
 REQ: Needs to fill outputGraph and set hasOutput to true. More...
 
- Public Member Functions inherited from NetworKit::Sparsifier
 Sparsifier (const Graph &inputGraph)
 
virtual ~Sparsifier ()=default
 
Graph getGraph ()
 

Additional Inherited Members

- Protected Attributes inherited from NetworKit::Sparsifier
const GraphinputGraph
 
Graph outputGraph
 
bool hasOutput
 

Detailed Description

Produces sparsified graphs that contain approximately a given percentage of edges of the original graph.

The edges are selected unformly at random.

Constructor & Destructor Documentation

NetworKit::RandomSparsifier::RandomSparsifier ( const Graph graph,
double  ratio 
)

Creates a new instance of the Random Sparsifier.

Parameters
graphthe input graph
ratioedge ratio in [0,1] to be kept in the sparse graph.

Member Function Documentation

void NetworKit::RandomSparsifier::run ( )
overridevirtual

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

Implements NetworKit::Sparsifier.


The documentation for this class was generated from the following files: