summaryrefslogtreecommitdiff
path: root/doc/clust.1
blob: de587ccb84061ffaf4650516b5cd71f7c0743086 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "CLUST" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
.
.SH "NAME"
\fBclust\fR \- Compute the graph and node clustering coefficients
.
.SH "SYNOPSIS"
\fBclust\fR \fIgraph_in\fR [SHOW]
.
.SH "DESCRIPTION"
\fBclust\fR computes the clustering coefficient of the undirected graph given as input in the file \fIgraph_in\fR\. If \fBSHOW\fR is provided as a second parameter, the program prints on STDERR the label, degree, and clustering coefficient of all the nodes in \fIgraph_in\fR\.
.
.SH "PARAMETERS"
.
.TP
\fIgraph_in\fR
undirected input graph (edge list)\. If is equal to \fB\-\fR (dash), read the edge list from STDIN\.
.
.TP
SHOW
If the second (optional) parameter is equal to \fBSHOW\fR, the program will dump on the standard error the label, degree, and clustering coefficient of each node in \fIgraph_in\fR\.
.
.SH "OUTPUT"
If only \fIgraph_in\fR is specified, then the output is a single line, containing the clustering coefficient of the undirected graph provided as input\. If \fBSHOW\fR is specified, the program will print on the standard output one line for each node, in the format:
.
.IP "" 4
.
.nf

node_1 k_1 c_1
node_2 k_2 c_2
node_3 k_3 c_3
 \.\.\.\.
.
.fi
.
.IP "" 0
.
.P
where \fBnode_1\fR is the label of the node, \fBk_1\fR is its degree, and \fBc_1\fR is its node clustering coefficient\.
.
.SH "EXAMPLES"
The most simple way of using \fBclust\fR is to compute only the clustering coefficient of a graph\. For instance:
.
.IP "" 4
.
.nf

      $ clust er_1000_5000\.txt
      0\.01034196
      $
.
.fi
.
.IP "" 0
.
.P
will show on output the clustering coefficient of the graph \fBer_1000_5000\.txt\fR\. In order to obtain the clustering coefficient of all the nodes, we should use:
.
.IP "" 4
.
.nf

      $ clust er_1000_5000\.txt SHOW
      0 10 0\.0222222
      1 3 0
      2 7 0
      3 5 0
      4 10 0
      5 17 0
      6 14 0
      7 8 0
      8 6 0
      9 11 0
      10 9 0
      11 10 0
      12 13 0\.0128205
       \.\.\.\.
      998 10 0\.0222222
      999 9 0
      0\.01034196
      $
.
.fi
.
.IP "" 0
.
.P
The last line printed on output is still the value of the clustering coefficient of the graph, while the previous 1000 lines (which are printed on STDERR) contain the label, degree, and clustering coefficient of all the nodes\. For instance, the first line indicates that node \fB0\fR has degree equal to \fB10\fR and clustering coefficient equal to \fB0\.0222222\fR\. It is more convenient to save the values of node clustering coefficients in a file, e\.g\.:
.
.IP "" 4
.
.nf

      $ clust er_1000_5000\.txt SHOW  2> er_1000_5000\.txt_node_clust
      0\.01034196
      $
.
.fi
.
.IP "" 0
.
.P
In this case, the program prints on output only the graph clustering coefficient \fB0\.01034196\fR, while the node clustering coefficients are saved on the file \fBer_1000_5000\.txt_node_clust\fR (notice the syntax \fB2> er_1000_5000\.txt_node_clust\fR, which redirects the STDERR to the file \fBer_1000_5000\.txt_node_clust\fR)\.
.
.SH "SEE ALSO"
clust_w(1)
.
.SH "REFERENCES"
.
.IP "\(bu" 4
V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 4, Cambridge University Press (2017)
.
.IP "" 0
.
.SH "AUTHORS"
(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.