![]() |
fpmas 1.6
|
#include <graph_builder.h>
Public Member Functions | |
template<typename Generator_t , typename EdgeDist > | |
BipartiteGraphBuilder (Generator_t &generator, EdgeDist &edge_distribution, std::vector< api::graph::DistributedNode< T > * > base_nodes) | |
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 |
api::graph::GraphBuilder implementation used to generate bipartite graphs. Built nodes are linked to nodes specified as "base nodes".
|
inline |
BipartiteGraphBuilder constructor.
Generator_t | random generator type (must satisfy UniformRandomBitGenerator) |
EdgeDist | edge count distribution (must satisfy RandomNumberDistribution) |
generator | random number generator provided to the distribution |
edge_distribution | random distribution that manages edges generation. See build() |
base_nodes | nodes to which built nodes will be linked |
|
overridevirtual |
For each built node, an outgoing edge count n
is determined by edge_distribution
.
Each node is then connected to a set of n
nodes randomly and uniformly selected from the base_nodes
set. If base_nodes.size() < n
, the node is only connected to all the nodes of base_nodes
.
node_builder | NodeBuilder instance used to generate nodes |
layer | layer on which nodes will be linked |
graph | graph in which nodes and edges will be inserted |
Implements fpmas::api::graph::GraphBuilder< T >.