All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
NetworKit::RandomLinkSampler Namespace Reference

Provides methods to randomly sample a number of edges from a given graph. More...

Functions

Graph byPercentage (const Graph &G, double percentage)
 Returns a graph that contains percentage percent of links form the given graph G. More...
 
Graph byCount (const Graph &G, count numLinks)
 Returns a graph that contains numLinks links from the given graph G. More...
 

Detailed Description

Provides methods to randomly sample a number of edges from a given graph.

Function Documentation

Graph NetworKit::RandomLinkSampler::byCount ( const Graph &  G,
count  numLinks 
)

Returns a graph that contains numLinks links from the given graph G.

The links are randomly selected from G until the given count is reached.

Parameters
GThe graph to construct the training graph from
numLinksNumber of links the returned graph should consist of
Returns
a graph that contains the given number of links from G
Graph NetworKit::RandomLinkSampler::byPercentage ( const Graph &  G,
double  percentage 
)

Returns a graph that contains percentage percent of links form the given graph G.

The links are randomly selected from G until the given percentage is reached.

Parameters
GThe graph to construct the training graph from
percentagePercentage of links regarding the number of links in the given graph that should be in the returned graph
Returns
a graph that contains the given percentage of links from G