Crate cnetworks[][src]

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.



Network is a graph-like data structure, containing a Vec of Node objects.



LinkWeight determines the weight (ie. the probability of infection) of each link in the network.


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



Perform a breadth-first search over the network, starting with root and looking for target. Return a HashSet of all nodes discovered in the process or None if the path is not found. Returns Err if the root or target nodes do not exist. Panics if the network is corrupted or when the queue operations fail.


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. Panics when the network is corrupted or if the queue operations fail.


Performs the phase of information spreading according to the susceptible-infected diffusion model.


Stich the network together if it is not whole.