summaryrefslogtreecommitdiff
path: root/doc/kruskal.1
diff options
context:
space:
mode:
Diffstat (limited to 'doc/kruskal.1')
-rw-r--r--doc/kruskal.199
1 files changed, 99 insertions, 0 deletions
diff --git a/doc/kruskal.1 b/doc/kruskal.1
new file mode 100644
index 0000000..eb2e5d0
--- /dev/null
+++ b/doc/kruskal.1
@@ -0,0 +1,99 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "KRUSKAL" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBkruskal\fR \- Find the minimum/maximum spanning tree of a graph
+.
+.SH "SYNOPSIS"
+\fBkruskal\fR \fIgraph_in\fR [MAX]
+.
+.SH "DESCRIPTION"
+\fBkruskal\fR computes the minimum (or maximum) spanning tree of \fIgraph_in\fR, using the Kruskal\'s algorithm\. If \fIgrahp_in\fR is unweighted, \fBkruskal\fR computes one of the spanning trees of the graph\. The program prints on output the (weighted) edge list of the spanning tree\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+undirected input graph (edge list)\. It must be an existing file\.
+.
+.TP
+\fBMAX\fR
+If the second (optional) parameter is equal to \fBMAX\fR, compute the maximum spanning tree\. Otherwise, compute the minimum spanning tree\.
+.
+.SH "OUTPUT"
+The program prints on STDOUT the edge list of the minimum (maximum) spannig tree of \fIgraph_in\fR, in the format:
+.
+.IP "" 4
+.
+.nf
+
+ i_1 j_1 w_ij_1
+ i_2 j_2 w_ij_2
+ \.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.SH "EXAMPLES"
+To find the minimum spanning tree of the graph \fBstocks_62_weight\.net\fR (the network of stocks in the New York Exchange market) we use the command:
+.
+.IP "" 4
+.
+.nf
+
+ $ kruskal stocks_62_weight\.net
+ 52 53 0\.72577357
+ 43 53 0\.72838212
+ 2 53 0\.72907212
+ \.\.\.
+ 36 53 0\.7973488
+ 53 58 0\.79931683
+ 26 27 0\.8029602
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+which prints on output the edge list of the minimum spanning tree\. However, since the weight of each edge in that graph indicates the similarity in the behaviour of two stocks, the maximum spanning tree contains information about the backbone of similarities among stocks\. To obtain the maximum spannin tree, we just specify \fBMAX\fR as second parameter:
+.
+.IP "" 4
+.
+.nf
+
+ $ kruskal stocks_62_weight\.net MAX
+ 56 58 1\.523483
+ 2 52 1\.3826744
+ 32 51 1\.3812241
+ \.\.\.
+ 33 55 0\.86880272
+ 7 28 0\.8631584
+ 1 53 0\.81876166
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.SH "SEE ALSO"
+clust_w(1), dijkstra(1), largest_component(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+J\. B\. Kruskal\. "On the shortest spanning subtree of a graph and the traveling sales\-man problem"\. P\. Am\. Math\. Soc\. 7 (1956), 48\-48\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 20, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 10, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.