Crate cnetworks[][src]

Expand description

This is a library of tools for creating and manipulating complex networks.

From Wikipedia:

Complex network is a graph-like structure with non-trivial characteristics. A complex network is a graph (network) with non-trivial topological features—features that do not occur in simple networks such as lattices or random graphs but often occur in networks representing real systems. The study of complex networks is a young and active area of scientific research inspired largely by empirical findings of real-world networks such as computer networks, biological networks, technological networks, brain networks, climate networks and social networks.

Structs

Network is the main graph-like data structure.

Node is a single vertex in the graph-like data structure.

Enums

Error is used to signify a recoverable error.

Flag is used to store specific information about a given node.

Model decides the algorithm used to connect the nodes during Network’s initialization.

Weight determines the weight of each link in the network (ie. the probability of the infection spreading through it in each time step).

Functions

Perform a breadth-first search over the network, starting with root and looking for target. Returns distance (ie. number of edges) from root to target in the resulting BFS tree or None if no path is not found. Returns Err if the root or target nodes do not exist.

Perform a breadth-first search over the network, starting with root and looking for target, executing step_callback along the way. Returns distance (ie. number of edges) from root to target in the resulting BFS tree or None if no path is not found. Returns Err if the root or target nodes do not exist.

Obtain vector of clusters present in the network, ordered largest to smallest.

Explore the network with BFS starting with root. Return a tuple of two HashSets: one with the explored nodes (including the root) and another with the unexplored. Returns Err if the root does not exist.

Simulate spread of information according to the susceptible-infected diffusion model.

Stitch the network together if it is not whole.