summaryrefslogtreecommitdiff
path: root/doc/conf_model_deg.1
blob: a51d3d89e591315dc74f9b2bd30edad171af2fb1 (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
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "CONF_MODEL_DEG" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
.
.SH "NAME"
\fBconf_model_deg\fR \- Sample a simple graph from the configuration model
.
.SH "SYNOPSIS"
\fBconf_model_deg\fR \fIdegs\fR [\fIthreshold\fR]
.
.SH "DESCRIPTION"
\fBconf_model_deg\fR samples a simple random undirected graph (i\.e\., a graph without self\-loops and multiple edges) from the configuration model associated to the degree sequence provided in the input file \fIdegs\fR\.
.
.SH "PARAMETERS"
.
.TP
\fIdegs\fR
The name of the file containing the degree sequence\. If \fIdegs\fR is equal to \'\-\' (dash) the degree sequence is read from STDIN (standard input)\.
.
.TP
\fIthreshold\fR:
.
.IP
Optional number of edge stubs that are allowed to remain unmatched\. This is useful to create graphs from too\-constrained degree sequences (see \fIEXAMPLES\fR below)\.
.
.SH "OUTPUT"
\fBconf_model_deg\fR prints on output the edge list of the sampled graph, and reports on STDERR whether it has been able to find a graph\.
.
.SH "EXAMPLES"
Let us assume that the file \fBpl_\-3\.0_3_500_10000\fR contains a power\-law degree sequence (\'gamma=\-3\.0\', \'k_min=3\', \'k_max=500\', \'N=10000\'), for instance created using [power_law(1)][power_law(1)]\. We can sample a simple configuration model graph having that degree sequence using:
.
.IP "" 4
.
.nf

    $ conf_model_deg pl_\-3\.0_3_500_10000 > conf_model_\-3\.0_3_500_10000\.net
.
.fi
.
.IP "" 0
.
.P
where we have redirected the output (the resulting edge list) to the file \fBconf_model_\-3\.0_3_500_10000\.net\fR\. In this case it is not necessary to specify a threshold, since the maximum degree in the sequence is 126, which is smaller than the structural cut\-off\.
.
.P
Let us assume now that the file \fBAS\-20010316\.net_degs\fR contains the degree sequence of the data set \fBAS\-20010316\.net\fR (the graph of the Internet at AS level in March 2001)\. In this case, the degree sequence is too constrained, since the maximum degree (2277) is much larger than the structural cut\-off (see \fIREFERENCES\fR below)\. So if we don\'t specify a threshold, we get:
.
.IP "" 4
.
.nf

    $ conf_model_deg AS\-20010316\.net_degs > AS_20010316_rand\.net
    Graph not found (unmatched stubs: 986 > threshold: 0)
    Graph not found (unmatched stubs: 888 > threshold: 0)
    Graph not found (unmatched stubs: 974 > threshold: 0)
    \.\.\.\.\.
.
.fi
.
.IP "" 0
.
.P
and so on, since \fBconf_model_deg\fR is trying to match all the edge stubs, without success\. From the messages printed by \fBconf_model_deg\fR on STDERR we notice that the number of unmatched stubs is 986 in the first attempt, 888 in the second one, and so on, while the acceptable threshold is set to 0\. If we instead specify a reasonable threshold (in this example set to 950):
.
.IP "" 4
.
.nf

    $ conf_model_deg AS\-20010316\.net_degs 950 > AS_20010316_rand\.net
    Graph not found (unmatched stubs: 978 > threshold: 950)
    Found a graph (unmatched stubs: 876 <= threshold: 950)
    $
.
.fi
.
.IP "" 0
.
.P
\fBconf_model_deg\fR is able to create a graph after a few attempts\. Notice that in the resulting graph 876 of the original edge stubs will remain unmatched, meaning that the resulting graph has 876/2=438 edges less than those contained in the original graph\.
.
.SH "SEE ALSO"
deg_seq(1), conf_model_deg_nocheck(1), power_law(1), hv_net(1)
.
.SH "REFERENCES"
.
.IP "\(bu" 4
V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 5, Cambridge University Press (2017)
.
.IP "\(bu" 4
V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 12, Cambridge University Press (2017)
.
.IP "" 0
.
.SH "AUTHORS"
(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.