# Percolation threshold

Percolation threshold is a mathematical concept related to percolation theory, which is the formation of long-range connectivity in random systems. Below the threshold a giant connected component does not exist; while above it, there exists a giant component of the order of system size.

How can we calculate a percolation threshold of a graph/network using Mathematica?

1. Image of a subcellular network: 2. The image is transformed into a graph by utilizing MorphologicalGraph function: 3. By applying the ConnectedComponents function and choosing the list of subgraphs from the suggestion menu one can obtain a soup of graphs/networks. Here are the top of that list: The question is how to exctract the probability that these networks are being connected? What is the critical treshold or bond percolation?

• demonstrations.wolfram.com/PercolationOnASquareGrid – Feyre Nov 4 '16 at 22:20
• This Q&A might also be of interest. – march Nov 4 '16 at 22:25
• @Feyre. Thank you so much. – Pure Function Nov 5 '16 at 0:01
• i don't follow the probabilistic nature of the question. If you have many such images you could see how many show long range connectivity. Otherwise its not clear what you are asking. – george2079 Nov 6 '16 at 19:26
• @george2079.Thank you for your consideration. I actually found this nice paper of Prof Oliver Knill "MATHEMATICA ROUTINES FOR INDEX EXPECTATION AND PERCOLATION " which kind of address the challenges I am dealing with at this point. Would appreciate any comments about what the code given actually does to define the site and bond percolations. – Pure Function Nov 6 '16 at 19:53

## 1 Answer

Start with a symmetric matrix of random positive weights.

mybasicweightmatrix = (temp = Table[RandomReal[], {10}, {10}]) +
Transpose[temp]; (* symmetric matrix of random positive weights *)


Then threshold the entries such that values less than mythreshold will be set to $0$ (not connected), others to $1$ (connected). Form a graph based on this thresholded adjacency matrix. Then adjust mythreshold until the graph is no longer weakly connected.

Manipulate[
thresholdedmatrix = (HeavisideTheta[# - mythreshold] & /@
mybasicweightmatrix);

myfig = Column[{mythreshold,
WeaklyConnectedGraphQ[nn = AdjacencyGraph[thresholdedmatrix]],
Graph[nn, GraphLayout -> "CircularEmbedding"]}],

{mythreshold, 0, 2}]


Here "weakly connected" means there is a path from any vertex to any other vertex. Seems like a reasonable specification of a "giant component."  • G.Stork. Thank you very much. I am a neophyte to programming in general and WL in particular. Do you mind please describing what the code actually does. I am very appreciative. – Pure Function Nov 5 '16 at 0:04
• @ G.Stork. Many Thanks! – Pure Function Nov 5 '16 at 1:20
• Pure Function: You're welcome. Will you be using this in some publication or research? – David G. Stork Nov 5 '16 at 4:47