PaGMO
1.1.5
|
Clustered Barabási-Albert with Ageing vertices graph topology. More...
#include <ageing_clustered_ba.h>
Public Member Functions | |
ageing_clustered_ba (int m0=3, int m=2, double p=0.5, int a=1000) | |
Constructor from kernel size, maximum number of edges, connection probability and maximum node age. More... | |
base_ptr | clone () const |
Clone method. More... | |
std::string | get_name () const |
Get name of the topology. More... | |
Public Member Functions inherited from pagmo::topology::base | |
base () | |
Default constructor. More... | |
base (const base &) | |
Copy constructor. More... | |
base & | operator= (const base &) |
Assignment operator. More... | |
virtual | ~base () |
Trivial destructor. More... | |
vertices_size_type | get_number_of_vertices () const |
Get number of vertices. More... | |
edges_size_type | get_number_of_edges () const |
Get number of edges. More... | |
void | push_back () |
Push back vertex. More... | |
double | get_average_shortest_path_length () const |
Calculate average path length. More... | |
double | get_clustering_coefficient () const |
Calculate clustering coefficient. | |
std::vector< double > | get_degree_distribution () const |
Constructs the Degree Distribution. | |
bool | are_adjacent (const vertices_size_type &, const vertices_size_type &) const |
Return true if two vertices are adjacent. More... | |
bool | are_inv_adjacent (const vertices_size_type &, const vertices_size_type &) const |
Return true if two vertices are inversely adjacent. More... | |
std::vector< vertices_size_type > | get_v_adjacent_vertices (const vertices_size_type &) const |
Return vector of adjacent vertices. More... | |
std::vector< vertices_size_type > | get_v_inv_adjacent_vertices (const vertices_size_type &) const |
Return vector of inversely adjacent vertices. More... | |
edges_size_type | get_num_adjacent_vertices (const vertices_size_type &) const |
Return the number of adjacent vertices. More... | |
edges_size_type | get_num_inv_adjacent_vertices (const vertices_size_type &) const |
Return the number of inversely adjacent vertices. More... | |
void | set_weight (double) |
Sets the migration probability. More... | |
void | set_weight (const vertices_size_type &, double) |
Sets the migration probability. More... | |
void | set_weight (const vertices_size_type &, const vertices_size_type &, double) |
Sets the migration probability. More... | |
double | get_weight (const vertices_size_type &, const vertices_size_type &) const |
Get the migration probability. More... | |
std::string | human_readable_terse () const |
Return terse human readable representation. More... | |
std::string | human_readable () const |
Return complete human readable representation. More... | |
Protected Member Functions | |
void | connect (const vertices_size_type &) |
Establish connections between islands during a push_back() operation. More... | |
std::string | human_readable_extra () const |
Topology-specific human readable info. More... | |
Protected Member Functions inherited from pagmo::topology::base | |
void | add_vertex () |
Add a vertex. More... | |
std::pair< a_iterator, a_iterator > | get_adjacent_vertices (const vertices_size_type &) const |
Return iterator range to adjacent vertices. More... | |
std::pair< ia_iterator, ia_iterator > | get_inv_adjacent_vertices (const vertices_size_type &) const |
Return iterator range to inversely adjacent vertices. More... | |
void | add_edge (const vertices_size_type &, const vertices_size_type &) |
Add an edge. More... | |
void | remove_edge (const vertices_size_type &, const vertices_size_type &) |
Remove an edge. More... | |
void | remove_all_edges () |
Remove all edges. More... | |
std::pair< v_iterator, v_iterator > | get_vertices () const |
Return iterator range to vertices. More... | |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
Public Types inherited from pagmo::topology::base | |
typedef graph_type::vertices_size_type | vertices_size_type |
Vertices size type. | |
typedef graph_type::edges_size_type | edges_size_type |
Edges size type. | |
Protected Types inherited from pagmo::topology::base | |
typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, boost::no_property, edge_properties, boost::no_property, boost::listS > | graph_type |
typedef boost::graph_traits< graph_type >::vertex_iterator | v_iterator |
Iterator over the vertices. | |
typedef boost::graph_traits< graph_type >::edge_iterator | e_iterator |
Iterator over the edges. | |
typedef boost::graph_traits< graph_type >::adjacency_iterator | a_iterator |
Iterator over adjacent vertices. | |
typedef graph_type::inv_adjacency_iterator | ia_iterator |
Iterator over inversely adjacent vertices. | |
typedef boost::graph_traits< graph_type >::vertex_descriptor | v_descriptor |
Vertex descriptor. | |
typedef boost::graph_traits< graph_type >::edge_descriptor | e_descriptor |
Edge descriptor. | |
Clustered Barabási-Albert with Ageing vertices graph topology.
Topology based on the Barabási-Albert (BA) model for the generation of random undirected scale-free networks. Ageing and clustering mechanisms have been added to increase clustering coefficient and community structure. The construction of this topology consists internally of three phases:
Definition at line 54 of file ageing_clustered_ba.h.
pagmo::topology::ageing_clustered_ba::ageing_clustered_ba | ( | int | m0 = 3 , |
int | m = 2 , |
||
double | p = 0.5 , |
||
int | a = 1000 |
||
) |
Constructor from kernel size, maximum number of edges, connection probability and maximum node age.
Build a BA network with clustering and ageing mechanisms applied. The initial kernel has size m0 and the elements being inserted after the construction of the kernel is completed are connected randomly to a maximum of m nodes. These nodes are then connected to eachother with probability p. Nodes cease to make node connections when their 'age' (the number of time steps for which they have been a part of the network) is greater than a. Will fail if m0 < 2, if m < 1 or if m > m0 or if p < 0 or p > 1 or a < m.
[in] | m0 | size of the kernel |
[in] | m | number of random connections to be established when a new node is added. |
[in] | p | probability that a connection is established between two nodes that are adjacent to a new node. |
[in] | a | 'age' at which a node ceases to make new connections. |
Definition at line 54 of file ageing_clustered_ba.cpp.
|
virtual |
Clone method.
Provided that the derived topology implements properly the copy constructor, virtually all implementations of this method will look like this:
Implements pagmo::topology::base.
Definition at line 70 of file ageing_clustered_ba.cpp.
|
protectedvirtual |
Establish connections between islands during a push_back() operation.
This method will be called by push_back() after a vertex has been added to the graph. The purpose of this method is to connect the newly-added vertex to other vertices according to the properties of the topology.
[in] | idx | index of the newly-added vertex. |
Implements pagmo::topology::base.
Definition at line 75 of file ageing_clustered_ba.cpp.
|
virtual |
Get name of the topology.
Default implementation will return the class' mangled C++ name.
Reimplemented from pagmo::topology::base.
Definition at line 195 of file ageing_clustered_ba.cpp.
|
protectedvirtual |
Topology-specific human readable info.
Will return a formatted string containing the size of the kernel, the maximum number of connections for newly-inserted nodes, the connection probability and the maximum node age.
Reimplemented from pagmo::topology::base.
Definition at line 185 of file ageing_clustered_ba.cpp.