Commands graph/clustering_coefficient¶
Coefficient of graph with respect to labels.
POST /v1/commands/¶
GET /v1/commands/:id¶
Request¶
Route
POST /v1/commands/
Body
name: | graph/clustering_coefficient |
---|---|
arguments: | graph : Graph
output_property_name : unicode (default=None)
input_edge_labels : list (default=None)
|
Headers
Authorization: test_api_key_1
Content-type: application/json
Description
Calculates the clustering coefficient of the graph with respect to an (optional) set of labels.
Pulls graph from underlying store, calculates degrees and writes them into the property specified, and then writes the output graph to the underlying store.
Warning
THIS FUNCTION IS FOR UNDIRECTED GRAPHS. If it is called on a directed graph, its output is NOT guaranteed to calculate the local directed clustering coefficients.
Clustering Coefficients
The clustering coefficient of a graph provides a measure of how tightly clustered an undirected graph is. Informally, if the edge relation denotes “friendship”, the clustering coefficient of the graph is the probability that two people are friends given that they share a common friend.
More formally:
Analogously, the clustering coefficient of a vertex provides a measure of how tightly clustered that vertex’s neighborhood is. Informally, if the edge relation denotes “friendship”, the clustering coefficient at a vertex is the probability that two acquaintances of are themselves friends.
More formally:
The toolkit provides the function clustering_coefficient which computes both local and global clustering coefficients for a given undirected graph.
For more details on the mathematics and applications of clustering coefficients, see http://en.wikipedia.org/wiki/Clustering_coefficient.
Response¶
Status
200 OK
Body
Returns information about the command. See the Response Body for Get Command here below. It is the same.
GET /v1/commands/:id¶
Request¶
Route
GET /v1/commands/18
Body
(None)
Headers
Authorization: test_api_key_1
Content-type: application/json
Response¶
Status
200 OK
Body
dict
Dictionary of the global clustering coefficient of the graph or, if local clustering coefficients are requested, a reference to the frame with local clustering coefficients stored at properties at each vertex.