38 views

Skip to first unread message

Mar 11, 2024, 10:47:39 AMMar 11

to networkx-discuss

I'm a beginner in network analysis and I'm trying to compute a measure of how connected my array (pearson correlations) is. I thought maybe a small-world coefficient like omega or sigma would be appropriate? My array has only 8 nodes, I tried the following:

import networkx as nx

a = np.array([[0,.3,.02,.40,.77,-11,.53],[.3,0,.0,.37,.52,-14,.34],[.2,.10,0,.05,-.03,.05,.39],[.4,.37,.05,0,-.17,.03,.40],[.77,.52,-.03,-.17,0,.12,.39],[-.11,-.14,.05,.03,.12,0,.57],[.53,.34,.39,.40,.39,.57,.0]])

G = nx.Graph(a)

nx.sigma(G)

1.0

but this cannot be correct, can it?

import networkx as nx

a = np.array([[0,.3,.02,.40,.77,-11,.53],[.3,0,.0,.37,.52,-14,.34],[.2,.10,0,.05,-.03,.05,.39],[.4,.37,.05,0,-.17,.03,.40],[.77,.52,-.03,-.17,0,.12,.39],[-.11,-.14,.05,.03,.12,0,.57],[.53,.34,.39,.40,.39,.57,.0]])

G = nx.Graph(a)

nx.sigma(G)

1.0

but this cannot be correct, can it?

Mar 11, 2024, 12:14:55 PMMar 11

to networkx...@googlegroups.com

It looks like your correlation array haasn't been thresholded so every possible edge (except self-loops) is present in the graph.

That would make the graph a complete graph with sigma=1.

Take a look at some other measures of connectivity of a graph , e.g. node_connectivity

Which measure you use depends on your application. YMMV

Reply all

Reply to author

Forward

0 new messages

Search

Clear search

Close search

Google apps

Main menu