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... | |
Provides methods to randomly sample a number of edges from a given graph.
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.
G | The graph to construct the training graph from |
numLinks | Number of links the returned graph should consist of |
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.
G | The graph to construct the training graph from |
percentage | Percentage of links regarding the number of links in the given graph that should be in the returned graph |