Graphs

Function definitions for each pre-packaged graph. Nodes are marked as either processing or switch. Processing nodes are assumed to be either src or dst nodes in entanglement distribution. Switch nodes are assumed to never be end points.

sequence.utils.graphs.build_autonomous_system(nodes: int, length: float = 10.0, attenuation: float = 0.0002, seed=None) Graph

Create an AS graph. :param nodes: Number of nodes :param length: Length of the edges; will be interpreted as km :param attenuation: Attenuation of the edges in dB/m :param seed: rng seed

Returns: NetworkX Graph

sequence.utils.graphs.build_bcube(k: int, n: int, length: float = 10.0, attenuation: float = 0.0002) Graph

C. Guo et al., “BCube: a high performance, server-centric network architecture for modular data centers,” SIGCOMM Comput. Commun. Rev., vol. 39, no. 4, pp. 63–74, Aug. 2009, doi: 10.1145/1594977.1592577. :param k: Number of levels :param n: Number of BCubes :param length: Length of the edges; will be interpreted as km :param attenuation: Attenuation of the edges in dB/m

Returns: Networkx Graph

sequence.utils.graphs.build_caveman(cliques: int, size: int, length: float = 10.0, attenuation: float = 0.0002) Graph

Create a caveman topology of l cliques of size k. :param cliques: Number of cliques (l) :param size: Size of the cliques (k) :param length: Length of the edges; will be interpreted as km :param attenuation: Attenuation of the edges in dB/m

Returns: Networkx Graph

sequence.utils.graphs.build_grid(size_x: int, size_y: int, length: float = 10.0, attenuation: float = 0.0002) Graph

Create a grid graph :param size_x: Nodes on x-axis :param size_y: Nodes on y-axis :param length: Length of the edges; will be interpreted as km :param attenuation: Attenuation of the edges in dB/m

Returns: Networkx graph

sequence.utils.graphs.build_k_n(k: int, n: int, length: float = 10.0, attenuation: float = 0.0002) Graph

Create a Fat Tree; k-ary n-tree nx graph parameterized by k and n. Contains N=k^n processing nodes and n*k^(n-1) switches

F. Petrini and M. Vanneschi, “k-ary n-trees: high performance networks for massively parallel architectures,” in Proceedings 11th International Parallel Processing Symposium, Apr. 1997, pp. 87–93. doi: 10.1109/IPPS.1997.580853.

Parameters:
  • k – Number of ports per switch.

  • n – Number of levels

  • length – Length of the edges; will be interpreted as km

  • attenuation – Attenuation of the edges in dB/m

Returns: NetworkX Graph

sequence.utils.graphs.build_linear(nodes: int, length: float = 10.0, attenuation: float = 0.0002) Graph

Create a linear graph of size n :param nodes: Number of nodes. :param length: Length of the edges; will be interpreted as km :param attenuation: Attenuation of the edges in dB/m

Returns: NetworkX Graph

sequence.utils.graphs.build_mesh(size_x: int, size_y: int, length: float = 10.0, attenuation: float = 0.0002) Graph

Create a fully connected grid graph. :param size_x: Nodes on x-axis :param size_y: Nodes on y-axis :param length: Length of the sides in the grid. Used to calculate diagonals. :param attenuation: Attenuation of the edges in dB/m

Returns: NetworkX Graph

sequence.utils.graphs.build_ring(nodes: int, length: float = 10.0, attenuation: float = 0.0002) Graph

Build a cycle/ring graph cyclically connected nodes of size n :param nodes: Number of nodes in the ring :param length: Length of the edges; will be interpreted as km :param attenuation: Attenuation of the edges in dB/m

Returns: NetworkX Graph

sequence.utils.graphs.build_star(outer_nodes: int, length: float = 10.0, attenuation: float = 0.0002) Graph

Create a star graph. :param outer_nodes: Number of nodes connected to the center. Center is index 0 :param length: Length of the edges; will be interpreted as km :param attenuation: Attenuation of the edges in dB/m

Returns: Networkx Graph

sequence.utils.graphs.build_tree(branching_factor: int, nodes: int, length: float = 10.0, attenuation: float = 0.0002) Graph

Create a full r-ary tree of n nodes. :param branching_factor: Branching factor in the tree :param nodes: Number of nodes in the tree :param length: Length of the edges; will be interpreted as km :param attenuation: Attenuation of the edges in dB/m

Returns: NetworkX Graph

sequence.utils.graphs.build_waxman(nodes, area_size: float = 10.0, attenuation: float = 0.0002, alpha=0.1, beta=0.4, L=None, seed=None) Graph

Builds a random Waxman graph of size n. Each pair of nodes at distance d is joined by edge with probability p = beta * exp(-d/(alpha*L)) :param nodes: Number of nodes :param area_size: Side length of deployment area :param attenuation: Attenuation of the edges in dB/m :param alpha: Model parameter; Default 0.1 :param beta: Model parameter; Default 0.4 :param L: Max Distance between nodes. If None actual distance is calculated; Default None :param seed: rng seed; Default None

Returns: NetworkX Graph