fpmas 1.6
Public Member Functions | List of all members
fpmas::graph::ClusteredGraphBuilder< T > Class Template Reference

#include <clustered_graph_builder.h>

Inheritance diagram for fpmas::graph::ClusteredGraphBuilder< T >:
Inheritance graph
[legend]
Collaboration diagram for fpmas::graph::ClusteredGraphBuilder< T >:
Collaboration graph
[legend]

Public Member Functions

template<typename Generator_t , typename EdgeDist , typename X_Dist , typename Y_Dist >
 ClusteredGraphBuilder (Generator_t &generator, EdgeDist &edge_distribution, X_Dist &x_distribution, Y_Dist &y_distribution)
 
template<typename EdgeDist , typename X_Dist , typename Y_Dist >
 ClusteredGraphBuilder (EdgeDist &edge_distribution, X_Dist &x_distribution, Y_Dist &y_distribution)
 
template<typename Generator_t , typename Distribution_t >
 ClusteredGraphBuilder (Generator_t &generator, Distribution_t &edge_distribution)
 
std::vector< api::graph::DistributedNode< T > * > build (api::graph::NodeBuilder< T > &node_builder, api::graph::LayerId layer, api::graph::DistributedGraph< T > &graph) override
 
virtual std::vector< api::graph::DistributedNode< T > * > build (NodeBuilder< T > &node_builder, LayerId layer, DistributedGraph< T > &graph)=0
 

Detailed Description

template<typename T>
class fpmas::graph::ClusteredGraphBuilder< T >

api::graph::GraphBuilder implementation that can be used to generate random clustered graphs. A random 2D coordinate is implicitly associated to each node : each node is then connected to its nearest neighbors.

Constructor & Destructor Documentation

◆ ClusteredGraphBuilder() [1/3]

template<typename T >
template<typename Generator_t , typename EdgeDist , typename X_Dist , typename Y_Dist >
fpmas::graph::ClusteredGraphBuilder< T >::ClusteredGraphBuilder ( Generator_t &  generator,
EdgeDist &  edge_distribution,
X_Dist &  x_distribution,
Y_Dist &  y_distribution 
)
inline

ClusteredGraphBuilder constructor.

Template Parameters
Generator_trandom generator type (must satisfy UniformRandomBitGenerator)
EdgeDistedge count distribution (must satisfy RandomNumberDistribution)
X_Distx coordinates distribution (must satisfy RandomNumberDistribution)
Y_Disty coordinates distribution (must satisfy RandomNumberDistribution)
Parameters
generatorrandom number generator provided to the distribution
edge_distributionrandom distribution that manages edges generation. See build()
x_distributionrandom distribution used to assign an x coordinate to each node
y_distributionrandom distribution used to assign an y coordinate to each node

◆ ClusteredGraphBuilder() [2/3]

template<typename T >
template<typename EdgeDist , typename X_Dist , typename Y_Dist >
fpmas::graph::ClusteredGraphBuilder< T >::ClusteredGraphBuilder ( EdgeDist &  edge_distribution,
X_Dist &  x_distribution,
Y_Dist &  y_distribution 
)
inline

ClusteredGraphBuilder constructor.

The RandomGraphBuilder::rd random generator is used. It can be seeded with RandomGraphBuilder::seed() or fpmas::seed().

Template Parameters
EdgeDistedge count distribution (must satisfy RandomNumberDistribution)
X_Distx coordinates distribution (must satisfy RandomNumberDistribution)
Y_Disty coordinates distribution (must satisfy RandomNumberDistribution)
Parameters
edge_distributionrandom distribution that manages edges generation. See build()
x_distributionrandom distribution used to assign an x coordinate to each node
y_distributionrandom distribution used to assign an y coordinate to each node

◆ ClusteredGraphBuilder() [3/3]

template<typename T >
template<typename Generator_t , typename Distribution_t >
fpmas::graph::ClusteredGraphBuilder< T >::ClusteredGraphBuilder ( Generator_t &  generator,
Distribution_t &  edge_distribution 
)
inline

ClusteredGraphBuilder constructor.

Built nodes are implicitly and uniformly distributed in a 2D space.

Template Parameters
Generator_trandom generator type (must satisfy UniformRandomBitGenerator)
EdgeDistedge count distribution (must satisfy RandomNumberDistribution)
Parameters
generatorrandom number generator provided to the distribution
edge_distributionrandom distribution that manages edges generation. See build()

Member Function Documentation

◆ build()

template<typename T >
std::vector< api::graph::DistributedNode< T > * > fpmas::graph::ClusteredGraphBuilder< T >::build ( api::graph::NodeBuilder< T > &  node_builder,
api::graph::LayerId  layer,
api::graph::DistributedGraph< T > &  graph 
)
overridevirtual

A 2D coordinate is first assigned to each node provided by the node_builder, according to the specified x_distribution and y_distribution.

Then, for each node, an outgoing edge count n is determined by edge_distribution. The node is then connected to its n nearest neighbors according to the previously computed coordinates.

Notice that those coordinates are completely implicit and independent from the kind of nodes actually built by the algorithm.

Parameters
node_builderNodeBuilder instance used to generate nodes
layerlayer on which nodes will be linked
graphgraph in which nodes and edges will be inserted

Implements fpmas::api::graph::GraphBuilder< T >.


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