1227b5c020f13e087b90ae44b71fe93f13764e4a
Linking numbers in random graphs
This repository contains the Python code for computing linking numbers for links in random linear embeddings of graphs.
This code was used for Erica Flapan and Kenji Kozai. Linking number and writhe in random linear embeddings of graphs, J. Math. Chem. 54 (2016), 1117-1133.
Contents
- random_triangle_links_parallel.py: computes the value of q by taking 1 billion triangle-triangle links randomly embedded in [0,1]x[0,1]x[0,1], and computing the average linking number
- random_graphs.py: computes the linking number of all links in a random (n,p) graph, with as many samples as desired. The output is given in a list, where the first entry in the list is the number of links with linking number 0, the second entry is the number of links with linking number 1, etc. Parallel computations are distributed so each process computes the same number of samples.
- random_graphs2.py: same as above, except the parallel computations are done one at a time, and once one sample is finished, another is begun on the completed process. This is optimized to distribute the load better for larger samples. For small sample sizes, random_graphs.py is better due to the parallelization overhead.
Languages
Python
100%