Utopia
2
Framework for studying models of complex & adaptive systems.

Modules  
Rules on Entities  
Algorithms for conveniently applying function objects on entities.  
GraphEntity  
GraphIterators  
Functions  
template<typename Graph >  
Graph  Utopia::Graph::create_complete_graph (const std::size_t n) 
Create a complete graph. More...  
template<typename Graph , typename RNG >  
Graph  Utopia::Graph::create_ErdosRenyi_graph (const std::size_t num_vertices, const std::size_t mean_degree, bool allow_parallel, bool self_edges, RNG &rng) 
Create a ErdösRényi random graph. More...  
template<typename Graph >  
Graph  Utopia::Graph::create_regular_graph (const std::size_t n, const std::size_t k, const bool oriented) 
Create a regular lattice graph. More...  
template<typename Graph , typename RNG >  
Graph  Utopia::Graph::create_KlemmEguiluz_graph (const std::size_t num_vertices, const std::size_t mean_degree, const double mu, RNG &rng) 
Create a KlemmEguíluz scalefree smallworld highlyclustered graph. More...  
template<typename Graph , typename RNG >  
Graph  Utopia::Graph::BarabasiAlbert_parallel_generator (std::size_t num_vertices, std::size_t mean_degree, RNG &rng) 
Generate a BarabásiAlbert scalefree graph with parallel edges. More...  
template<typename Graph , typename RNG >  
Graph  Utopia::Graph::create_BarabasiAlbert_graph (std::size_t num_vertices, std::size_t mean_degree, bool parallel, RNG &rng) 
Create a BarabásiAlbert scalefree graph. More...  
template<typename Graph , typename RNG >  
Graph  Utopia::Graph::create_BollobasRiordan_graph (std::size_t num_vertices, double alpha, double beta, double gamma, double del_in, double del_out, RNG &rng) 
Create a scalefree directed graph. More...  
template<typename Graph , typename RNG >  
Graph  Utopia::Graph::create_WattsStrogatz_graph (const std::size_t n, const std::size_t k, const double p_rewire, const bool oriented, RNG &rng) 
Create a WattsStrogatz smallworld graph. More...  
template<typename Graph , typename RNG >  
Graph  Utopia::Graph::create_graph (const Config &cfg, RNG &rng, boost::dynamic_properties pmaps={boost::ignore_other_properties}) 
Create a graph from a configuration node. More...  
Graph Utopia::Graph::BarabasiAlbert_parallel_generator  (  std::size_t  num_vertices, 
std::size_t  mean_degree,  
RNG &  rng  
) 
Generate a BarabásiAlbert scalefree graph with parallel edges.
This is the classic version of the generating model with a completely connected spawning network. This function generates a scalefree graph using the BarabásiAlbert model. The algorithm starts with a small spawning network to which new vertices are added one at a time. Each new vertex receives a connection to mean_degree existing vertices with a probability that is proportional to the number of links of the corresponding vertex. In this version, the repeated vertices, that are added during the whole generating process, are stored. With each vertex added a uniform sample from the repeated_vertex is drawn. Each vertex thus has a probability to get selected that is proportional to the number of degrees of that vertex.
Graph  The graph type 
RNG  The random number generator type 
num_vertices  The total number of vertices 
mean_degree  The mean degree 
rng  The random number generator 
Graph Utopia::Graph::create_BarabasiAlbert_graph  (  std::size_t  num_vertices, 
std::size_t  mean_degree,  
bool  parallel,  
RNG &  rng  
) 
Create a BarabásiAlbert scalefree graph.
This function generates a scalefree graph using the BarabásiAlbert model. The algorithm starts with a small spawning network to which new vertices are added one at a time. Each new vertex receives a connection to mean_degree existing vertices with a probability that is proportional to the number of links of the corresponding vertex.
There are two slightly different variants of the algorithm, one that creates a graph with no parallel edges and one that creates a graph with parallel edges.
Graph  The graph type 
RNG  The random number generator type 
num_vertices  The total number of vertices 
mean_degree  The mean degree 
parallel  Whether the graph should have parallel edges or not 
rng  The random number generator 
Graph Utopia::Graph::create_BollobasRiordan_graph  (  std::size_t  num_vertices, 
double  alpha,  
double  beta,  
double  gamma,  
double  del_in,  
double  del_out,  
RNG &  rng  
) 
Create a scalefree directed graph.
This function generates a scalefree graph using the model from Bollobás et al. Multiedges and selfloops are not allowed. The graph is built by continuously adding new edges via preferential attachment. In each step, an edge is added in one of the following three ways:
Graph  The graph type 
RNG  The random number generator type 
n  The total number of vertices 
alpha  The probability for option 'A' 
beta  The probability for option 'B' 
gamma  The probability for option 'C' 
del_in  The unnormalized attraction of newly added vertices 
del_out  The unnormalized connectivity of newly added vertices 
rng  The random number generator 
Graph Utopia::Graph::create_complete_graph  (  const std::size_t  n  ) 
Graph Utopia::Graph::create_ErdosRenyi_graph  (  const std::size_t  num_vertices, 
const std::size_t  mean_degree,  
bool  allow_parallel,  
bool  self_edges,  
RNG &  rng  
) 
Create a ErdösRényi random graph.
This function uses the create_random_graph function from the boost graph library. It uses the ErdösRényi algorithm to generate the random graph. Sources and targets of edges are randomly selected with equal probability. Thus, every possible edge has the same probability to be created.
Graph  The graph type 
RNG  The random number generator type 
num_vertices  The total number of vertices 
mean_degree  The mean degree (= mean indegree = mean outdegree for directed graphs) 
allow_parallel  Allow parallel edges within the graph 
self_edges  Allows a vertex to be connected to itself 
rng  The random number generator 
Graph Utopia::Graph::create_graph  (  const Config &  cfg, 
RNG &  rng,  
boost::dynamic_properties  pmaps = {boost::ignore_other_properties} 

) 
Create a graph from a configuration node.
Select a graph creation algorithm and create the graph object a configuration node.
Graph  The graph type 
Config  The configuration node type 
RNG  The random number generator type 
cfg  The configuration 
rng  The random number generator 
pmaps  Property maps that may be used by the graph creation algorithms. At this point, only the load_from_file model will make use of this, allowing to populate a weight property map. 
Graph Utopia::Graph::create_KlemmEguiluz_graph  (  const std::size_t  num_vertices, 
const std::size_t  mean_degree,  
const double  mu,  
RNG &  rng  
) 
Create a KlemmEguíluz scalefree smallworld highlyclustered graph.
This function generates a graph using the KlemmEguíluz model (Klemm & Eguíluz 2002). The algorithm starts with a small spawning network to which new vertices are added one at a time. Each new vertex receives a connection to mean_degree existing vertices with a probability that is proportional to the number of links of the corresponding vertex. With probability mu, links are instead rewired to a (possibly nonactive) vertex, chosen with a probability that is proportional to its degree. Thus, for mu=1 we obtain the BarabasiAlbert linear preferential attachment model.
Graph  The graph type 
RNG  The random number generator type 
num_vertices  The total number of vertices 
mean_degree  The mean degree 
mu  The probability of rewiring to a random vertex 
rng  The random number generator 
Graph Utopia::Graph::create_regular_graph  (  const std::size_t  n, 
const std::size_t  k,  
const bool  oriented  
) 
Create a regular lattice graph.
This function creates a kregular graph. The algorithm has been adapted for directed graphs, for which it can be specified whether the underlying lattice graph is oriented or not.
Graph  The graph type 
n  The total number of vertices 
k  The mean degree (= mean indegree = mean outdegree for directed graphs) 
oriented  (For directed graphs) whether the created lattice is oriented (only connecting to forward neighbors) or not 
rng  The random number generator 
Graph Utopia::Graph::create_WattsStrogatz_graph  (  const std::size_t  n, 
const std::size_t  k,  
const double  p_rewire,  
const bool  oriented,  
RNG &  rng  
) 
Create a WattsStrogatz smallworld graph.
This function creates a smallworld graph using the WattsStrogatz model. It creates a kregular graph and relocates vertex connections with a given probability. The algorithm has been adapted for directed graphs, for which it can be specified whether the underlying lattice graph is oriented or not.
Graph  The graph type 
RNG  The random number generator type 
n  The total number of vertices 
k  The mean degree (= mean indegree = mean outdegree for directed graphs) 
p_rewire  The rewiring probability 
oriented  (for directed graphs) Whether the underlying starting graph is oriented (only connecting to forward neighbors) or not 
RNG  The random number generator 