Class GlobalCurveball

Inheritance Relationships

Base Type

Class Documentation

class GlobalCurveball : public NetworKit::Algorithm

Public Functions

explicit GlobalCurveball(const Graph &G, count number_of_global_trades = 20, bool allowSelfLoops = false, bool degreePreservingShufflePreprocessing = true)

Instantiate a GlobalCurveball object


Self loops can only be realized for directed graphs.


If self loops are forbidden, degreePreservingShuffle is necessary for directed graphs, since otherwise some topologies cannot be realized (i.e., only preprocessing allows for uniform samples).

  • G – Undirected and unweighted graph to be randomized

  • number_of_global_trades – Number of global trades to be executed (each edge is considered exactly twice per global traded)

  • allowSelfLoops – May only be set if graph is directed.

  • degreePreservingShufflePreprocessing – Execute DegreePreservingShuffle (see Algorithm for description) as a preprocessing step. This is more efficient than calling the algorithm explicitly.

~GlobalCurveball() override
virtual void run() final

Execute trades as configured in the constructor. The algorithm is not parallel.


This function has to be called exactly one before invoking getGraph()

Graph getGraph()

Returns a new graph instance with the same degree sequence as the input graph, but with randomized neighbourhoods.