I have already asked this question on StackExchange.
What does LocalClusteringCoefficient
compute for directed graphs?
For undirected graphs it follows the standard definitions and computes GraphDensity[Subgraph[g, AdjacencyList[g, v]]]
for vertex v
. I am not aware of a standard definition for directed graphs and I am unable to guess how the results it returns are computed. The documentation states that it does support directed graphs.
To take an example, can someone explain the result 1/2
for vertex 1
here?
g = Graph[{1, 2, 3, 4}, {1 -> 2, 2 -> 3, 3 -> 1, 1 -> 4},
VertexLabels -> "Name"]
LocalClusteringCoefficient[g]
(* {1/2, 1, 1, 0} *)
What about 1/3
here?
g = Graph[{1, 2, 3, 4}, {1 -> 2, 2 -> 3, 3 -> 1, 1 -> 4, 4 -> 1},
VertexLabels -> "Name"]
LocalClusteringCoefficient[g]
(* {1/3, 1, 1, 0} *)