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

#include <graph_builder.h>

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

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
 

Detailed Description

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

api::graph::GraphBuilder implementation used to generate bipartite graphs. Built nodes are linked to nodes specified as "base nodes".

Constructor & Destructor Documentation

◆ BipartiteGraphBuilder()

template<typename T >
template<typename Generator_t , typename EdgeDist >
fpmas::graph::BipartiteGraphBuilder< T >::BipartiteGraphBuilder ( Generator_t &  generator,
EdgeDist &  edge_distribution,
std::vector< api::graph::DistributedNode< T > * >  base_nodes 
)
inline

BipartiteGraphBuilder constructor.

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()
base_nodesnodes to which built nodes will be linked

Member Function Documentation

◆ build()

template<typename T >
std::vector< api::graph::DistributedNode< T > * > fpmas::graph::BipartiteGraphBuilder< T >::build ( api::graph::NodeBuilder< T > &  node_builder,
api::graph::LayerId  layer,
api::graph::DistributedGraph< T > &  graph 
)
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.

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: