pub fn global_reciprocity(g: &PyGraphView) -> f64
Expand description

Reciprocity - measure of the symmetry of relationships in a graph, the global reciprocity of the entire graph. This calculates the number of reciprocal connections (edges that go in both directions) in a graph and normalizes it by the total number of edges.

In a social network context, reciprocity measures the likelihood that if person A is linked to person B, then person B is linked to person A. This algorithm can be used to determine the level of symmetry or balance in a social network. It can also reveal the power dynamics in a group or community. For example, if one person has many connections that are not reciprocated, it could indicate that this person has more power or influence in the network than others.

In a business context, reciprocity can be used to study customer behavior. For instance, in a transactional network, if a customer tends to make a purchase from a seller and then the seller makes a purchase from the same customer, it can indicate a strong reciprocal relationship between them. On the other hand, if the seller does not make a purchase from the same customer, it could imply a less reciprocal or more one-sided relationship.