also define the clustering coefficient as It is simple to show that the two preceding definitions are the same, since These measures are 1 if every neighbour connected to is also connected to every other vertex within the neighbourhood, and 0 if no vertex that is connected to connects to any other vertex that is connected to . Since any graph is fully specified by its adjacency matrix A, the local clustering coefficient for a simple undirected graph can be expressed in terms of A as: where: and Ci=0 when ki is zero or one. In the above expression, the numerator counts twice the number of complete triangles that vertex i is involved in. In the denominator, ki2 counts the number of edge pairs that vertex i is involved in plus the number of single edges traversed twice. ki is the number of edges connected to vertex i, and subtracting ki then removes the latter, leaving only a set of edge pairs that could conceivably be connected into triangles. For every such edge pair, there will be another edge pair which could form the same triangle, so the denominator counts twice the number of conceivable triangles that vertex i could be involved in. Global clustering coefficient The global clustering coefficient is based on triplets of nodes. A triplet is three nodes that are connected by either two (open triplet) or three (closed triplet) undirected ties. A triangle graph therefore includes three closed triplets, one centered on each of the nodes (n.b. this means the three triplets in a triangle come from overlapping selections of nodes). The global clustering coefficient is the number of closed triplets (or 3 x triangles) over the total number of triplets (both open and closed). The first attempt to measure it was made by Luce and Perry (1949). This measure gives an indication of the clustering in the whole network (global), and can be applied to both undirected and directed networks (often called transitivity, see Wasserman and Faust, 1994, page 243). The global clustering coefficient is defined as: . The number of closed triplets has also been referred to as 3 × triangles in the literature, so: . A generalisation to weighted networks was proposed by Opsahl and Panzarasa (2009), and a redefinition to two-mode networks (both binary and weighted) by Opsahl (2009). Since any graph is fully specified by its adjacency matrix A, the global