EhsanBitaraf / triple-a

Article Analysis Assistant
Apache License 2.0
16 stars 2 forks source link

network radius #11

Closed mjafarpour87 closed 1 year ago

mjafarpour87 commented 1 year ago

network radius is one of the metrics that should be calculated for the whole graph. It seems that we do not have it yet. Please make sure that it is calculated for directed networks, as well.

EhsanBitaraf commented 1 year ago

To calculate the radius of a network using NetworkX, you can use the networkx.algorithms.distance_measures.radius function. Here's an example code snippet:

import networkx as nx

# create a graph
G = nx.Graph()
G.add_edges_from([(1, 2), (2, 3), (3, 4), (4, 5)])

# calculate the radius
radius = nx.algorithms.distance_measures.radius(G)

print(radius) # output: 2

Do you want it to be placed in the info function?

EhsanBitaraf commented 1 year ago

I Update this but this error for test sample occur: Found infinite path length because the digraph is not strongly connected