Skip to main content
`Ctrl`+`K`

# lattice_reference

lattice_reference(G, niter=5, D=None, connectivity=True, seed=None)

  Latticize the given graph by swapping edges.

  Parameters:
    G graph

      An undirected graph.

    niter integer (optional, default=1)

      An edge is rewired approximately niter times.

    D numpy.array (optional, default=None)

      Distance to the diagonal matrix.

    connectivity boolean (optional, default=True)

      Ensure connectivity for the latticized graph when set to True.

    seed integer, random_state, or None (default)

      Indicator of random number generation state. See Randomness.

  Returns:
    G graph

      The latticized graph.

  Raises:
    NetworkXError

      If there are fewer than 4 nodes or 2 edges in `G`

  Notes

  The implementation is adapted from the algorithm by Sporns et al. [1]. which is inspired from the original work by Maslov and Sneppen(2002) [2].

  References

  [1]

  Sporns, Olaf, and Jonathan D. Zwi. “The small world of the cerebral cortex.” Neuroinformatics 2.2 (2004): 145-162.

  [2]

  Maslov, Sergei, and Kim Sneppen. “Specificity and stability in topology of protein networks.” Science 296.5569 (2002): 910-913.