@@ -16220,21 +16220,25 @@ def clustering_coeff(self,
1622016220 {0: 1/3, 1: 1/3, 2: 0, 3: 1/3, 4: 1/3, 5: 1/3,
1622116221 6: 1/3, 7: 1/3, 8: 0, 9: 1/3, 10: 1/3, 11: 0}
1622216222
16223- sage: (graphs.FruchtGraph()).clustering_coeff(weight=True) # needs networkx
16223+ sage: # needs networkx
16224+ sage: import numpy
16225+ sage: if int(numpy.version.short_version[0]) > 1:
16226+ ....: numpy.set_printoptions(legacy="1.25")
16227+ sage: graphs.FruchtGraph().clustering_coeff(weight=True)
1622416228 {0: 0.3333333333333333, 1: 0.3333333333333333, 2: 0,
1622516229 3: 0.3333333333333333, 4: 0.3333333333333333,
1622616230 5: 0.3333333333333333, 6: 0.3333333333333333,
1622716231 7: 0.3333333333333333, 8: 0, 9: 0.3333333333333333,
1622816232 10: 0.3333333333333333, 11: 0}
1622916233
16230- sage: ( graphs.FruchtGraph() ).clustering_coeff(nodes=[0,1,2])
16234+ sage: graphs.FruchtGraph().clustering_coeff(nodes=[0,1,2])
1623116235 {0: 0.3333333333333333, 1: 0.3333333333333333, 2: 0.0}
1623216236
16233- sage: ( graphs.FruchtGraph() ).clustering_coeff(nodes=[0,1,2], # needs networkx
16237+ sage: graphs.FruchtGraph().clustering_coeff(nodes=[0,1,2], # needs networkx
1623416238 ....: weight=True)
1623516239 {0: 0.3333333333333333, 1: 0.3333333333333333, 2: 0}
1623616240
16237- sage: ( graphs.GridGraph([5,5]) ).clustering_coeff(nodes=[(0,0),(0,1),(2,2)])
16241+ sage: graphs.GridGraph([5,5]).clustering_coeff(nodes=[(0,0),(0,1),(2,2)])
1623816242 {(0, 0): 0.0, (0, 1): 0.0, (2, 2): 0.0}
1623916243
1624016244 TESTS:
0 commit comments