DistMatrix1 = np.array([[0, 0.3, 0.4, 0.1], [0.3, 0, 0.9, 0.2], [0.4, 0.9, 
    0, 0.7], [0.1, 0.2, 0.7, 0]])
DistMatrix2 = np.array([[0, 0.3, 0.4, 0.7], [0.3, 0, 0.9, 0.2], [0.4, 0.9, 
    0, 0.1], [0.7, 0.2, 0.1, 0]])
Algorithm to find the "percolation" threshold in a weighed network