def robins_alexander_clustering(G):
 if ((G.order() < 4) or (G.size() < 3)):
  return 0
 L_3 = _threepaths(G)
 if (L_3 == 0):
  return 0
 C_4 = _four_cycles(G)
 return ((4.0 * C_4) / L_3)

def robins_alexander_clustering ( G ) : if ( ( G . order ( ) < 4 ) or ( G . size ( ) < 3 ) ) : return 0 L_3 = _threepaths ( G ) if ( L_3 == 0 ) : return 0 C_4 = _four_cycles ( G ) return ( ( 4.0 * C_4 ) / L_3 )
compute the bipartite clustering of g .