summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2017-09-27 15:06:31 +0100
committerKatolaZ <katolaz@freaknet.org>2017-09-27 15:06:31 +0100
commit3aee2fd43e3059a699af2b63c6f2395e5a55e515 (patch)
tree58c95505a0906ed9cfa694f9dbd319403fd8f01d /doc
First commit on github -- NetBunch 1.0
Diffstat (limited to 'doc')
-rw-r--r--doc/Makefile.am39
-rw-r--r--doc/Makefile.in530
-rw-r--r--doc/ba.165
-rw-r--r--doc/ba.1.html153
-rw-r--r--doc/ba.md64
-rw-r--r--doc/bb_fitness.195
-rw-r--r--doc/bb_fitness.1.html169
-rw-r--r--doc/bb_fitness.md80
-rw-r--r--doc/bbv.189
-rw-r--r--doc/bbv.1.html169
-rw-r--r--doc/bbv.md85
-rw-r--r--doc/bet_dependency.181
-rw-r--r--doc/bet_dependency.1.html167
-rw-r--r--doc/bet_dependency.md78
-rw-r--r--doc/betweenness.1114
-rw-r--r--doc/betweenness.1.html190
-rw-r--r--doc/betweenness.md99
-rw-r--r--doc/clust.1119
-rw-r--r--doc/clust.1.html202
-rw-r--r--doc/clust.md105
-rw-r--r--doc/clust_w.1111
-rw-r--r--doc/clust_w.1.html197
-rw-r--r--doc/clust_w.md100
-rw-r--r--doc/cnm.1107
-rw-r--r--doc/cnm.1.html196
-rw-r--r--doc/cnm.md99
-rw-r--r--doc/components.1161
-rw-r--r--doc/components.1.html226
-rw-r--r--doc/components.md130
-rw-r--r--doc/conf_model_deg.196
-rw-r--r--doc/conf_model_deg.1.html190
-rw-r--r--doc/conf_model_deg.md97
-rw-r--r--doc/conf_model_deg_nocheck.152
-rw-r--r--doc/conf_model_deg_nocheck.1.html152
-rw-r--r--doc/conf_model_deg_nocheck.md58
-rw-r--r--doc/deg_seq.151
-rw-r--r--doc/deg_seq.1.html138
-rw-r--r--doc/deg_seq.md45
-rw-r--r--doc/deg_seq_w.151
-rw-r--r--doc/deg_seq_w.1.html138
-rw-r--r--doc/deg_seq_w.md45
-rw-r--r--doc/dijkstra.176
-rw-r--r--doc/dijkstra.1.html158
-rw-r--r--doc/dijkstra.md65
-rw-r--r--doc/dms.1121
-rw-r--r--doc/dms.1.html183
-rw-r--r--doc/dms.md92
-rw-r--r--doc/er_A.178
-rw-r--r--doc/er_A.1.html158
-rw-r--r--doc/er_A.md69
-rw-r--r--doc/er_B.178
-rw-r--r--doc/er_B.1.html158
-rw-r--r--doc/er_B.md70
-rw-r--r--doc/f3m.1156
-rw-r--r--doc/f3m.1.html235
-rw-r--r--doc/f3m.md144
-rw-r--r--doc/fitmle.1136
-rw-r--r--doc/fitmle.1.html215
-rw-r--r--doc/fitmle.md125
-rw-r--r--doc/gn.1110
-rw-r--r--doc/gn.1.html201
-rw-r--r--doc/gn.md104
-rw-r--r--doc/graph_info.148
-rw-r--r--doc/graph_info.1.html135
-rw-r--r--doc/graph_info.md41
-rw-r--r--doc/hv_net.183
-rw-r--r--doc/hv_net.1.html163
-rw-r--r--doc/hv_net.md72
-rw-r--r--doc/johnson_cycles.1205
-rw-r--r--doc/johnson_cycles.1.html268
-rw-r--r--doc/johnson_cycles.md171
-rw-r--r--doc/knn.1158
-rw-r--r--doc/knn.1.html239
-rw-r--r--doc/knn.md148
-rw-r--r--doc/knn_w.1147
-rw-r--r--doc/knn_w.1.html222
-rw-r--r--doc/knn_w.md131
-rw-r--r--doc/kruskal.199
-rw-r--r--doc/kruskal.1.html182
-rw-r--r--doc/kruskal.md89
-rw-r--r--doc/label_prop.1112
-rw-r--r--doc/label_prop.1.html197
-rw-r--r--doc/label_prop.md104
-rw-r--r--doc/largest_component.150
-rw-r--r--doc/largest_component.1.html139
-rw-r--r--doc/largest_component.md47
-rw-r--r--doc/modularity.170
-rw-r--r--doc/modularity.1.html151
-rw-r--r--doc/modularity.md59
-rw-r--r--doc/node_components.1137
-rw-r--r--doc/node_components.1.html210
-rw-r--r--doc/node_components.md116
-rw-r--r--doc/pm.168
-rw-r--r--doc/pm.1.html148
-rw-r--r--doc/pm.md57
-rw-r--r--doc/power_law.1160
-rw-r--r--doc/power_law.1.html217
-rw-r--r--doc/power_law.md118
-rw-r--r--doc/shortest.1105
-rw-r--r--doc/shortest.1.html177
-rw-r--r--doc/shortest.md83
-rw-r--r--doc/shortest_avg_max_hist.160
-rw-r--r--doc/shortest_avg_max_hist.1.html152
-rw-r--r--doc/shortest_avg_max_hist.md61
-rw-r--r--doc/strong_conn.1127
-rw-r--r--doc/strong_conn.1.html199
-rw-r--r--doc/strong_conn.md104
-rw-r--r--doc/ws.190
-rw-r--r--doc/ws.1.html174
-rw-r--r--doc/ws.md85
110 files changed, 14043 insertions, 0 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..a1923ac
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,39 @@
+if HAVE_RONN
+
+all-local: ronn
+
+ronn:
+ ronn -r5 --style=toc --manual="www.complex-networks.net" --organization="www.complex-networks.net" *.md
+
+endif
+
+docdir = $(prefix)/$(PACKAGE)-doc
+dist_doc_DATA = ba.1.html bb_fitness.1.html bbv.1.html bet_dependency.1.html \
+betweenness.1.html clust.1.html clust_w.1.html cnm.1.html components.1.html \
+conf_model_deg.1.html conf_model_deg_nocheck.1.html deg_seq.1.html \
+deg_seq_w.1.html dijkstra.1.html dms.1.html er_A.1.html er_B.1.html \
+f3m.1.html fitmle.1.html gn.1.html graph_info.1.html hv_net.1.html \
+johnson_cycles.1.html knn.1.html knn_w.1.html kruskal.1.html \
+label_prop.1.html largest_component.1.html modularity.1.html \
+node_components.1.html pm.1.html power_law.1.html shortest.1.html \
+shortest_avg_max_hist.1.html strong_conn.1.html ws.1.html \
+ba.md bb_fitness.md bbv.md bet_dependency.md betweenness.md \
+clust.md clust_w.md cnm.md components.md conf_model_deg.md \
+conf_model_deg_nocheck.md deg_seq.md deg_seq_w.md dijkstra.md dms.md \
+er_A.md er_B.md f3m.md fitmle.md gn.md graph_info.md hv_net.md \
+johnson_cycles.md knn.md knn_w.md kruskal.md label_prop.md \
+largest_component.md modularity.md node_components.md pm.md power_law.md \
+shortest.md shortest_avg_max_hist.md strong_conn.md ws.md
+###dist_doc_DATA = $(doc_DATA)
+
+
+dist_man_MANS = ba.1 bb_fitness.1 bbv.1 bet_dependency.1 betweenness.1 \
+clust.1 clust_w.1 cnm.1 components.1 conf_model_deg.1 \
+conf_model_deg_nocheck.1 deg_seq.1 deg_seq_w.1 dijkstra.1 dms.1 \
+er_A.1 er_B.1 f3m.1 fitmle.1 gn.1 graph_info.1 hv_net.1 \
+johnson_cycles.1 knn.1 knn_w.1 kruskal.1 label_prop.1 \
+largest_component.1 modularity.1 node_components.1 pm.1 power_law.1 \
+shortest.1 shortest_avg_max_hist.1 strong_conn.1 ws.1
+
+##dist_man_MANS = $(man_MANS)
+
diff --git a/doc/Makefile.in b/doc/Makefile.in
new file mode 100644
index 0000000..7fad556
--- /dev/null
+++ b/doc/Makefile.in
@@ -0,0 +1,530 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = doc
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(dist_doc_DATA) \
+ $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+man1dir = $(mandir)/man1
+am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(docdir)"
+NROFF = nroff
+MANS = $(dist_man_MANS)
+DATA = $(dist_doc_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RONN = @RONN@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = $(prefix)/$(PACKAGE)-doc
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+dist_doc_DATA = ba.1.html bb_fitness.1.html bbv.1.html bet_dependency.1.html \
+betweenness.1.html clust.1.html clust_w.1.html cnm.1.html components.1.html \
+conf_model_deg.1.html conf_model_deg_nocheck.1.html deg_seq.1.html \
+deg_seq_w.1.html dijkstra.1.html dms.1.html er_A.1.html er_B.1.html \
+f3m.1.html fitmle.1.html gn.1.html graph_info.1.html hv_net.1.html \
+johnson_cycles.1.html knn.1.html knn_w.1.html kruskal.1.html \
+label_prop.1.html largest_component.1.html modularity.1.html \
+node_components.1.html pm.1.html power_law.1.html shortest.1.html \
+shortest_avg_max_hist.1.html strong_conn.1.html ws.1.html \
+ba.md bb_fitness.md bbv.md bet_dependency.md betweenness.md \
+clust.md clust_w.md cnm.md components.md conf_model_deg.md \
+conf_model_deg_nocheck.md deg_seq.md deg_seq_w.md dijkstra.md dms.md \
+er_A.md er_B.md f3m.md fitmle.md gn.md graph_info.md hv_net.md \
+johnson_cycles.md knn.md knn_w.md kruskal.md label_prop.md \
+largest_component.md modularity.md node_components.md pm.md power_law.md \
+shortest.md shortest_avg_max_hist.md strong_conn.md ws.md
+
+###dist_doc_DATA = $(doc_DATA)
+dist_man_MANS = ba.1 bb_fitness.1 bbv.1 bet_dependency.1 betweenness.1 \
+clust.1 clust_w.1 cnm.1 components.1 conf_model_deg.1 \
+conf_model_deg_nocheck.1 deg_seq.1 deg_seq_w.1 dijkstra.1 dms.1 \
+er_A.1 er_B.1 f3m.1 fitmle.1 gn.1 graph_info.1 hv_net.1 \
+johnson_cycles.1 knn.1 knn_w.1 kruskal.1 label_prop.1 \
+largest_component.1 modularity.1 node_components.1 pm.1 power_law.1 \
+shortest.1 shortest_avg_max_hist.1 strong_conn.1 ws.1
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign doc/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-man1: $(dist_man_MANS)
+ @$(NORMAL_INSTALL)
+ @list1=''; \
+ list2='$(dist_man_MANS)'; \
+ test -n "$(man1dir)" \
+ && test -n "`echo $$list1$$list2`" \
+ || exit 0; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+ { for i in $$list1; do echo "$$i"; done; \
+ if test -n "$$list2"; then \
+ for i in $$list2; do echo "$$i"; done \
+ | sed -n '/\.1[a-z]*$$/p'; \
+ fi; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list=''; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+install-dist_docDATA: $(dist_doc_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
+ done
+
+uninstall-dist_docDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+@HAVE_RONN_FALSE@all-local:
+all-am: Makefile $(MANS) $(DATA) all-local
+installdirs:
+ for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(docdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_docDATA install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-dist_docDATA uninstall-man
+
+uninstall-man: uninstall-man1
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am all-local check check-am clean clean-generic \
+ cscopelist-am ctags-am distclean distclean-generic distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dist_docDATA install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-man1 install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags-am \
+ uninstall uninstall-am uninstall-dist_docDATA uninstall-man \
+ uninstall-man1
+
+.PRECIOUS: Makefile
+
+
+@HAVE_RONN_TRUE@all-local: ronn
+
+@HAVE_RONN_TRUE@ronn:
+@HAVE_RONN_TRUE@ ronn -r5 --style=toc --manual="www.complex-networks.net" --organization="www.complex-networks.net" *.md
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/ba.1 b/doc/ba.1
new file mode 100644
index 0000000..a226ec3
--- /dev/null
+++ b/doc/ba.1
@@ -0,0 +1,65 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BA" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBba\fR \- Grow a Barabasi\-Albert scale\-free random graph
+.
+.SH "SYNOPSIS"
+\fBba\fR \fIN\fR \fIm\fR \fIn0\fR
+.
+.SH "DESCRIPTION"
+\fBba\fR grows an undirected random scale\-free graph with \fIN\fR nodes using the linear preferential attachment model proposed by Barabasi and Albert\. The initial network is a ring of \fIn0\fR nodes, and each new node creates \fIm\fR new edges\. The resulting graph will have a scale\-free degree distribution, whose exponent converges to \fBgamma=3\.0\fR for large \fIN\fR\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIN\fR
+Number of nodes of the final graph\.
+.
+.TP
+\fIm\fR
+Number of edges created by each new node\.
+.
+.TP
+\fIn0\fR
+Number of nodes in the initial (seed) graph\.
+.
+.SH "OUTPUT"
+\fBba\fR prints on STDOUT the edge list of the final graph\.
+.
+.SH "EXAMPLES"
+The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ ba 10000 3 5 > ba_10000_3_5\.txt
+.
+.fi
+.
+.IP "" 0
+.
+.P
+creates a Barabasi\-Albert scale\-free graph with \fIN=10000\fR nodes, where each new node creates \fIm=3\fR new edges and the initial seed network is a ring of \fIn0=5\fR nodes\. The edge list of the graph is saved in the file \fBba_10000_3_5\.txt\fR (thanks to the redirection operator \fB>\fR)\.
+.
+.SH "SEE ALSO"
+bb_fitness(1), dms(1), bbv(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+A\.\-L\. Barabasi, R\. Albert, "Emergence of scaling in random networks", Science 286, 509\-512 (1999)\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 6, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 13, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/ba.1.html b/doc/ba.1.html
new file mode 100644
index 0000000..37f6e97
--- /dev/null
+++ b/doc/ba.1.html
@@ -0,0 +1,153 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>ba(1) - Grow a Barabasi-Albert scale-free random graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>ba(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>ba(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>ba</code> - <span class="man-whatis">Grow a Barabasi-Albert scale-free random graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>ba</code> <var>N</var> <var>m</var> <var>n0</var></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>ba</code> grows an undirected random scale-free graph with <var>N</var> nodes using
+the linear preferential attachment model proposed by Barabasi and
+Albert. The initial network is a ring of <var>n0</var> nodes, and each new node
+creates <var>m</var> new edges. The resulting graph will have a scale-free
+degree distribution, whose exponent converges to <code>gamma=3.0</code> for large
+<var>N</var>.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt class="flush"><var>N</var></dt><dd><p> Number of nodes of the final graph.</p></dd>
+<dt class="flush"><var>m</var></dt><dd><p> Number of edges created by each new node.</p></dd>
+<dt class="flush"><var>n0</var></dt><dd><p> Number of nodes in the initial (seed) graph.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>ba</code> prints on STDOUT the edge list of the final graph.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The following command:</p>
+
+<pre><code> $ ba 10000 3 5 &gt; ba_10000_3_5.txt
+</code></pre>
+
+<p>creates a Barabasi-Albert scale-free graph with <var>N=10000</var> nodes, where
+each new node creates <var>m=3</var> new edges and the initial seed network is
+a ring of <var>n0=5</var> nodes. The edge list of the graph is saved in the
+file <code>ba_10000_3_5.txt</code> (thanks to the redirection operator <code>&gt;</code>).</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="bb_fitness.1.html">bb_fitness<span class="s">(1)</span></a>, <a class="man-ref" href="dms.1.html">dms<span class="s">(1)</span></a>, <a class="man-ref" href="bbv.1.html">bbv<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>A.-L. Barabasi, R. Albert, "Emergence of scaling in random
+networks", Science 286, 509-512 (1999).</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 6, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 13, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>ba(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/ba.md b/doc/ba.md
new file mode 100644
index 0000000..1c367fa
--- /dev/null
+++ b/doc/ba.md
@@ -0,0 +1,64 @@
+ba(1) -- Grow a Barabasi-Albert scale-free random graph
+======
+
+## SYNOPSIS
+
+`ba` <N> <m> <n0>
+
+## DESCRIPTION
+
+`ba` grows an undirected random scale-free graph with <N> nodes using
+the linear preferential attachment model proposed by Barabasi and
+Albert. The initial network is a ring of <n0> nodes, and each new node
+creates <m> new edges. The resulting graph will have a scale-free
+degree distribution, whose exponent converges to `gamma=3.0` for large
+<N>.
+
+## PARAMETERS
+
+* <N>:
+ Number of nodes of the final graph.
+
+* <m>:
+ Number of edges created by each new node.
+
+* <n0>:
+ Number of nodes in the initial (seed) graph.
+
+## OUTPUT
+
+`ba` prints on STDOUT the edge list of the final graph.
+
+## EXAMPLES
+
+The following command:
+
+ $ ba 10000 3 5 > ba_10000_3_5.txt
+
+creates a Barabasi-Albert scale-free graph with <N=10000> nodes, where
+each new node creates <m=3> new edges and the initial seed network is
+a ring of <n0=5> nodes. The edge list of the graph is saved in the
+file `ba_10000_3_5.txt` (thanks to the redirection operator `>`).
+
+## SEE ALSO
+
+bb_fitness(1), dms(1), bbv(1)
+
+## REFERENCES
+
+* A\.-L. Barabasi, R. Albert, "Emergence of scaling in random
+ networks", Science 286, 509-512 (1999).
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 6, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 13, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
+
diff --git a/doc/bb_fitness.1 b/doc/bb_fitness.1
new file mode 100644
index 0000000..1aa28c5
--- /dev/null
+++ b/doc/bb_fitness.1
@@ -0,0 +1,95 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BB_FITNESS" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBbb_fitness\fR \- Grow a random graph with the fitness model
+.
+.SH "SYNOPSIS"
+\fBbb_fitness\fR \fIN\fR \fIm\fR \fIn0\fR [SHOW]
+.
+.SH "DESCRIPTION"
+\fBbb_fitness\fR grows an undirected random scale\-free graph with \fIN\fR nodes using the fitness model proposed by Bianconi and Barabasi\. The initial network is a clique of \fIn0\fR nodes, and each new node creates \fIm\fR new edges\. The probability that a new node create an edge to node \fBj\fR is proportional to
+.
+.IP "" 4
+.
+.nf
+
+ a_j * k_j
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBa_j\fR is the attractiveness (fitness) of node \fBj\fR\. The values of node attractiveness are sampled uniformly in the interval [0,1]\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIN\fR
+Number of nodes of the final graph\.
+.
+.TP
+\fIm\fR
+Number of edges created by each new node\.
+.
+.TP
+\fIn0\fR
+Number of nodes in the initial (seed) graph\.
+.
+.TP
+SHOW
+If the fourth parameter is equal to \fBSHOW\fR, the values of node attractiveness are printed on STDERR\.
+.
+.SH "OUTPUT"
+\fBbb_fitness\fR prints on STDOUT the edge list of the final graph\.
+.
+.SH "EXAMPLES"
+The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ bb_fitness 10000 3 4 > bb_fitness_10000_3_4\.txt
+.
+.fi
+.
+.IP "" 0
+.
+.P
+uses the fitness model to create a random graph with \fIN=10000\fR nodes, where each new node creates \fIm=3\fR new edges and the initial seed network is a ring of \fIn0=5\fR nodes\. The edge list of the resulting graph is saved in the file \fBbb_fitness_10000_3_4\.txt\fR (notice the redirection operator \fB>\fR)\. The command:
+.
+.IP "" 4
+.
+.nf
+
+ $ bb_fitness 10000 3 4 SHOW > bb_fitness_10000_3_4\.txt 2> bb_fitness_10000_3_4\.txt_fitness
+.
+.fi
+.
+.IP "" 0
+.
+.P
+will do the same as above, but it will additionally save the values of node fitness in the file \fBbb_fitness_10000_3_4\.txt_fitness\fR (notice the redirection operator \fB2>\fR, that redirects the STDERR to the specified file)\.
+.
+.SH "SEE ALSO"
+ba(1), dms(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+G\. Bianconi, A\.\-L\. Barabasi, " Competition and multiscaling in evolving networks"\. EPL\-Europhys\. Lett\. 54 (2001), 436\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 6, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 13, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/bb_fitness.1.html b/doc/bb_fitness.1.html
new file mode 100644
index 0000000..dbac594
--- /dev/null
+++ b/doc/bb_fitness.1.html
@@ -0,0 +1,169 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>bb_fitness(1) - Grow a random graph with the fitness model</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>bb_fitness(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>bb_fitness(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>bb_fitness</code> - <span class="man-whatis">Grow a random graph with the fitness model</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>bb_fitness</code> <var>N</var> <var>m</var> <var>n0</var> [SHOW]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>bb_fitness</code> grows an undirected random scale-free graph with <var>N</var>
+nodes using the fitness model proposed by Bianconi and Barabasi. The
+initial network is a clique of <var>n0</var> nodes, and each new node creates
+<var>m</var> new edges. The probability that a new node create an edge to node
+<code>j</code> is proportional to</p>
+
+<pre><code> a_j * k_j
+</code></pre>
+
+<p>where <code>a_j</code> is the attractiveness (fitness) of node <code>j</code>. The values of
+node attractiveness are sampled uniformly in the interval [0,1].</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt class="flush"><var>N</var></dt><dd><p> Number of nodes of the final graph.</p></dd>
+<dt class="flush"><var>m</var></dt><dd><p> Number of edges created by each new node.</p></dd>
+<dt class="flush"><var>n0</var></dt><dd><p> Number of nodes in the initial (seed) graph.</p></dd>
+<dt class="flush">SHOW</dt><dd><p> If the fourth parameter is equal to <code>SHOW</code>, the values of node
+ attractiveness are printed on STDERR.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>bb_fitness</code> prints on STDOUT the edge list of the final graph.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The following command:</p>
+
+<pre><code> $ bb_fitness 10000 3 4 &gt; bb_fitness_10000_3_4.txt
+</code></pre>
+
+<p>uses the fitness model to create a random graph with <var>N=10000</var> nodes,
+where each new node creates <var>m=3</var> new edges and the initial seed
+network is a ring of <var>n0=5</var> nodes. The edge list of the resulting
+graph is saved in the file <code>bb_fitness_10000_3_4.txt</code> (notice the
+redirection operator <code>&gt;</code>). The command:</p>
+
+<pre><code> $ bb_fitness 10000 3 4 SHOW &gt; bb_fitness_10000_3_4.txt 2&gt; bb_fitness_10000_3_4.txt_fitness
+</code></pre>
+
+<p>will do the same as above, but it will additionally save the values of
+node fitness in the file <code>bb_fitness_10000_3_4.txt_fitness</code> (notice
+the redirection operator <code>2&gt;</code>, that redirects the STDERR to the
+specified file).</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="ba.1.html">ba<span class="s">(1)</span></a>, <a class="man-ref" href="dms.1.html">dms<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>G. Bianconi, A.-L. Barabasi, " Competition and multiscaling in
+evolving networks". EPL-Europhys. Lett. 54 (2001), 436.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 6, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 13, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>bb_fitness(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/bb_fitness.md b/doc/bb_fitness.md
new file mode 100644
index 0000000..7e97107
--- /dev/null
+++ b/doc/bb_fitness.md
@@ -0,0 +1,80 @@
+bb_fitness(1) -- Grow a random graph with the fitness model
+======
+
+## SYNOPSIS
+
+`bb_fitness` <N> <m> <n0> [SHOW]
+
+## DESCRIPTION
+
+`bb_fitness` grows an undirected random scale-free graph with <N>
+nodes using the fitness model proposed by Bianconi and Barabasi. The
+initial network is a clique of <n0> nodes, and each new node creates
+<m> new edges. The probability that a new node create an edge to node
+`j` is proportional to
+
+ a_j * k_j
+
+where `a_j` is the attractiveness (fitness) of node `j`. The values of
+node attractiveness are sampled uniformly in the interval [0,1].
+
+## PARAMETERS
+
+* <N>:
+ Number of nodes of the final graph.
+
+* <m>:
+ Number of edges created by each new node.
+
+* <n0>:
+ Number of nodes in the initial (seed) graph.
+
+* SHOW:
+ If the fourth parameter is equal to `SHOW`, the values of node
+ attractiveness are printed on STDERR.
+
+## OUTPUT
+
+`bb_fitness` prints on STDOUT the edge list of the final graph.
+
+## EXAMPLES
+
+The following command:
+
+ $ bb_fitness 10000 3 4 > bb_fitness_10000_3_4.txt
+
+uses the fitness model to create a random graph with <N=10000> nodes,
+where each new node creates <m=3> new edges and the initial seed
+network is a ring of <n0=5> nodes. The edge list of the resulting
+graph is saved in the file `bb_fitness_10000_3_4.txt` (notice the
+redirection operator `>`). The command:
+
+ $ bb_fitness 10000 3 4 SHOW > bb_fitness_10000_3_4.txt 2> bb_fitness_10000_3_4.txt_fitness
+
+will do the same as above, but it will additionally save the values of
+node fitness in the file `bb_fitness_10000_3_4.txt_fitness` (notice
+the redirection operator `2>`, that redirects the STDERR to the
+specified file).
+
+## SEE ALSO
+
+ba(1), dms(1)
+
+## REFERENCES
+
+* G\. Bianconi, A.-L. Barabasi, " Competition and multiscaling in
+ evolving networks". EPL-Europhys. Lett. 54 (2001), 436.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 6, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 13, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
+
diff --git a/doc/bbv.1 b/doc/bbv.1
new file mode 100644
index 0000000..d348e80
--- /dev/null
+++ b/doc/bbv.1
@@ -0,0 +1,89 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BBV" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBbbv\fR \- Grow a weighted scale\-free random graph
+.
+.SH "SYNOPSIS"
+\fBbbv\fR \fIN\fR \fIm\fR \fIn0\fR \fIw0\fR \fIdelta\fR
+.
+.SH "DESCRIPTION"
+\fBbbv\fR grows an undirected weighted random scale\-free graph with \fIN\fR nodes using the model proposed by Barrat, Barthelemy, and Vespignani\. The initial network is a clique of \fIn0\fR nodes, and each new node creates \fIm\fR new edges, each with weight \fIw0\fR\. The parameter \fIdelta\fR sets the amount of weight to be redistributed in the neighbourhood of newly\-connected nodes\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIN\fR
+Number of nodes of the final graph\.
+.
+.TP
+\fIm\fR
+Number of edges created by each new node\.
+.
+.TP
+\fIn0\fR
+Number of nodes in the initial (seed) graph\.
+.
+.TP
+\fIw0\fR
+Weight of each new edge (must be >=0)
+.
+.TP
+\fIdelta\fR
+The amount of weight to be redistributed among the neighbours of newly\-connected nodes\.
+.
+.SH "OUTPUT"
+\fBbbv\fR prints on STDOUT the edge list of the final graph, which consists of three columns:
+.
+.IP "" 4
+.
+.nf
+
+ node1 node2 weight
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBweight\fR is the weight of the corresponding edge\. Please note that each edge is printed only once\.
+.
+.SH "EXAMPLES"
+The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ bbv 10000 3 5 1\.0 0\.5 > bbv_10000_3_5_1\.0_0\.5\.txt
+.
+.fi
+.
+.IP "" 0
+.
+.P
+creates a weighted scale\-free graph with \fIN=10000\fR nodes, where each new node creates \fIm=3\fR new edges and the initial seed network is a ring of \fIn0=5\fR nodes\. Each new edge has an initial weight equal to \fIw0\fR\. The weights of existing edges are rearranged after the addition of a new edge, by rearranging an amount of weight equal to \fIdelta\fR\. The final graph is saved in the file \fBbbv_10000_3_5_1\.0_0\.5\.txt\fR (notice the STDOUT redirection operator \fB>\fR)\.
+.
+.SH "SEE ALSO"
+ba(1), bb_fitness(1), dms(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+A\. Barrat, M\. Barthelemy, and A\. Vespignani\. "Weighted Evolving Networks: Coupling Topology and Weight Dynamics"\. Phys\. Rev\. Lett\. 92 (2004), 228701\.
+.
+.IP "\(bu" 4
+A\. Barrat, M\. Barthelemy, and A\. Vespignani\. "Modeling the evolution of weighted networks"\. Phys\. Rev\. E 70 (2004), 066149\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 6, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 13, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/bbv.1.html b/doc/bbv.1.html
new file mode 100644
index 0000000..9fe7016
--- /dev/null
+++ b/doc/bbv.1.html
@@ -0,0 +1,169 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>bbv(1) - Grow a weighted scale-free random graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>bbv(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>bbv(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>bbv</code> - <span class="man-whatis">Grow a weighted scale-free random graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>bbv</code> <var>N</var> <var>m</var> <var>n0</var> <var>w0</var> <var>delta</var></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>bbv</code> grows an undirected weighted random scale-free graph with <var>N</var>
+nodes using the model proposed by Barrat, Barthelemy, and
+Vespignani. The initial network is a clique of <var>n0</var> nodes, and each
+new node creates <var>m</var> new edges, each with weight <var>w0</var>. The parameter
+<var>delta</var> sets the amount of weight to be redistributed in the
+neighbourhood of newly-connected nodes.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt class="flush"><var>N</var></dt><dd><p> Number of nodes of the final graph.</p></dd>
+<dt class="flush"><var>m</var></dt><dd><p> Number of edges created by each new node.</p></dd>
+<dt class="flush"><var>n0</var></dt><dd><p> Number of nodes in the initial (seed) graph.</p></dd>
+<dt class="flush"><var>w0</var></dt><dd><p> Weight of each new edge (must be >=0)</p></dd>
+<dt class="flush"><var>delta</var></dt><dd><p> The amount of weight to be redistributed among the neighbours of
+ newly-connected nodes.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>bbv</code> prints on STDOUT the edge list of the final graph, which
+consists of three columns:</p>
+
+<pre><code> node1 node2 weight
+</code></pre>
+
+<p>where <code>weight</code> is the weight of the corresponding edge. Please note
+that each edge is printed only once.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The following command:</p>
+
+<pre><code> $ bbv 10000 3 5 1.0 0.5 &gt; bbv_10000_3_5_1.0_0.5.txt
+</code></pre>
+
+<p>creates a weighted scale-free graph with <var>N=10000</var> nodes, where each
+new node creates <var>m=3</var> new edges and the initial seed network is a
+ring of <var>n0=5</var> nodes. Each new edge has an initial weight equal to
+<var>w0</var>. The weights of existing edges are rearranged after the addition
+of a new edge, by rearranging an amount of weight equal to <var>delta</var>.
+The final graph is saved in the file <code>bbv_10000_3_5_1.0_0.5.txt</code>
+(notice the STDOUT redirection operator <code>&gt;</code>).</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="ba.1.html">ba<span class="s">(1)</span></a>, <a class="man-ref" href="bb_fitness.1.html">bb_fitness<span class="s">(1)</span></a>, <a class="man-ref" href="dms.1.html">dms<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>A. Barrat, M. Barthelemy, and A. Vespignani. "Weighted Evolving
+Networks: Coupling Topology and Weight Dynamics".
+Phys. Rev. Lett. 92 (2004), 228701.</p></li>
+<li><p>A. Barrat, M. Barthelemy, and A. Vespignani. "Modeling the
+evolution of weighted networks". Phys. Rev. E 70 (2004), 066149.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 6, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 13, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>bbv(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/bbv.md b/doc/bbv.md
new file mode 100644
index 0000000..bceb2af
--- /dev/null
+++ b/doc/bbv.md
@@ -0,0 +1,85 @@
+bbv(1) -- Grow a weighted scale-free random graph
+======
+
+## SYNOPSIS
+
+`bbv` <N> <m> <n0> <w0> <delta>
+
+## DESCRIPTION
+
+`bbv` grows an undirected weighted random scale-free graph with <N>
+nodes using the model proposed by Barrat, Barthelemy, and
+Vespignani. The initial network is a clique of <n0> nodes, and each
+new node creates <m> new edges, each with weight <w0>. The parameter
+<delta> sets the amount of weight to be redistributed in the
+neighbourhood of newly-connected nodes.
+
+## PARAMETERS
+
+* <N>:
+ Number of nodes of the final graph.
+
+* <m>:
+ Number of edges created by each new node.
+
+* <n0>:
+ Number of nodes in the initial (seed) graph.
+
+* <w0>:
+ Weight of each new edge (must be >=0)
+
+* <delta>:
+ The amount of weight to be redistributed among the neighbours of
+ newly-connected nodes.
+
+## OUTPUT
+
+`bbv` prints on STDOUT the edge list of the final graph, which
+consists of three columns:
+
+ node1 node2 weight
+
+where `weight` is the weight of the corresponding edge. Please note
+that each edge is printed only once.
+
+## EXAMPLES
+
+The following command:
+
+ $ bbv 10000 3 5 1.0 0.5 > bbv_10000_3_5_1.0_0.5.txt
+
+creates a weighted scale-free graph with <N=10000> nodes, where each
+new node creates <m=3> new edges and the initial seed network is a
+ring of <n0=5> nodes. Each new edge has an initial weight equal to
+<w0>. The weights of existing edges are rearranged after the addition
+of a new edge, by rearranging an amount of weight equal to <delta>.
+The final graph is saved in the file `bbv_10000_3_5_1.0_0.5.txt`
+(notice the STDOUT redirection operator `>`).
+
+
+## SEE ALSO
+
+ba(1), bb_fitness(1), dms(1)
+
+## REFERENCES
+
+* A\. Barrat, M. Barthelemy, and A. Vespignani. "Weighted Evolving
+ Networks: Coupling Topology and Weight Dynamics".
+ Phys. Rev. Lett. 92 (2004), 228701.
+
+* A\. Barrat, M. Barthelemy, and A. Vespignani. "Modeling the
+ evolution of weighted networks". Phys. Rev. E 70 (2004), 066149.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 6, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 13, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
+
diff --git a/doc/bet_dependency.1 b/doc/bet_dependency.1
new file mode 100644
index 0000000..9d65834
--- /dev/null
+++ b/doc/bet_dependency.1
@@ -0,0 +1,81 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BET_DEPENDENCY" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBbet_dependency\fR \- Compute the betweenness dependency of nodes
+.
+.SH "SYNOPSIS"
+\fBbet_dependency\fR \fIgraph_in\fR [ \fInode_start\fR [\fInode_end\fR]]
+.
+.SH "DESCRIPTION"
+\fBbet_dependency\fR computes the betweenness dependency of all the nodes of an undirected graph provided as input\. The program implements the algorithm by U\. Brandes, and computes the betweenness dependency using all the shortest paths originating from the subset of the nodes of the graph whose labels are in the interval [\fInode_start\fR, \fInode_end\fR]\. If \fInode_end\fR is not given, the last label of the graph is assumed\. If \fInode_start\fR is not given, use the shortest paths originating from all the nodes of the graph\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+input graph (edge list) if equal to \fB\-\fR (dash), read the edge list from STDIN\.
+.
+.TP
+\fInode_start\fR
+The label of the first node in a sequence of nodes\.
+.
+.TP
+\fInode_end\fR
+The label of the last node in a sequence of nodes\.
+.
+.SH "OUTPUT"
+\fBbet_dependency\fR prints on the standard output (STDOUT) the betweenness dependency score of all the nodes, starting from the node with label 0, one per line\.
+.
+.SH "EXAMPLES"
+The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ bet_dependency er_1000_5000\.txt
+.
+.fi
+.
+.IP "" 0
+.
+.P
+computes the betweenness dependency of all the nodes of the graph \fBer_1000_5000\.txt\fR, using all the shortest paths, and prints the result on the standard output (STOUT)\.
+.
+.P
+The command:
+.
+.IP "" 4
+.
+.nf
+
+ $ bet_dependency er_1000_5000\.txt 100 200 >node_bet_dep
+.
+.fi
+.
+.IP "" 0
+.
+.P
+will compute the betweenness dependency of the nodes in the graph \fBer_1000_5000\.txt\fR, based only on the shortest paths originating from the nodes whose labels are in the range [100,200]\. The results will be saved in the file \fBnode_bet_dep\fR\.
+.
+.SH "SEE ALSO"
+betweenness(1), shortest(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+U\. Brandes\. "A Faster Algorithm for Betweenness Centrality"\. J\. Math\. Sociol\. 25 (2001), 163\-177\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 6, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 7, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/bet_dependency.1.html b/doc/bet_dependency.1.html
new file mode 100644
index 0000000..e23f9d6
--- /dev/null
+++ b/doc/bet_dependency.1.html
@@ -0,0 +1,167 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>bet_dependency(1) - Compute the betweenness dependency of nodes</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>bet_dependency(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>bet_dependency(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>bet_dependency</code> - <span class="man-whatis">Compute the betweenness dependency of nodes</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>bet_dependency</code> <var>graph_in</var> [ <var>node_start</var> [<var>node_end</var>]]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>bet_dependency</code> computes the betweenness dependency of all the nodes
+of an undirected graph provided as input. The program implements the
+algorithm by U. Brandes, and computes the betweenness dependency using
+all the shortest paths originating from the subset of the nodes of the
+graph whose labels are in the interval [<var>node_start</var>, <var>node_end</var>]. If
+<var>node_end</var> is not given, the last label of the graph is assumed. If
+<var>node_start</var> is not given, use the shortest paths originating from all
+the nodes of the graph.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> input graph (edge list) if equal to <code>-</code> (dash), read the edge list
+ from STDIN.</p></dd>
+<dt><var>node_start</var></dt><dd><p> The label of the first node in a sequence of nodes.</p></dd>
+<dt><var>node_end</var></dt><dd><p> The label of the last node in a sequence of nodes.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>bet_dependency</code> prints on the standard output (STDOUT) the
+betweenness dependency score of all the nodes, starting from the node
+with label 0, one per line.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The following command:</p>
+
+<pre><code> $ bet_dependency er_1000_5000.txt
+</code></pre>
+
+<p>computes the betweenness dependency of all the nodes of the graph
+<code>er_1000_5000.txt</code>, using all the shortest paths, and prints the
+result on the standard output (STOUT).</p>
+
+<p>The command:</p>
+
+<pre><code> $ bet_dependency er_1000_5000.txt 100 200 &gt;node_bet_dep
+</code></pre>
+
+<p>will compute the betweenness dependency of the nodes in the graph
+<code>er_1000_5000.txt</code>, based only on the shortest paths originating from
+the nodes whose labels are in the range [100,200]. The results will be
+saved in the file <code>node_bet_dep</code>.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="betweenness.1.html">betweenness<span class="s">(1)</span></a>, <a class="man-ref" href="shortest.1.html">shortest<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>U. Brandes. "A Faster Algorithm for Betweenness Centrality".
+J. Math. Sociol. 25 (2001), 163-177.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 6, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 7, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>bet_dependency(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/bet_dependency.md b/doc/bet_dependency.md
new file mode 100644
index 0000000..c471b9e
--- /dev/null
+++ b/doc/bet_dependency.md
@@ -0,0 +1,78 @@
+bet_dependency(1) -- Compute the betweenness dependency of nodes
+======
+
+## SYNOPSIS
+
+`bet_dependency` <graph_in> [ <node_start> [<node_end>]]
+
+
+## DESCRIPTION
+
+`bet_dependency` computes the betweenness dependency of all the nodes
+of an undirected graph provided as input. The program implements the
+algorithm by U. Brandes, and computes the betweenness dependency using
+all the shortest paths originating from the subset of the nodes of the
+graph whose labels are in the interval [<node_start>, <node_end>]. If
+<node_end> is not given, the last label of the graph is assumed. If
+<node_start> is not given, use the shortest paths originating from all
+the nodes of the graph.
+
+## PARAMETERS
+
+* <graph_in>:
+ input graph (edge list) if equal to `-` (dash), read the edge list
+ from STDIN.
+
+* <node_start>:
+ The label of the first node in a sequence of nodes.
+
+* <node_end>:
+ The label of the last node in a sequence of nodes.
+
+
+## OUTPUT
+
+`bet_dependency` prints on the standard output (STDOUT) the
+betweenness dependency score of all the nodes, starting from the node
+with label 0, one per line.
+
+
+## EXAMPLES
+
+The following command:
+
+ $ bet_dependency er_1000_5000.txt
+
+computes the betweenness dependency of all the nodes of the graph
+`er_1000_5000.txt`, using all the shortest paths, and prints the
+result on the standard output (STOUT).
+
+The command:
+
+ $ bet_dependency er_1000_5000.txt 100 200 >node_bet_dep
+
+will compute the betweenness dependency of the nodes in the graph
+`er_1000_5000.txt`, based only on the shortest paths originating from
+the nodes whose labels are in the range [100,200]. The results will be
+saved in the file `node_bet_dep`.
+
+## SEE ALSO
+
+betweenness(1), shortest(1)
+
+## REFERENCES
+* U\. Brandes. "A Faster Algorithm for Betweenness Centrality".
+ J\. Math. Sociol. 25 (2001), 163-177.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 6, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 7, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/betweenness.1 b/doc/betweenness.1
new file mode 100644
index 0000000..d16ef9e
--- /dev/null
+++ b/doc/betweenness.1
@@ -0,0 +1,114 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BETWEENNESS" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBbetweenness\fR \- Compute the betweenness centrality of nodes and edges
+.
+.SH "SYNOPSIS"
+\fBbetweenness\fR \fIgraph_in\fR [ SEQ \fInode_start\fR [\fInode_end\fR]]
+.
+.P
+\fBbetweenness\fR \fIgraph_in\fR [ RND \fInum\fR]
+.
+.SH "DESCRIPTION"
+\fBbetweenness\fR computes the betweenness centrality of all the nodes and edges of an undirected graph provided as input\. The program implements the algorithm by U\. Brandes, and computes the betweenness using all the shortest paths originating from a subset of the nodes of the graph, either in a sequence (if \fISEQ\fR is the second parameter) or sampled unirofmly at random (if \fIRND\fR is the second parameter)\. If \fIgraph_in\fR is the only parameter, \fBbetweenness\fR takes into account all the shortest paths\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+input graph (edge list) if equal to \fB\-\fR (dash), read the edge list from STDIN\.
+.
+.TP
+\fInode_start\fR
+The label of the first node in a sequence of nodes (when \fISEQ\fR is the second parameter)\.
+.
+.TP
+\fInode_end\fR
+The label of the last node in a sequence of nodes (when \fISEQ\fR is the second parameter)\.
+.
+.TP
+\fInum\fR
+The number of nodes to be considered (when \fIRND\fR is the second parameter)
+.
+.SH "OUTPUT"
+\fBbetweenness\fR prints on the standard output (STDOUT) the betweenness centrality of all the nodes, starting from the node with label 0, and on the standard error (STDERR) the betweenness centrality of all the edges, one edge per line, in the format:
+.
+.IP "" 4
+.
+.nf
+
+node1 node2 bet_score
+.
+.fi
+.
+.IP "" 0
+.
+.SH "EXAMPLES"
+The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ betweenness er_1000_5000\.txt >node_bet 2>edge_bet
+.
+.fi
+.
+.IP "" 0
+.
+.P
+computes the node and edge betweenness centrality of the graph \fBer_1000_5000\.txt\fR, using all the shortest paths\. Since we used the redirections \fB>node_bet\fR and \fB2>edge_bet\fR, the values of node and edge betweenness will be saved in the files \fBnode_bet\fR and \fBedge_bet\fR, respectively\.
+.
+.P
+The command:
+.
+.IP "" 4
+.
+.nf
+
+ $ betweenness er_1000_5000\.txt SEQ 100 200 2>edge_bet_100_200
+.
+.fi
+.
+.IP "" 0
+.
+.P
+will compute the betweenness of nodes and edges in the graph \fBer_1000_5000\.txt\fR, based only on the shortest paths originating from the nodes whose labels are in the range [100,200]\. The node betweenness will be printed on STDOUT, while the edge betweenness will be saved in the file \fBedge_bet_100_200\fR\.
+.
+.P
+Finally, the command:
+.
+.IP "" 4
+.
+.nf
+
+ $ betweenness er_1000_5000\.txt RND 250 >node_bet_RND
+.
+.fi
+.
+.IP "" 0
+.
+.P
+will compute the betweenness centrality based on the shortest paths originating from 250 nodes in the graph, sampled uniformly at random\. The node betweenness is saved in the file \fBnode_bet_RND\fR, while the values of edge betweenness are printed on STDOUT\.
+.
+.SH "SEE ALSO"
+bet_dependency(1), shortest(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+U\. Brandes\. "A Faster Algorithm for Betweenness Centrality"\. J\. Math\. Sociol\. 25 (2001), 163\-177\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 6, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 7, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/betweenness.1.html b/doc/betweenness.1.html
new file mode 100644
index 0000000..ab25a91
--- /dev/null
+++ b/doc/betweenness.1.html
@@ -0,0 +1,190 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>betweenness(1) - Compute the betweenness centrality of nodes and edges</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>betweenness(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>betweenness(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>betweenness</code> - <span class="man-whatis">Compute the betweenness centrality of nodes and edges</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>betweenness</code> <var>graph_in</var> [ SEQ <var>node_start</var> [<var>node_end</var>]]</p>
+
+<p><code>betweenness</code> <var>graph_in</var> [ RND <var>num</var>]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>betweenness</code> computes the betweenness centrality of all the nodes and
+edges of an undirected graph provided as input. The program implements
+the algorithm by U. Brandes, and computes the betweenness using all
+the shortest paths originating from a subset of the nodes of the
+graph, either in a sequence (if <em>SEQ</em> is the second parameter) or
+sampled unirofmly at random (if <em>RND</em> is the second parameter). If
+<var>graph_in</var> is the only parameter, <code>betweenness</code> takes into account all
+the shortest paths.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> input graph (edge list) if equal to <code>-</code> (dash), read the edge list
+ from STDIN.</p></dd>
+<dt><var>node_start</var></dt><dd><p> The label of the first node in a sequence of nodes (when <em>SEQ</em> is
+ the second parameter).</p></dd>
+<dt><var>node_end</var></dt><dd><p> The label of the last node in a sequence of nodes (when <em>SEQ</em> is
+ the second parameter).</p></dd>
+<dt class="flush"><var>num</var></dt><dd><p> The number of nodes to be considered (when <em>RND</em> is the second
+ parameter)</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>betweenness</code> prints on the standard output (STDOUT) the betweenness
+centrality of all the nodes, starting from the node with label 0, and
+on the standard error (STDERR) the betweenness centrality of all the
+edges, one edge per line, in the format:</p>
+
+<pre><code>node1 node2 bet_score
+</code></pre>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The following command:</p>
+
+<pre><code> $ betweenness er_1000_5000.txt &gt;node_bet 2&gt;edge_bet
+</code></pre>
+
+<p>computes the node and edge betweenness centrality of the graph
+<code>er_1000_5000.txt</code>, using all the shortest paths. Since we used the
+redirections <code>&gt;node_bet</code> and <code>2&gt;edge_bet</code>, the values of node and edge
+betweenness will be saved in the files <code>node_bet</code> and <code>edge_bet</code>,
+respectively.</p>
+
+<p>The command:</p>
+
+<pre><code> $ betweenness er_1000_5000.txt SEQ 100 200 2&gt;edge_bet_100_200
+</code></pre>
+
+<p>will compute the betweenness of nodes and edges in the graph
+<code>er_1000_5000.txt</code>, based only on the shortest paths originating from
+the nodes whose labels are in the range [100,200]. The node
+betweenness will be printed on STDOUT, while the edge betweenness will
+be saved in the file <code>edge_bet_100_200</code>.</p>
+
+<p>Finally, the command:</p>
+
+<pre><code> $ betweenness er_1000_5000.txt RND 250 &gt;node_bet_RND
+</code></pre>
+
+<p>will compute the betweenness centrality based on the shortest paths
+originating from 250 nodes in the graph, sampled uniformly at
+random. The node betweenness is saved in the file <code>node_bet_RND</code>,
+while the values of edge betweenness are printed on STDOUT.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="bet_dependency.1.html">bet_dependency<span class="s">(1)</span></a>, <a class="man-ref" href="shortest.1.html">shortest<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>U. Brandes. "A Faster Algorithm for Betweenness Centrality".
+J. Math. Sociol. 25 (2001), 163-177.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 6, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 7, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>betweenness(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/betweenness.md b/doc/betweenness.md
new file mode 100644
index 0000000..54d2805
--- /dev/null
+++ b/doc/betweenness.md
@@ -0,0 +1,99 @@
+betweenness(1) -- Compute the betweenness centrality of nodes and edges
+======
+
+## SYNOPSIS
+
+`betweenness` <graph_in> [ SEQ <node_start> [<node_end>]]
+
+`betweenness` <graph_in> [ RND <num>]
+
+## DESCRIPTION
+
+`betweenness` computes the betweenness centrality of all the nodes and
+edges of an undirected graph provided as input. The program implements
+the algorithm by U. Brandes, and computes the betweenness using all
+the shortest paths originating from a subset of the nodes of the
+graph, either in a sequence (if _SEQ_ is the second parameter) or
+sampled unirofmly at random (if _RND_ is the second parameter). If
+<graph_in> is the only parameter, `betweenness` takes into account all
+the shortest paths.
+
+## PARAMETERS
+
+* <graph_in>:
+ input graph (edge list) if equal to `-` (dash), read the edge list
+ from STDIN.
+
+* <node_start>:
+ The label of the first node in a sequence of nodes (when _SEQ_ is
+ the second parameter).
+
+* <node_end>:
+ The label of the last node in a sequence of nodes (when _SEQ_ is
+ the second parameter).
+
+* <num>:
+ The number of nodes to be considered (when _RND_ is the second
+ parameter)
+
+## OUTPUT
+
+`betweenness` prints on the standard output (STDOUT) the betweenness
+centrality of all the nodes, starting from the node with label 0, and
+on the standard error (STDERR) the betweenness centrality of all the
+edges, one edge per line, in the format:
+
+ node1 node2 bet_score
+
+
+## EXAMPLES
+
+The following command:
+
+ $ betweenness er_1000_5000.txt >node_bet 2>edge_bet
+
+computes the node and edge betweenness centrality of the graph
+`er_1000_5000.txt`, using all the shortest paths. Since we used the
+redirections `>node_bet` and `2>edge_bet`, the values of node and edge
+betweenness will be saved in the files `node_bet` and `edge_bet`,
+respectively.
+
+The command:
+
+ $ betweenness er_1000_5000.txt SEQ 100 200 2>edge_bet_100_200
+
+will compute the betweenness of nodes and edges in the graph
+`er_1000_5000.txt`, based only on the shortest paths originating from
+the nodes whose labels are in the range [100,200]. The node
+betweenness will be printed on STDOUT, while the edge betweenness will
+be saved in the file `edge_bet_100_200`.
+
+Finally, the command:
+
+ $ betweenness er_1000_5000.txt RND 250 >node_bet_RND
+
+will compute the betweenness centrality based on the shortest paths
+originating from 250 nodes in the graph, sampled uniformly at
+random. The node betweenness is saved in the file `node_bet_RND`,
+while the values of edge betweenness are printed on STDOUT.
+
+## SEE ALSO
+
+bet_dependency(1), shortest(1)
+
+## REFERENCES
+* U\. Brandes. "A Faster Algorithm for Betweenness Centrality".
+ J\. Math. Sociol. 25 (2001), 163-177.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 6, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 7, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/clust.1 b/doc/clust.1
new file mode 100644
index 0000000..de587cc
--- /dev/null
+++ b/doc/clust.1
@@ -0,0 +1,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\.
diff --git a/doc/clust.1.html b/doc/clust.1.html
new file mode 100644
index 0000000..63fd5e7
--- /dev/null
+++ b/doc/clust.1.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>clust(1) - Compute the graph and node clustering coefficients</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>clust(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>clust(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>clust</code> - <span class="man-whatis">Compute the graph and node clustering coefficients</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>clust</code> <var>graph_in</var> [SHOW]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>clust</code> computes the clustering coefficient of the undirected graph
+given as input in the file <var>graph_in</var>. If <code>SHOW</code> is provided as a
+second parameter, the program prints on STDERR the label, degree, and
+clustering coefficient of all the nodes in <var>graph_in</var>.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> undirected input graph (edge list). If is equal to <code>-</code> (dash), read
+ the edge list from STDIN.</p></dd>
+<dt class="flush">SHOW</dt><dd><p> If the second (optional) parameter is equal to <code>SHOW</code>, the program
+ will dump on the standard error the label, degree, and clustering
+ coefficient of each node in <var>graph_in</var>.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p>If only <var>graph_in</var> is specified, then the output is a single line,
+containing the clustering coefficient of the undirected graph provided
+as input. If <code>SHOW</code> is specified, the program will print on the
+standard output one line for each node, in the format:</p>
+
+<pre><code>node_1 k_1 c_1
+node_2 k_2 c_2
+node_3 k_3 c_3
+ ....
+</code></pre>
+
+<p>where <code>node_1</code> is the label of the node, <code>k_1</code> is its degree, and
+<code>c_1</code> is its node clustering coefficient.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The most simple way of using <code>clust</code> is to compute only the clustering
+coefficient of a graph. For instance:</p>
+
+<pre><code> $ clust er_1000_5000.txt
+ 0.01034196
+ $
+</code></pre>
+
+<p>will show on output the clustering coefficient of the graph
+<code>er_1000_5000.txt</code>. In order to obtain the clustering coefficient of
+all the nodes, we should use:</p>
+
+<pre><code> $ 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
+ $
+</code></pre>
+
+<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 <code>0</code> has degree equal to <code>10</code> and clustering coefficient
+equal to <code>0.0222222</code>. It is more convenient to save the values of node
+clustering coefficients in a file, e.g.:</p>
+
+<pre><code> $ clust er_1000_5000.txt SHOW 2&gt; er_1000_5000.txt_node_clust
+ 0.01034196
+ $
+</code></pre>
+
+<p>In this case, the program prints on output only the graph clustering
+coefficient <code>0.01034196</code>, while the node clustering coefficients are
+saved on the file <code>er_1000_5000.txt_node_clust</code> (notice the syntax <code>2&gt;
+er_1000_5000.txt_node_clust</code>, which redirects the STDERR to the file
+<code>er_1000_5000.txt_node_clust</code>).</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="clust_w.1.html">clust_w<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 4, Cambridge University Press
+(2017)</li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>clust(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/clust.md b/doc/clust.md
new file mode 100644
index 0000000..36cc6c4
--- /dev/null
+++ b/doc/clust.md
@@ -0,0 +1,105 @@
+clust(1) -- Compute the graph and node clustering coefficients
+======
+
+## SYNOPSIS
+
+`clust` <graph_in> [SHOW]
+
+## DESCRIPTION
+
+`clust` computes the clustering coefficient of the undirected graph
+given as input in the file <graph_in>. If `SHOW` is provided as a
+second parameter, the program prints on STDERR the label, degree, and
+clustering coefficient of all the nodes in <graph_in>.
+
+## PARAMETERS
+
+* <graph_in>:
+ undirected input graph (edge list). If is equal to `-` (dash), read
+ the edge list from STDIN.
+
+* SHOW:
+ If the second (optional) parameter is equal to `SHOW`, the program
+ will dump on the standard error the label, degree, and clustering
+ coefficient of each node in <graph_in>.
+
+## OUTPUT
+
+If only <graph_in> is specified, then the output is a single line,
+containing the clustering coefficient of the undirected graph provided
+as input. If `SHOW` is specified, the program will print on the
+standard output one line for each node, in the format:
+
+ node_1 k_1 c_1
+ node_2 k_2 c_2
+ node_3 k_3 c_3
+ ....
+
+where `node_1` is the label of the node, `k_1` is its degree, and
+`c_1` is its node clustering coefficient.
+
+## EXAMPLES
+
+The most simple way of using `clust` is to compute only the clustering
+coefficient of a graph. For instance:
+
+ $ clust er_1000_5000.txt
+ 0.01034196
+ $
+
+will show on output the clustering coefficient of the graph
+`er_1000_5000.txt`. In order to obtain the clustering coefficient of
+all the nodes, we should use:
+
+ $ 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
+ $
+
+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 `0` has degree equal to `10` and clustering coefficient
+equal to `0.0222222`. It is more convenient to save the values of node
+clustering coefficients in a file, e.g.:
+
+ $ clust er_1000_5000.txt SHOW 2> er_1000_5000.txt_node_clust
+ 0.01034196
+ $
+
+In this case, the program prints on output only the graph clustering
+coefficient `0.01034196`, while the node clustering coefficients are
+saved on the file `er_1000_5000.txt_node_clust` (notice the syntax `2>
+er_1000_5000.txt_node_clust`, which redirects the STDERR to the file
+`er_1000_5000.txt_node_clust`).
+
+## SEE ALSO
+
+clust_w(1)
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 4, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/clust_w.1 b/doc/clust_w.1
new file mode 100644
index 0000000..326fdc2
--- /dev/null
+++ b/doc/clust_w.1
@@ -0,0 +1,111 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "CLUST_W" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBclust_w\fR \- Compute the graph and node clustering of weighted graphs
+.
+.SH "SYNOPSIS"
+\fBclust_w\fR \fIgraph_in\fR [SHOW]
+.
+.SH "DESCRIPTION"
+\fBclust_w\fR computes the clustering coefficient of the undirected and weighted graph given as input in the file \fIgraph_in\fR\. The program uses the definition of weighted clustering proposed by Barrat, Barthelemy, Pastor\-Satorras ans Vespignani\. 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 and weighted input graph (edge list)\. If it 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 and weighted 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, the command:
+.
+.IP "" 4
+.
+.nf
+
+ $ clust_w US_airports\.net
+ 0\.01034196
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+computes the weighted clustering coefficient of the graph \fBUS_airports\.net\fR (the US air transportation network)\. In order to obtain the weighted clustering coefficient of all the nodes, we should use:
+.
+.IP "" 4
+.
+.nf
+
+ $ clust_w US_airports\.net SHOW
+ 0 145 0\.30493676524961
+ 1 136 0\.364315549333
+ 2 132 0\.3443612411812
+ 3 76 0\.52204673222936
+ \.\.\.\.
+ 497 2 1
+ 498 2 1
+ 499 1 0
+ 0\.65111741
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The last line printed on output is still the value of the weighted clustering coefficient of the graph, while the previous 500 lines (which are printed on STDERR) contain the label, degree, and weighted clustering coefficient of each node\. For instance, the first line indicates that node \fB0\fR has degree equal to \fB145\fR and clustering coefficient equal to \fB0\.30493676524961\fR\. It is more convenient to save the values of node clustering coefficients in a file, e\.g\.:
+.
+.IP "" 4
+.
+.nf
+
+ $ clust_w US_airports\.net SHOW 2> node_clust_w
+ 0\.65111741
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+In this case, the program prints on output only the weighted graph clustering coefficient \fB0\.65111741\fR, while the node clustering coefficients are saved on the file \fBnode_clust_w\fR (notice the syntax \fB2> node_clust_w\fR, which redirects the STDERR to the file \fBnode_clust_w\fR)\.
+.
+.SH "SEE ALSO"
+clust(1)
+.
+.SH "REFERENCES"
+.
+.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\.
diff --git a/doc/clust_w.1.html b/doc/clust_w.1.html
new file mode 100644
index 0000000..49eceb6
--- /dev/null
+++ b/doc/clust_w.1.html
@@ -0,0 +1,197 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>clust_w(1) - Compute the graph and node clustering of weighted graphs</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>clust_w(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>clust_w(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>clust_w</code> - <span class="man-whatis">Compute the graph and node clustering of weighted graphs</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>clust_w</code> <var>graph_in</var> [SHOW]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>clust_w</code> computes the clustering coefficient of the undirected and
+weighted graph given as input in the file <var>graph_in</var>. The program uses
+the definition of weighted clustering proposed by Barrat, Barthelemy,
+Pastor-Satorras ans Vespignani. If <code>SHOW</code> is provided as a second
+parameter, the program prints on STDERR the label, degree, and
+clustering coefficient of all the nodes in <var>graph_in</var>.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> undirected and weighted input graph (edge list). If it is equal to
+ <code>-</code> (dash), read the edge list from STDIN.</p></dd>
+<dt class="flush">SHOW</dt><dd><p> If the second (optional) parameter is equal to <code>SHOW</code>, the program
+ will dump on the standard error the label, degree, and clustering
+ coefficient of each node in <var>graph_in</var>.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p>If only <var>graph_in</var> is specified, then the output is a single line,
+containing the clustering coefficient of the undirected and weighted
+graph provided as input. If <code>SHOW</code> is specified, the program will
+print on the standard output one line for each node, in the format:</p>
+
+<pre><code>node_1 k_1 c_1
+node_2 k_2 c_2
+node_3 k_3 c_3
+ ....
+</code></pre>
+
+<p>where <code>node_1</code> is the label of the node, <code>k_1</code> is its degree, and
+<code>c_1</code> is its node clustering coefficient.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The most simple way of using <code>clust</code> is to compute only the clustering
+coefficient of a graph. For instance, the command:</p>
+
+<pre><code> $ clust_w US_airports.net
+ 0.01034196
+ $
+</code></pre>
+
+<p>computes the weighted clustering coefficient of the graph
+<code>US_airports.net</code> (the US air transportation network). In order to
+obtain the weighted clustering coefficient of all the nodes, we should
+use:</p>
+
+<pre><code> $ clust_w US_airports.net SHOW
+ 0 145 0.30493676524961
+ 1 136 0.364315549333
+ 2 132 0.3443612411812
+ 3 76 0.52204673222936
+ ....
+ 497 2 1
+ 498 2 1
+ 499 1 0
+ 0.65111741
+ $
+</code></pre>
+
+<p>The last line printed on output is still the value of the weighted
+clustering coefficient of the graph, while the previous 500 lines
+(which are printed on STDERR) contain the label, degree, and weighted
+clustering coefficient of each node. For instance, the first line
+indicates that node <code>0</code> has degree equal to <code>145</code> and clustering
+coefficient equal to <code>0.30493676524961</code>. It is more convenient to save
+the values of node clustering coefficients in a file, e.g.:</p>
+
+<pre><code> $ clust_w US_airports.net SHOW 2&gt; node_clust_w
+ 0.65111741
+ $
+</code></pre>
+
+<p>In this case, the program prints on output only the weighted graph
+clustering coefficient <code>0.65111741</code>, while the node clustering
+coefficients are saved on the file <code>node_clust_w</code> (notice the syntax
+<code>2&gt; node_clust_w</code>, which redirects the STDERR to the file
+<code>node_clust_w</code>).</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="clust.1.html">clust<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 10, Cambridge University Press
+(2017)</li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>clust_w(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/clust_w.md b/doc/clust_w.md
new file mode 100644
index 0000000..e28c368
--- /dev/null
+++ b/doc/clust_w.md
@@ -0,0 +1,100 @@
+clust_w(1) -- Compute the graph and node clustering of weighted graphs
+======
+
+## SYNOPSIS
+
+`clust_w` <graph_in> [SHOW]
+
+## DESCRIPTION
+
+`clust_w` computes the clustering coefficient of the undirected and
+weighted graph given as input in the file <graph_in>. The program uses
+the definition of weighted clustering proposed by Barrat, Barthelemy,
+Pastor-Satorras ans Vespignani. If `SHOW` is provided as a second
+parameter, the program prints on STDERR the label, degree, and
+clustering coefficient of all the nodes in <graph_in>.
+
+## PARAMETERS
+
+* <graph_in>:
+ undirected and weighted input graph (edge list). If it is equal to
+ `-` (dash), read the edge list from STDIN.
+
+* SHOW:
+ If the second (optional) parameter is equal to `SHOW`, the program
+ will dump on the standard error the label, degree, and clustering
+ coefficient of each node in <graph_in>.
+
+## OUTPUT
+
+If only <graph_in> is specified, then the output is a single line,
+containing the clustering coefficient of the undirected and weighted
+graph provided as input. If `SHOW` is specified, the program will
+print on the standard output one line for each node, in the format:
+
+ node_1 k_1 c_1
+ node_2 k_2 c_2
+ node_3 k_3 c_3
+ ....
+
+where `node_1` is the label of the node, `k_1` is its degree, and
+`c_1` is its node clustering coefficient.
+
+## EXAMPLES
+
+The most simple way of using `clust` is to compute only the clustering
+coefficient of a graph. For instance, the command:
+
+ $ clust_w US_airports.net
+ 0.01034196
+ $
+
+computes the weighted clustering coefficient of the graph
+`US_airports.net` (the US air transportation network). In order to
+obtain the weighted clustering coefficient of all the nodes, we should
+use:
+
+ $ clust_w US_airports.net SHOW
+ 0 145 0.30493676524961
+ 1 136 0.364315549333
+ 2 132 0.3443612411812
+ 3 76 0.52204673222936
+ ....
+ 497 2 1
+ 498 2 1
+ 499 1 0
+ 0.65111741
+ $
+
+The last line printed on output is still the value of the weighted
+clustering coefficient of the graph, while the previous 500 lines
+(which are printed on STDERR) contain the label, degree, and weighted
+clustering coefficient of each node. For instance, the first line
+indicates that node `0` has degree equal to `145` and clustering
+coefficient equal to `0.30493676524961`. It is more convenient to save
+the values of node clustering coefficients in a file, e.g.:
+
+ $ clust_w US_airports.net SHOW 2> node_clust_w
+ 0.65111741
+ $
+
+In this case, the program prints on output only the weighted graph
+clustering coefficient `0.65111741`, while the node clustering
+coefficients are saved on the file `node_clust_w` (notice the syntax
+`2> node_clust_w`, which redirects the STDERR to the file
+`node_clust_w`).
+
+## SEE ALSO
+
+clust(1)
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 10, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/cnm.1 b/doc/cnm.1
new file mode 100644
index 0000000..e97e8b4
--- /dev/null
+++ b/doc/cnm.1
@@ -0,0 +1,107 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "CNM" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBcnm\fR \- Find communities using greedy modularity optimisation
+.
+.SH "SYNOPSIS"
+\fBcnm\fR \fIgraph_in\fR
+.
+.SH "DESCRIPTION"
+\fBcnm\fR finds the communities in \fIgraph_in\fR using the greedy modularity optimisation algorithm proposed by Clauset, Newman and Moore\. The program prints on STDOUT the partition corresponding to the highest value of the modularity function, and reports on STDERR the number of communities and the corresponding value of modularity at each step\. The algorithm is quite eficient and thus suitable to find communities in large graphs\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+undirected input graph (edge list)\. If is equal to \fB\-\fR (dash), read the edge list from STDIN\.
+.
+.SH "OUTPUT"
+The program prints on STDOUT the partition corresponding to the highest value of modularity, in the format:
+.
+.IP "" 4
+.
+.nf
+
+ ## nc: NUM_COMM Q_max: Q_MAX
+ node_1 comm_1
+ node_2 comm_2
+ node_3 comm_3
+ \.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBcomm_i\fR is the community to which \fBnode_i\fR belongs\. The first output line reports the number of communities \fBNUM_COMM\fR and the corresponding value of modularity \fBQ_MAX\fR of the partition\.
+.
+.P
+The program prints on STDERR the number of communities and the corresponding value of modularity at each step, in the format:
+.
+.IP "" 4
+.
+.nf
+
+ nc_1 Q_1
+ nc_2 Q_2
+ nc_3 Q_3
+ \.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBnc_i\fR is the number of communities after the i\-th marge and \fBQ_i\fR is the corresponding value of modularity\. Since the algorithm merges two communities at each step, the values \fBnc_1\fR, \fBnc_2\fR, \fBnc_3\fR, etc\. will be equal to \fBN\-1\fR, \fBN\-2\fR, \fBN\-3\fR, etc\.
+.
+.SH "EXAMPLES"
+We can use \fBcnm\fR to find communities in the graph \fBkarate_club_unweighted\.net\fR (Zachary Karate Club network) with the command:
+.
+.IP "" 4
+.
+.nf
+
+ $ cnm karate_club_unweighted\.net 2> karate_cnm_trace
+ ### nc: 3 Q_max: 0\.380671
+ 0 16
+ 1 2
+ 2 2
+ 3 2
+ 4 16
+ 5 16
+ 6 16
+ \.\.\.
+ 30 26
+ 31 26
+ 32 26
+ 33 26
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The program has found a partition with 3 communities corrisponding to a modularity Q=0\.380671\. Notice that node 0, 4, 5, 6 are in community 16, node 1, 2, 3 are in community 2, and so forth\. In this example, we have chosen to save the information about number of communities and modularity at each step in the file \fBkarate_cnm_trace\fR\.
+.
+.SH "SEE ALSO"
+modularity(1), gn(1), label_prop(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+A\. Clauset, M\. E\. J\. Newman, and C\. Moore\. "Finding community structure in very large networks"\. Phys\. Rev\. E 70 (2004), 066111\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 18, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 9, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/cnm.1.html b/doc/cnm.1.html
new file mode 100644
index 0000000..f8aab58
--- /dev/null
+++ b/doc/cnm.1.html
@@ -0,0 +1,196 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>cnm(1) - Find communities using greedy modularity optimisation</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>cnm(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>cnm(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>cnm</code> - <span class="man-whatis">Find communities using greedy modularity optimisation</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>cnm</code> <var>graph_in</var></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>cnm</code> finds the communities in <var>graph_in</var> using the greedy modularity
+optimisation algorithm proposed by Clauset, Newman and Moore. The
+program prints on STDOUT the partition corresponding to the highest
+value of the modularity function, and reports on STDERR the number of
+communities and the corresponding value of modularity at each
+step. The algorithm is quite eficient and thus suitable to find
+communities in large graphs.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd> undirected input graph (edge list). If is equal to <code>-</code> (dash), read
+ the edge list from STDIN.</dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p>The program prints on STDOUT the partition corresponding to the
+highest value of modularity, in the format:</p>
+
+<pre><code> ## nc: NUM_COMM Q_max: Q_MAX
+ node_1 comm_1
+ node_2 comm_2
+ node_3 comm_3
+ ...
+</code></pre>
+
+<p>where <code>comm_i</code> is the community to which <code>node_i</code> belongs. The first
+output line reports the number of communities <code>NUM_COMM</code> and the
+corresponding value of modularity <code>Q_MAX</code> of the partition.</p>
+
+<p>The program prints on STDERR the number of communities and the
+corresponding value of modularity at each step, in the format:</p>
+
+<pre><code> nc_1 Q_1
+ nc_2 Q_2
+ nc_3 Q_3
+ ....
+</code></pre>
+
+<p>where <code>nc_i</code> is the number of communities after the i-th marge and
+<code>Q_i</code> is the corresponding value of modularity. Since the algorithm
+merges two communities at each step, the values <code>nc_1</code>, <code>nc_2</code>,
+<code>nc_3</code>, etc. will be equal to <code>N-1</code>, <code>N-2</code>, <code>N-3</code>, etc.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>We can use <code>cnm</code> to find communities in the graph
+<code>karate_club_unweighted.net</code> (Zachary Karate Club network) with the
+command:</p>
+
+<pre><code> $ cnm karate_club_unweighted.net 2&gt; karate_cnm_trace
+ ### nc: 3 Q_max: 0.380671
+ 0 16
+ 1 2
+ 2 2
+ 3 2
+ 4 16
+ 5 16
+ 6 16
+ ...
+ 30 26
+ 31 26
+ 32 26
+ 33 26
+ $
+</code></pre>
+
+<p>The program has found a partition with 3 communities corrisponding to
+a modularity Q=0.380671. Notice that node 0, 4, 5, 6 are in community
+16, node 1, 2, 3 are in community 2, and so forth. In this example,
+we have chosen to save the information about number of communities and
+modularity at each step in the file <code>karate_cnm_trace</code>.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="modularity.1.html">modularity<span class="s">(1)</span></a>, <a class="man-ref" href="gn.1.html">gn<span class="s">(1)</span></a>, <a class="man-ref" href="label_prop.1.html">label_prop<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>A. Clauset, M. E. J. Newman, and C. Moore. "Finding community
+structure in very large networks". Phys. Rev. E 70 (2004), 066111.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 18, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 9, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>cnm(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/cnm.md b/doc/cnm.md
new file mode 100644
index 0000000..290c764
--- /dev/null
+++ b/doc/cnm.md
@@ -0,0 +1,99 @@
+cnm(1) -- Find communities using greedy modularity optimisation
+======
+
+## SYNOPSIS
+
+`cnm` <graph_in>
+
+## DESCRIPTION
+
+`cnm` finds the communities in <graph_in> using the greedy modularity
+optimisation algorithm proposed by Clauset, Newman and Moore. The
+program prints on STDOUT the partition corresponding to the highest
+value of the modularity function, and reports on STDERR the number of
+communities and the corresponding value of modularity at each
+step. The algorithm is quite eficient and thus suitable to find
+communities in large graphs.
+
+## PARAMETERS
+
+* <graph_in>:
+ undirected input graph (edge list). If is equal to `-` (dash), read
+ the edge list from STDIN.
+
+## OUTPUT
+
+The program prints on STDOUT the partition corresponding to the
+highest value of modularity, in the format:
+
+ ## nc: NUM_COMM Q_max: Q_MAX
+ node_1 comm_1
+ node_2 comm_2
+ node_3 comm_3
+ ...
+
+where `comm_i` is the community to which `node_i` belongs. The first
+output line reports the number of communities `NUM_COMM` and the
+corresponding value of modularity `Q_MAX` of the partition.
+
+The program prints on STDERR the number of communities and the
+corresponding value of modularity at each step, in the format:
+
+ nc_1 Q_1
+ nc_2 Q_2
+ nc_3 Q_3
+ ....
+
+where `nc_i` is the number of communities after the i-th marge and
+`Q_i` is the corresponding value of modularity. Since the algorithm
+merges two communities at each step, the values `nc_1`, `nc_2`,
+`nc_3`, etc. will be equal to `N-1`, `N-2`, `N-3`, etc.
+
+## EXAMPLES
+
+We can use `cnm` to find communities in the graph
+`karate_club_unweighted.net` (Zachary Karate Club network) with the
+command:
+
+ $ cnm karate_club_unweighted.net 2> karate_cnm_trace
+ ### nc: 3 Q_max: 0.380671
+ 0 16
+ 1 2
+ 2 2
+ 3 2
+ 4 16
+ 5 16
+ 6 16
+ ...
+ 30 26
+ 31 26
+ 32 26
+ 33 26
+ $
+
+The program has found a partition with 3 communities corrisponding to
+a modularity Q=0.380671. Notice that node 0, 4, 5, 6 are in community
+16, node 1, 2, 3 are in community 2, and so forth. In this example,
+we have chosen to save the information about number of communities and
+modularity at each step in the file `karate_cnm_trace`.
+
+## SEE ALSO
+
+modularity(1), gn(1), label_prop(1)
+
+## REFERENCES
+
+* A\. Clauset, M. E. J. Newman, and C. Moore. "Finding community
+ structure in very large networks". Phys. Rev. E 70 (2004), 066111.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 18, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 9, Cambridge University Press
+ (2017)
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/components.1 b/doc/components.1
new file mode 100644
index 0000000..e137a8d
--- /dev/null
+++ b/doc/components.1
@@ -0,0 +1,161 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "COMPONENTS" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBcomponents\fR \- Find the connected components of a graph
+.
+.SH "SYNOPSIS"
+\fBcomponents\fR \fIgraph_in\fR [SHOW]
+.
+.SH "DESCRIPTION"
+\fBcomponents\fR finds the connected components of the undirected graph given as input using the Depth\-First Search algorithm, and prints the size of each of them\. If the optional second parameter \fBSHOW\fR is provided, the program dumps on output also the list of nodes belonging to each component\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+input graph (edge list) if equal to \fB\-\fR (dash), read the edge list from STDIN\.
+.
+.TP
+SHOW
+If the (optional) second parameter is equal to \fBSHOW\fR, the program will dump on output the list of all the nodes belonging to each connected component\.
+.
+.SH "OUTPUT"
+\fBcomponents\fR prints on the standard output the size of all the connected components of the undirected graph given as input, one per line:
+.
+.IP "" 4
+.
+.nf
+
+size_1
+size_2
+size_3
+\.\.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBsize_1\fR is the size of the first component, \fBsize_2\fR is the size of the second component, and so on\. Notice that the sizes are not sorted\. If \fBSHOW\fR is given, the program shows the list of nodes belonging to each component, in the format:
+.
+.IP "" 4
+.
+.nf
+
+size_1: node_1 node_2 node_3 \.\.\.
+size_2: node_1 node_2 node_3 \.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.SH "EXAMPLES"
+The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ components er_1000_5000\.txt
+ 1000
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+shows on output the size of the only connected component of the graph \fBer_1000_5000\.txt\fR\. In this case the graph has only one connected component (it is a super\-critical Erdos\-Renyi random graph with 1000 nodes and 5000 edges)\. A more interesting example can be obtained using the graph \fBer_1000_2000\.txt\fR:
+.
+.IP "" 4
+.
+.nf
+
+ $ components er_1000_2000\.txt
+ 985
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+In this case, the graph has 16 connected components: one of those components contains 985 nodes, while the other 15 components consist of isolated nodes\. If we want to know who are the nodes belonging to each connected component, we run:
+.
+.IP "" 4
+.
+.nf
+
+ $ components er_1000_2000\.txt SHOW
+ 985: 0 1 2 3 4 5 6 7 8 9 10 11 12\.\.\.\.\.
+ \.\.\.
+ 1: 63
+ 1: 75
+ 1: 218
+ 1: 222
+ 1: 368
+ 1: 398
+ 1: 441
+ 1: 566
+ 1: 572
+ 1: 663
+ 1: 715
+ 1: 756
+ 1: 863
+ 1: 883
+ 1: 917
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+If we run:
+.
+.IP "" 4
+.
+.nf
+
+ $ components er_1000_2000\.txt SHOW > er_1000_2000\.txt_components
+.
+.fi
+.
+.IP "" 0
+.
+.P
+the result of \fBcomponents\fR will be saved in the file \fBer_1000_2000\.txt_components\fR\.
+.
+.SH "SEE ALSO"
+strong_conn(1), node_components(1), largest_component(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 3, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 8, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/components.1.html b/doc/components.1.html
new file mode 100644
index 0000000..72db2f8
--- /dev/null
+++ b/doc/components.1.html
@@ -0,0 +1,226 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>components(1) - Find the connected components of a graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>components(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>components(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>components</code> - <span class="man-whatis">Find the connected components of a graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>components</code> <var>graph_in</var> [SHOW]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>components</code> finds the connected components of the undirected graph
+given as input using the Depth-First Search algorithm, and prints the
+size of each of them. If the optional second parameter <code>SHOW</code> is
+provided, the program dumps on output also the list of nodes belonging
+to each component.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> input graph (edge list) if equal to <code>-</code> (dash), read the edge list
+ from STDIN.</p></dd>
+<dt class="flush">SHOW</dt><dd><p> If the (optional) second parameter is equal to <code>SHOW</code>, the program
+ will dump on output the list of all the nodes belonging to each
+ connected component.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>components</code> prints on the standard output the size of all the
+connected components of the undirected graph given as input, one per
+line:</p>
+
+<pre><code>size_1
+size_2
+size_3
+.....
+</code></pre>
+
+<p>where <code>size_1</code> is the size of the first component, <code>size_2</code> is the
+size of the second component, and so on. Notice that the sizes are not
+sorted. If <code>SHOW</code> is given, the program shows the list of nodes
+belonging to each component, in the format:</p>
+
+<pre><code>size_1: node_1 node_2 node_3 ...
+size_2: node_1 node_2 node_3 ...
+</code></pre>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The following command:</p>
+
+<pre><code> $ components er_1000_5000.txt
+ 1000
+ $
+</code></pre>
+
+<p>shows on output the size of the only connected component of the graph
+<code>er_1000_5000.txt</code>. In this case the graph has only one connected
+component (it is a super-critical Erdos-Renyi random graph with 1000
+nodes and 5000 edges). A more interesting example can be obtained
+using the graph <code>er_1000_2000.txt</code>:</p>
+
+<pre><code> $ components er_1000_2000.txt
+ 985
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ $
+</code></pre>
+
+<p>In this case, the graph has 16 connected components: one of those
+components contains 985 nodes, while the other 15 components consist
+of isolated nodes. If we want to know who are the nodes belonging to
+each connected component, we run:</p>
+
+<pre><code> $ components er_1000_2000.txt SHOW
+ 985: 0 1 2 3 4 5 6 7 8 9 10 11 12.....
+ ...
+ 1: 63
+ 1: 75
+ 1: 218
+ 1: 222
+ 1: 368
+ 1: 398
+ 1: 441
+ 1: 566
+ 1: 572
+ 1: 663
+ 1: 715
+ 1: 756
+ 1: 863
+ 1: 883
+ 1: 917
+ $
+</code></pre>
+
+<p>If we run:</p>
+
+<pre><code> $ components er_1000_2000.txt SHOW &gt; er_1000_2000.txt_components
+</code></pre>
+
+<p>the result of <code>components</code> will be saved in the file
+<code>er_1000_2000.txt_components</code>.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="strong_conn.1.html">strong_conn<span class="s">(1)</span></a>, <a class="man-ref" href="node_components.1.html">node_components<span class="s">(1)</span></a>, <a class="man-ref" href="largest_component.1.html">largest_component<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 3, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 8, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>components(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/components.md b/doc/components.md
new file mode 100644
index 0000000..24e4f8b
--- /dev/null
+++ b/doc/components.md
@@ -0,0 +1,130 @@
+components(1) -- Find the connected components of a graph
+======
+
+## SYNOPSIS
+
+`components` <graph_in> [SHOW]
+
+## DESCRIPTION
+
+`components` finds the connected components of the undirected graph
+given as input using the Depth-First Search algorithm, and prints the
+size of each of them. If the optional second parameter `SHOW` is
+provided, the program dumps on output also the list of nodes belonging
+to each component.
+
+## PARAMETERS
+
+* <graph_in>:
+ input graph (edge list) if equal to `-` (dash), read the edge list
+ from STDIN.
+
+
+* SHOW:
+ If the (optional) second parameter is equal to `SHOW`, the program
+ will dump on output the list of all the nodes belonging to each
+ connected component.
+
+## OUTPUT
+
+`components` prints on the standard output the size of all the
+connected components of the undirected graph given as input, one per
+line:
+
+ size_1
+ size_2
+ size_3
+ .....
+
+where `size_1` is the size of the first component, `size_2` is the
+size of the second component, and so on. Notice that the sizes are not
+sorted. If `SHOW` is given, the program shows the list of nodes
+belonging to each component, in the format:
+
+ size_1: node_1 node_2 node_3 ...
+ size_2: node_1 node_2 node_3 ...
+
+## EXAMPLES
+
+The following command:
+
+ $ components er_1000_5000.txt
+ 1000
+ $
+
+shows on output the size of the only connected component of the graph
+`er_1000_5000.txt`. In this case the graph has only one connected
+component (it is a super-critical Erdos-Renyi random graph with 1000
+nodes and 5000 edges). A more interesting example can be obtained
+using the graph `er_1000_2000.txt`:
+
+ $ components er_1000_2000.txt
+ 985
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ $
+
+In this case, the graph has 16 connected components: one of those
+components contains 985 nodes, while the other 15 components consist
+of isolated nodes. If we want to know who are the nodes belonging to
+each connected component, we run:
+
+ $ components er_1000_2000.txt SHOW
+ 985: 0 1 2 3 4 5 6 7 8 9 10 11 12.....
+ ...
+ 1: 63
+ 1: 75
+ 1: 218
+ 1: 222
+ 1: 368
+ 1: 398
+ 1: 441
+ 1: 566
+ 1: 572
+ 1: 663
+ 1: 715
+ 1: 756
+ 1: 863
+ 1: 883
+ 1: 917
+ $
+
+If we run:
+
+ $ components er_1000_2000.txt SHOW > er_1000_2000.txt_components
+
+the result of `components` will be saved in the file
+`er_1000_2000.txt_components`.
+
+## SEE ALSO
+
+strong_conn(1), node_components(1), largest_component(1)
+
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 3, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 8, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/conf_model_deg.1 b/doc/conf_model_deg.1
new file mode 100644
index 0000000..3a07489
--- /dev/null
+++ b/doc/conf_model_deg.1
@@ -0,0 +1,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) \fIpower_law\.1\.html\fR\. 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\.
diff --git a/doc/conf_model_deg.1.html b/doc/conf_model_deg.1.html
new file mode 100644
index 0000000..c70ebdf
--- /dev/null
+++ b/doc/conf_model_deg.1.html
@@ -0,0 +1,190 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>conf_model_deg(1) - Sample a simple graph from the configuration model</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>conf_model_deg(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>conf_model_deg(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>conf_model_deg</code> - <span class="man-whatis">Sample a simple graph from the configuration model</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>conf_model_deg</code> <var>degs</var> [<var>threshold</var>]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>conf_model_deg</code> 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
+<var>degs</var>.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt class="flush"><var>degs</var></dt><dd><p> The name of the file containing the degree sequence. If <var>degs</var> is
+ equal to '-' (dash) the degree sequence is read from STDIN
+ (standard input).</p></dd>
+<dt><var>threshold</var>:</dt><dd><p></p>
+
+<p> Optional number of edge stubs that are allowed to remain
+ unmatched. This is useful to create graphs from too-constrained
+ degree sequences (see <a href="#EXAMPLES" title="EXAMPLES" data-bare-link="true">EXAMPLES</a> below).</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>conf_model_deg</code> prints on output the edge list of the sampled graph,
+and reports on STDERR whether it has been able to find a graph.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>Let us assume that the file <code>pl_-3.0_3_500_10000</code> contains a power-law
+degree sequence ('gamma=-3.0', 'k_min=3', 'k_max=500', 'N=10000'), for
+instance created using <a href="power_law.1.html">power_law(1)</a>. We can sample a
+simple configuration model graph having that degree sequence using:</p>
+
+<pre><code> $ conf_model_deg pl_-3.0_3_500_10000 &gt; conf_model_-3.0_3_500_10000.net
+</code></pre>
+
+<p>where we have redirected the output (the resulting edge list) to the
+file <code>conf_model_-3.0_3_500_10000.net</code>. 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>
+
+<p>Let us assume now that the file <code>AS-20010316.net_degs</code> contains the
+degree sequence of the data set <code>AS-20010316.net</code> (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 <a href="#REFERENCES" title="REFERENCES" data-bare-link="true">REFERENCES</a> below). So if we don't
+specify a threshold, we get:</p>
+
+<pre><code> $ conf_model_deg AS-20010316.net_degs &gt; AS_20010316_rand.net
+ Graph not found (unmatched stubs: 986 &gt; threshold: 0)
+ Graph not found (unmatched stubs: 888 &gt; threshold: 0)
+ Graph not found (unmatched stubs: 974 &gt; threshold: 0)
+ .....
+</code></pre>
+
+<p>and so on, since <code>conf_model_deg</code> is trying to match all the edge
+stubs, without success. From the messages printed by <code>conf_model_deg</code>
+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):</p>
+
+<pre><code> $ conf_model_deg AS-20010316.net_degs 950 &gt; AS_20010316_rand.net
+ Graph not found (unmatched stubs: 978 &gt; threshold: 950)
+ Found a graph (unmatched stubs: 876 &lt;= threshold: 950)
+ $
+</code></pre>
+
+<p><code>conf_model_deg</code> 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.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="deg_seq.1.html">deg_seq<span class="s">(1)</span></a>, <a class="man-ref" href="conf_model_deg_nocheck.1.html">conf_model_deg_nocheck<span class="s">(1)</span></a>, <a class="man-ref" href="power_law.1.html">power_law<span class="s">(1)</span></a>, <a class="man-ref" href="hv_net.1.html">hv_net<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 5, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 12, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>conf_model_deg(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/conf_model_deg.md b/doc/conf_model_deg.md
new file mode 100644
index 0000000..9022646
--- /dev/null
+++ b/doc/conf_model_deg.md
@@ -0,0 +1,97 @@
+conf_model_deg(1) -- Sample a simple graph from the configuration model
+======
+
+## SYNOPSIS
+
+`conf_model_deg` <degs> [<threshold>]
+
+## DESCRIPTION
+
+`conf_model_deg` 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
+<degs>.
+
+## PARAMETERS
+
+* <degs>:
+ The name of the file containing the degree sequence. If <degs> is
+ equal to '-' (dash) the degree sequence is read from STDIN
+ (standard input).
+
+* <threshold>:
+
+ Optional number of edge stubs that are allowed to remain
+ unmatched. This is useful to create graphs from too-constrained
+ degree sequences (see [EXAMPLES][] below).
+
+
+## OUTPUT
+
+`conf_model_deg` prints on output the edge list of the sampled graph,
+and reports on STDERR whether it has been able to find a graph.
+
+
+## EXAMPLES
+
+Let us assume that the file `pl_-3.0_3_500_10000` 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:
+
+ $ conf_model_deg pl_-3.0_3_500_10000 > conf_model_-3.0_3_500_10000.net
+
+where we have redirected the output (the resulting edge list) to the
+file `conf_model_-3.0_3_500_10000.net`. 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.
+
+Let us assume now that the file `AS-20010316.net_degs` contains the
+degree sequence of the data set `AS-20010316.net` (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 [REFERENCES][] below). So if we don't
+specify a threshold, we get:
+
+ $ 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)
+ .....
+
+and so on, since `conf_model_deg` is trying to match all the edge
+stubs, without success. From the messages printed by `conf_model_deg`
+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):
+
+ $ 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)
+ $
+
+`conf_model_deg` 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.
+
+## SEE ALSO
+
+deg_seq(1), conf_model_deg_nocheck(1), power_law(1), hv_net(1)
+
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 5, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 12, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/conf_model_deg_nocheck.1 b/doc/conf_model_deg_nocheck.1
new file mode 100644
index 0000000..d5257dc
--- /dev/null
+++ b/doc/conf_model_deg_nocheck.1
@@ -0,0 +1,52 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "CONF_MODEL_DEG_NOCHECK" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBconf_model_deg_nocheck\fR \- Sample a multigraph from the configuration model
+.
+.SH "SYNOPSIS"
+\fBconf_model_deg_nocheck\fR \fIdegs\fR
+.
+.SH "DESCRIPTION"
+\fBconf_model_deg_nocheck\fR samples an undirected multigraph (i\.e\., a graph that might contain self\-loops 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)\.
+.
+.SH "OUTPUT"
+\fBconf_model_deg_nocheck\fR prints on output the edge list of the sampled graph\.
+.
+.SH "EXAMPLES"
+Let us assume 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)\. However, since \fBconf_model_deg_nocheck\fR allows for self\-loops and multiple edges, it always finds a multigraph:
+.
+.IP "" 4
+.
+.nf
+
+ $ conf_model_deg_nocheck AS\-20010316\.net_degs > AS_20010316_rand\.net
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.SH "SEE ALSO"
+conf_model_deg(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\.
diff --git a/doc/conf_model_deg_nocheck.1.html b/doc/conf_model_deg_nocheck.1.html
new file mode 100644
index 0000000..5768cdb
--- /dev/null
+++ b/doc/conf_model_deg_nocheck.1.html
@@ -0,0 +1,152 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>conf_model_deg_nocheck(1) - Sample a multigraph from the configuration model</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>conf_model_deg_nocheck(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>conf_model_deg_nocheck(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>conf_model_deg_nocheck</code> - <span class="man-whatis">Sample a multigraph from the configuration model</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>conf_model_deg_nocheck</code> <var>degs</var></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>conf_model_deg_nocheck</code> samples an undirected multigraph (i.e., a
+graph that might contain self-loops multiple edges) from the
+configuration model associated to the degree sequence provided in the
+input file <var>degs</var>.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt class="flush"><var>degs</var></dt><dd> The name of the file containing the degree sequence. If <var>degs</var> is
+ equal to '-' (dash) the degree sequence is read from STDIN
+ (standard input).</dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>conf_model_deg_nocheck</code> prints on output the edge list of the sampled
+graph.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>Let us assume that the file <code>AS-20010316.net_degs</code> contains the degree
+sequence of the data set <code>AS-20010316.net</code> (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 <a href="#REFERENCES" title="REFERENCES" data-bare-link="true">REFERENCES</a> below). However, since
+<code>conf_model_deg_nocheck</code> allows for self-loops and multiple edges, it
+always finds a multigraph:</p>
+
+<pre><code> $ conf_model_deg_nocheck AS-20010316.net_degs &gt; AS_20010316_rand.net
+ $
+</code></pre>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="conf_model_deg.1.html">conf_model_deg<span class="s">(1)</span></a>, <a class="man-ref" href="power_law.1.html">power_law<span class="s">(1)</span></a>, <a class="man-ref" href="hv_net.1.html">hv_net<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 5, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 12, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>conf_model_deg_nocheck(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/conf_model_deg_nocheck.md b/doc/conf_model_deg_nocheck.md
new file mode 100644
index 0000000..e4131d9
--- /dev/null
+++ b/doc/conf_model_deg_nocheck.md
@@ -0,0 +1,58 @@
+conf_model_deg_nocheck(1) -- Sample a multigraph from the configuration model
+======
+
+## SYNOPSIS
+
+`conf_model_deg_nocheck` <degs>
+
+## DESCRIPTION
+
+`conf_model_deg_nocheck` samples an undirected multigraph (i.e., a
+graph that might contain self-loops multiple edges) from the
+configuration model associated to the degree sequence provided in the
+input file <degs>.
+
+## PARAMETERS
+
+* <degs>:
+ The name of the file containing the degree sequence. If <degs> is
+ equal to '-' (dash) the degree sequence is read from STDIN
+ (standard input).
+
+## OUTPUT
+
+`conf_model_deg_nocheck` prints on output the edge list of the sampled
+graph.
+
+
+## EXAMPLES
+
+Let us assume that the file `AS-20010316.net_degs` contains the degree
+sequence of the data set `AS-20010316.net` (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 [REFERENCES][] below). However, since
+`conf_model_deg_nocheck` allows for self-loops and multiple edges, it
+always finds a multigraph:
+
+ $ conf_model_deg_nocheck AS-20010316.net_degs > AS_20010316_rand.net
+ $
+
+## SEE ALSO
+
+conf_model_deg(1), power_law(1), hv_net(1)
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 5, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 12, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/deg_seq.1 b/doc/deg_seq.1
new file mode 100644
index 0000000..13536f8
--- /dev/null
+++ b/doc/deg_seq.1
@@ -0,0 +1,51 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "DEG_SEQ" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBdeg_seq\fR \- Compute the degree sequence of a graph
+.
+.SH "SYNOPSIS"
+\fBdeg_seq\fR \fIgraph_in\fR
+.
+.SH "DESCRIPTION"
+\fBdeg_seq\fR computes the degree sequence of \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\.
+.
+.SH "OUTPUT"
+The program prints on STDOUT the degree sequence of \fIgraph_in\fR in the format:
+.
+.IP "" 4
+.
+.nf
+
+ k_1
+ k_2
+ k_3
+ \.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBk_i\fR is the degree of the i\-th node\.
+.
+.SH "SEE ALSO"
+deg_seq_w(1), conf_model_deg(1), fitmle(1), power_law(1)
+.
+.SH "REFERENCES"
+.
+.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\.
diff --git a/doc/deg_seq.1.html b/doc/deg_seq.1.html
new file mode 100644
index 0000000..a38cd4e
--- /dev/null
+++ b/doc/deg_seq.1.html
@@ -0,0 +1,138 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>deg_seq(1) - Compute the degree sequence of a graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>deg_seq(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>deg_seq(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>deg_seq</code> - <span class="man-whatis">Compute the degree sequence of a graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>deg_seq</code> <var>graph_in</var></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>deg_seq</code> computes the degree sequence of <var>graph_in</var>.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd> undirected input graph (edge list). If is equal to <code>-</code> (dash), read
+ the edge list from STDIN.</dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p>The program prints on STDOUT the degree sequence of <var>graph_in</var> in the
+format:</p>
+
+<pre><code> k_1
+ k_2
+ k_3
+ ....
+</code></pre>
+
+<p>where <code>k_i</code> is the degree of the i-th node.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="deg_seq_w.1.html">deg_seq_w<span class="s">(1)</span></a>, <a class="man-ref" href="conf_model_deg.1.html">conf_model_deg<span class="s">(1)</span></a>, <a class="man-ref" href="fitmle.1.html">fitmle<span class="s">(1)</span></a>, <a class="man-ref" href="power_law.1.html">power_law<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 10, Cambridge University Press
+(2017)</li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>deg_seq(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/deg_seq.md b/doc/deg_seq.md
new file mode 100644
index 0000000..5c04cad
--- /dev/null
+++ b/doc/deg_seq.md
@@ -0,0 +1,45 @@
+deg_seq(1) -- Compute the degree sequence of a graph
+======
+
+## SYNOPSIS
+
+`deg_seq` <graph_in>
+
+## DESCRIPTION
+
+`deg_seq` computes the degree sequence of <graph_in>.
+
+
+## PARAMETERS
+
+* <graph_in>:
+ undirected input graph (edge list). If is equal to `-` (dash), read
+ the edge list from STDIN.
+
+## OUTPUT
+
+The program prints on STDOUT the degree sequence of <graph_in> in the
+format:
+
+ k_1
+ k_2
+ k_3
+ ....
+
+where `k_i` is the degree of the i-th node.
+
+## SEE ALSO
+
+deg_seq_w(1), conf_model_deg(1), fitmle(1), power_law(1)
+
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 10, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/deg_seq_w.1 b/doc/deg_seq_w.1
new file mode 100644
index 0000000..94fe3b2
--- /dev/null
+++ b/doc/deg_seq_w.1
@@ -0,0 +1,51 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "DEG_SEQ_W" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBdeg_seq_w\fR \- Compute the degree and strength sequence of a graph
+.
+.SH "SYNOPSIS"
+\fBdeg_seq_w\fR \fIgraph_in\fR
+.
+.SH "DESCRIPTION"
+\fBdeg_seq_w\fR computes the degree and the strength sequence of \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\.
+.
+.SH "OUTPUT"
+The program prints on STDOUT the degree and strength sequence of \fIgraph_in\fR in the format:
+.
+.IP "" 4
+.
+.nf
+
+ k_1 s_1
+ k_2 s_2
+ k_3 s_3
+ \.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBk_i\fR is the degree of the i\-th node and \fBs_i\fR is its strength\.
+.
+.SH "SEE ALSO"
+deg_seq(1), conf_model_deg(1), fitmle(1), power_law(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 3, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/deg_seq_w.1.html b/doc/deg_seq_w.1.html
new file mode 100644
index 0000000..fed3819
--- /dev/null
+++ b/doc/deg_seq_w.1.html
@@ -0,0 +1,138 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>deg_seq_w(1) - Compute the degree and strength sequence of a graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>deg_seq_w(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>deg_seq_w(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>deg_seq_w</code> - <span class="man-whatis">Compute the degree and strength sequence of a graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>deg_seq_w</code> <var>graph_in</var></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>deg_seq_w</code> computes the degree and the strength sequence of <var>graph_in</var>.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd> undirected input graph (edge list). If is equal to <code>-</code> (dash), read
+ the edge list from STDIN.</dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p>The program prints on STDOUT the degree and strength sequence of
+<var>graph_in</var> in the format:</p>
+
+<pre><code> k_1 s_1
+ k_2 s_2
+ k_3 s_3
+ ....
+</code></pre>
+
+<p>where <code>k_i</code> is the degree of the i-th node and <code>s_i</code> is its strength.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="deg_seq.1.html">deg_seq<span class="s">(1)</span></a>, <a class="man-ref" href="conf_model_deg.1.html">conf_model_deg<span class="s">(1)</span></a>, <a class="man-ref" href="fitmle.1.html">fitmle<span class="s">(1)</span></a>, <a class="man-ref" href="power_law.1.html">power_law<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 3, Cambridge University Press
+(2017)</li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>deg_seq_w(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/deg_seq_w.md b/doc/deg_seq_w.md
new file mode 100644
index 0000000..874e37a
--- /dev/null
+++ b/doc/deg_seq_w.md
@@ -0,0 +1,45 @@
+deg_seq_w(1) -- Compute the degree and strength sequence of a graph
+======
+
+## SYNOPSIS
+
+`deg_seq_w` <graph_in>
+
+## DESCRIPTION
+
+`deg_seq_w` computes the degree and the strength sequence of <graph_in>.
+
+
+## PARAMETERS
+
+* <graph_in>:
+ undirected input graph (edge list). If is equal to `-` (dash), read
+ the edge list from STDIN.
+
+## OUTPUT
+
+The program prints on STDOUT the degree and strength sequence of
+<graph_in> in the format:
+
+ k_1 s_1
+ k_2 s_2
+ k_3 s_3
+ ....
+
+where `k_i` is the degree of the i-th node and `s_i` is its strength.
+
+## SEE ALSO
+
+deg_seq(1), conf_model_deg(1), fitmle(1), power_law(1)
+
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 3, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/dijkstra.1 b/doc/dijkstra.1
new file mode 100644
index 0000000..909db36
--- /dev/null
+++ b/doc/dijkstra.1
@@ -0,0 +1,76 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "DIJKSTRA" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBdijkstra\fR \- Compute the distance between one node and all the other nodes of a weighted graph
+.
+.SH "SYNOPSIS"
+\fBdijkstra\fR \fIgraph_in\fR \fInode\fR
+.
+.SH "DESCRIPTION"
+\fBdijkstra\fR computes the distance (and the shortest paths) between a given node and all the other nodes of an undirected weighted graph provided as input\. The program implements the Dijkstra\'s algorithm\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+input graph (edge list) if equal to \fB\-\fR (dash), read the edge list from STDIN\.
+.
+.TP
+\fInode\fR
+The label of the node from which distances are to be computed
+.
+.SH "OUTPUT"
+\fBdijkstra\fR prints on the standard output the distances betwen \fInode\fR and all the other nodes of the graph, in the format:
+.
+.IP "" 4
+.
+.nf
+
+d0 d1 d2 d3\.\.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBd0\fR is the distance to node \fB0\fR, \fBd1\fR is the distance to node \fB1\fR, and so forth\.
+.
+.SH "EXAMPLES"
+The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ dijkstra US_airports\.net 0
+ 0 4784 5662 6603 11097 7470 4472 \.\.\.\.
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+will show on output the distances between node 0 and all the other nodes in the graph \fBUS_airports\.net\fR (the US air transportation network)\.
+.
+.SH "SEE ALSO"
+shortest(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+E\. W\. Dijkstra\. "A Note on Two Problems in Connexion with Graphs"\. Num\. Math\. 1 (1959), 269\-271\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 10, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 6, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/dijkstra.1.html b/doc/dijkstra.1.html
new file mode 100644
index 0000000..966a443
--- /dev/null
+++ b/doc/dijkstra.1.html
@@ -0,0 +1,158 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>dijkstra(1) - Compute the distance between one node and all the other nodes of a weighted graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>dijkstra(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>dijkstra(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>dijkstra</code> - <span class="man-whatis">Compute the distance between one node and all the other nodes of a weighted graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>dijkstra</code> <var>graph_in</var> <var>node</var></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>dijkstra</code> computes the distance (and the shortest paths) between a
+given node and all the other nodes of an undirected weighted graph
+provided as input. The program implements the Dijkstra's algorithm.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> input graph (edge list) if equal to <code>-</code> (dash), read the edge list
+ from STDIN.</p></dd>
+<dt class="flush"><var>node</var></dt><dd><p> The label of the node from which distances are to be computed</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>dijkstra</code> prints on the standard output the distances betwen <var>node</var>
+and all the other nodes of the graph, in the format:</p>
+
+<pre><code>d0 d1 d2 d3.....
+</code></pre>
+
+<p>where <code>d0</code> is the distance to node <code>0</code>, <code>d1</code> is the distance to node
+<code>1</code>, and so forth.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The following command:</p>
+
+<pre><code> $ dijkstra US_airports.net 0
+ 0 4784 5662 6603 11097 7470 4472 ....
+ $
+</code></pre>
+
+<p>will show on output the distances between node 0 and all the other
+nodes in the graph <code>US_airports.net</code> (the US air transportation
+network).</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="shortest.1.html">shortest<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>E. W. Dijkstra. "A Note on Two Problems in Connexion with
+Graphs". Num. Math. 1 (1959), 269-271.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 10, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 6, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>dijkstra(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/dijkstra.md b/doc/dijkstra.md
new file mode 100644
index 0000000..4ac786a
--- /dev/null
+++ b/doc/dijkstra.md
@@ -0,0 +1,65 @@
+dijkstra(1) -- Compute the distance between one node and all the other nodes of a weighted graph
+======
+
+## SYNOPSIS
+
+`dijkstra` <graph_in> <node>
+
+## DESCRIPTION
+
+`dijkstra` computes the distance (and the shortest paths) between a
+given node and all the other nodes of an undirected weighted graph
+provided as input. The program implements the Dijkstra's algorithm.
+
+## PARAMETERS
+
+* <graph_in>:
+ input graph (edge list) if equal to `-` (dash), read the edge list
+ from STDIN.
+
+* <node>:
+ The label of the node from which distances are to be computed
+
+## OUTPUT
+
+`dijkstra` prints on the standard output the distances betwen <node>
+and all the other nodes of the graph, in the format:
+
+ d0 d1 d2 d3.....
+
+where `d0` is the distance to node `0`, `d1` is the distance to node
+`1`, and so forth.
+
+## EXAMPLES
+
+The following command:
+
+ $ dijkstra US_airports.net 0
+ 0 4784 5662 6603 11097 7470 4472 ....
+ $
+
+will show on output the distances between node 0 and all the other
+nodes in the graph `US_airports.net` (the US air transportation
+network).
+
+## SEE ALSO
+
+shortest(1)
+
+## REFERENCES
+
+* E\. W. Dijkstra. "A Note on Two Problems in Connexion with
+ Graphs". Num. Math. 1 (1959), 269-271.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 10, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 6, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/dms.1 b/doc/dms.1
new file mode 100644
index 0000000..1ead9f2
--- /dev/null
+++ b/doc/dms.1
@@ -0,0 +1,121 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "DMS" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBdms\fR \- Grow a scale\-free random graph with tunable exponent
+.
+.SH "SYNOPSIS"
+\fBdms\fR \fIN\fR \fIm\fR \fIn0\fR \fIa\fR
+.
+.SH "DESCRIPTION"
+\fBdms\fR grows an undirected random scale\-free graph with \fIN\fR nodes using the modified linear preferential attachment model proposed by Dorogovtsev, Mendes and Samukhin\. The initial network is a clique of \fIn0\fR nodes, and each new node creates \fIm\fR new edges\. The resulting graph will have a scale\-free degree distribution, whose exponent converges to \fBgamma=3\.0 + a/m\fR for large \fIN\fR\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIN\fR
+Number of nodes of the final graph\.
+.
+.TP
+\fIm\fR
+Number of edges created by each new node\.
+.
+.TP
+\fIn0\fR
+Number of nodes in the initial (seed) graph\.
+.
+.TP
+\fIa\fR
+This parameter sets the exponent of the degree distribution (\fBgamma = 3\.0 + a/m\fR)\. \fIa\fR must be larger than \fI\-m\fR\.
+.
+.SH "OUTPUT"
+\fBdms\fR prints on STDOUT the edge list of the final graph\.
+.
+.SH "EXAMPLES"
+Let us assume that we want to create a scale\-free network with \fIN=10000\fR nodes, with average degree equal to 8, whose degree distribution has exponent
+.
+.IP "" 4
+.
+.nf
+
+ gamma = 2\.5
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Since \fBdms\fR produces graphs with scale\-free degree sequences with an exponent \fBgamma = 3\.0 + a/m\fR, the command:
+.
+.IP "" 4
+.
+.nf
+
+ $ dms 10000 4 4 \-2\.0 > dms_10000_4_4_\-2\.0\.txt
+.
+.fi
+.
+.IP "" 0
+.
+.P
+will produce the desired network\. In fact, the average degree of the graph will be:
+.
+.IP "" 4
+.
+.nf
+
+ <k> = 2m = 8
+.
+.fi
+.
+.IP "" 0
+.
+.P
+and the exponent of the power\-law degree distribution will be:
+.
+.IP "" 4
+.
+.nf
+
+ gamma = 3\.0 + a/m = 3\.0 \-0\.5 = 2\.5
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ dms 10000 3 5 0 > dms_10000_3_5_0\.txt
+.
+.fi
+.
+.IP "" 0
+.
+.P
+creates a scale\-free graph with \fIN=10000\fR nodes, where each new node creates \fIm=3\fR new edges and the initial seed network is a ring of \fIn0=5\fR nodes\. The degree distribution of the final graph will have exponent equal to \fBgamma = 3\.0 + a/m = 3\.0\fR\. In this case, \fBdms\fR produces a Barabasi\-Albert graph (see ba(1) for details)\. The edge list of the graph is saved in the file \fBdms_10000_3_5_0\.txt\fR (thanks to the redirection operator \fB>\fR)\.
+.
+.SH "SEE ALSO"
+ba(1), bb_fitness(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+S\. N\. Dorogovtsev, J\. F\. F\. Mendes, A\. N\. Samukhin\. "Structure of Growing Networks with Preferential Linking"\. Phys\. Rev\. Lett\. 85 (2000), 4633\-4636\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 6, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 13, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/dms.1.html b/doc/dms.1.html
new file mode 100644
index 0000000..e51aa79
--- /dev/null
+++ b/doc/dms.1.html
@@ -0,0 +1,183 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>dms(1) - Grow a scale-free random graph with tunable exponent</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>dms(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>dms(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>dms</code> - <span class="man-whatis">Grow a scale-free random graph with tunable exponent</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>dms</code> <var>N</var> <var>m</var> <var>n0</var> <em>a</em></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>dms</code> grows an undirected random scale-free graph with <var>N</var> nodes using
+the modified linear preferential attachment model proposed by
+Dorogovtsev, Mendes and Samukhin. The initial network is a clique of
+<var>n0</var> nodes, and each new node creates <var>m</var> new edges. The resulting
+graph will have a scale-free degree distribution, whose exponent
+converges to <code>gamma=3.0 + a/m</code> for large <var>N</var>.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt class="flush"><var>N</var></dt><dd><p> Number of nodes of the final graph.</p></dd>
+<dt class="flush"><var>m</var></dt><dd><p> Number of edges created by each new node.</p></dd>
+<dt class="flush"><var>n0</var></dt><dd><p> Number of nodes in the initial (seed) graph.</p></dd>
+<dt class="flush"><em>a</em></dt><dd><p> This parameter sets the exponent of the degree distribution
+ (<code>gamma = 3.0 + a/m</code>). <em>a</em> must be larger than <var>-m</var>.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>dms</code> prints on STDOUT the edge list of the final graph.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>Let us assume that we want to create a scale-free network with
+<var>N=10000</var> nodes, with average degree equal to 8, whose degree
+distribution has exponent</p>
+
+<pre><code> gamma = 2.5
+</code></pre>
+
+<p>Since <code>dms</code> produces graphs with scale-free degree sequences with an
+exponent <code>gamma = 3.0 + a/m</code>, the command:</p>
+
+<pre><code> $ dms 10000 4 4 -2.0 &gt; dms_10000_4_4_-2.0.txt
+</code></pre>
+
+<p>will produce the desired network. In fact, the average degree of the
+graph will be:</p>
+
+<pre><code> &lt;k> = 2m = 8
+</code></pre>
+
+<p>and the exponent of the power-law degree distribution will be:</p>
+
+<pre><code> gamma = 3.0 + a/m = 3.0 -0.5 = 2.5
+</code></pre>
+
+<p>The following command:</p>
+
+<pre><code> $ dms 10000 3 5 0 &gt; dms_10000_3_5_0.txt
+</code></pre>
+
+<p>creates a scale-free graph with <var>N=10000</var> nodes, where each new node
+creates <var>m=3</var> new edges and the initial seed network is a ring of
+<var>n0=5</var> nodes. The degree distribution of the final graph will have
+exponent equal to <code>gamma = 3.0 + a/m = 3.0</code>. In this case, <code>dms</code>
+produces a Barabasi-Albert graph (see <a class="man-ref" href="ba.1.html">ba<span class="s">(1)</span></a> for details). The edge
+list of the graph is saved in the file <code>dms_10000_3_5_0.txt</code> (thanks
+to the redirection operator <code>&gt;</code>).</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="ba.1.html">ba<span class="s">(1)</span></a>, <a class="man-ref" href="bb_fitness.1.html">bb_fitness<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>S. N. Dorogovtsev, J. F. F. Mendes, A. N. Samukhin. "Structure of
+ Growing Networks with Preferential Linking". Phys. Rev. Lett. 85
+ (2000), 4633-4636.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 6, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 13, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>dms(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/dms.md b/doc/dms.md
new file mode 100644
index 0000000..2969ff5
--- /dev/null
+++ b/doc/dms.md
@@ -0,0 +1,92 @@
+dms(1) -- Grow a scale-free random graph with tunable exponent
+======
+
+## SYNOPSIS
+
+`dms` <N> <m> <n0> _a_
+
+## DESCRIPTION
+
+`dms` grows an undirected random scale-free graph with <N> nodes using
+the modified linear preferential attachment model proposed by
+Dorogovtsev, Mendes and Samukhin. The initial network is a clique of
+<n0> nodes, and each new node creates <m> new edges. The resulting
+graph will have a scale-free degree distribution, whose exponent
+converges to `gamma=3.0 + a/m` for large <N>.
+
+## PARAMETERS
+
+* <N>:
+ Number of nodes of the final graph.
+
+* <m>:
+ Number of edges created by each new node.
+
+* <n0>:
+ Number of nodes in the initial (seed) graph.
+
+* _a_:
+ This parameter sets the exponent of the degree distribution
+ (`gamma = 3.0 + a/m`). _a_ must be larger than <-m>.
+
+## OUTPUT
+
+`dms` prints on STDOUT the edge list of the final graph.
+
+## EXAMPLES
+
+Let us assume that we want to create a scale-free network with
+<N=10000> nodes, with average degree equal to 8, whose degree
+distribution has exponent
+
+ gamma = 2.5
+
+Since `dms` produces graphs with scale-free degree sequences with an
+exponent `gamma = 3.0 + a/m`, the command:
+
+ $ dms 10000 4 4 -2.0 > dms_10000_4_4_-2.0.txt
+
+will produce the desired network. In fact, the average degree of the
+graph will be:
+
+ <k> = 2m = 8
+
+and the exponent of the power-law degree distribution will be:
+
+ gamma = 3.0 + a/m = 3.0 -0.5 = 2.5
+
+The following command:
+
+ $ dms 10000 3 5 0 > dms_10000_3_5_0.txt
+
+creates a scale-free graph with <N=10000> nodes, where each new node
+creates <m=3> new edges and the initial seed network is a ring of
+<n0=5> nodes. The degree distribution of the final graph will have
+exponent equal to `gamma = 3.0 + a/m = 3.0`. In this case, `dms`
+produces a Barabasi-Albert graph (see ba(1) for details). The edge
+list of the graph is saved in the file `dms_10000_3_5_0.txt` (thanks
+to the redirection operator `>`).
+
+## SEE ALSO
+
+ba(1), bb_fitness(1)
+
+## REFERENCES
+
+* S\. N. Dorogovtsev, J. F. F. Mendes, A. N. Samukhin. "Structure of
+ Growing Networks with Preferential Linking". Phys. Rev. Lett. 85
+ (2000), 4633-4636.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 6, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 13, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
+
diff --git a/doc/er_A.1 b/doc/er_A.1
new file mode 100644
index 0000000..ad2a504
--- /dev/null
+++ b/doc/er_A.1
@@ -0,0 +1,78 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "ER_A" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBer_A\fR \- Sample a random graph from the Erdos\-Renyi model A
+.
+.SH "SYNOPSIS"
+\fBer_A\fR \fIN\fR \fIK\fR [\fIfileout\fR]
+.
+.SH "DESCRIPTION"
+\fBer_A\fR samples a random graph with \fIN\fR nodes and \fIK\fR edges from the Erdos\-Renyi model A, i\.e\. the ensemble of random graphs where K links are placed uniformly at random among N nodes\. The program dumps the edge list of the resulting graph on output\. If the optional \fIfileout\fR is provided, the output is written on a file with that name\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIN\fR
+Number of nodes in the final graph\.
+.
+.TP
+\fIK\fR
+Number of edges in the final graph\.
+.
+.TP
+\fIfileout\fR
+The (optional) name of the filename where the edge list of the graph will be saved\.
+.
+.SH "EXAMPLES"
+The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ er_A 1000 3000
+.
+.fi
+.
+.IP "" 0
+.
+.P
+samples an undirected random network with \fIN=1000\fR nodes and \fIK=3000\fR edges using the Erdos\-Renyi model A\. The output of the command \fBer_A\fR will be the edge\-list of the resulting graph, where each (undirected) edge is reported only once\. In order to be useful, such edge\-list should be saved into a file\. The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ er_A 1000 3000 > er_A_1000_3000\.net
+.
+.fi
+.
+.IP "" 0
+.
+.P
+will save the resulting graph in the file er_A_1000_3000\.net\. Notice the usage of the symbol ">" to redirect the output of the program to a file\.
+.
+.SH "SEE ALSO"
+er_B(1), ws(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+P\. Erdos, & A\. Rényi, "On Random Graphs I", Publ\. Math\. Debrecen, 6, 290 (1959)
+.
+.IP "\(bu" 4
+P\.Erdos, & A\. Renyi, "On the evolution of random graphs" Publ\. Math\. Inst\. Hungary\. Acad\. Sci\., 5, 17\-61 (1960)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 3, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 10, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/er_A.1.html b/doc/er_A.1.html
new file mode 100644
index 0000000..93c9a11
--- /dev/null
+++ b/doc/er_A.1.html
@@ -0,0 +1,158 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>er_A(1) - Sample a random graph from the Erdos-Renyi model A</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>er_A(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>er_A(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>er_A</code> - <span class="man-whatis">Sample a random graph from the Erdos-Renyi model A</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>er_A</code> <var>N</var> <var>K</var> [<var>fileout</var>]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>er_A</code> samples a random graph with <var>N</var> nodes and <var>K</var> edges from the
+Erdos-Renyi model A, i.e. the ensemble of random graphs where K links
+are placed uniformly at random among N nodes. The program dumps the
+edge list of the resulting graph on output. If the optional <var>fileout</var>
+is provided, the output is written on a file with that name.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt class="flush"><var>N</var></dt><dd><p> Number of nodes in the final graph.</p></dd>
+<dt class="flush"><var>K</var></dt><dd><p> Number of edges in the final graph.</p></dd>
+<dt class="flush"><var>fileout</var></dt><dd><p> The (optional) name of the filename where the edge list of the
+ graph will be saved.</p></dd>
+</dl>
+
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The following command:</p>
+
+<pre><code> $ er_A 1000 3000
+</code></pre>
+
+<p>samples an undirected random network with <var>N=1000</var> nodes and <var>K=3000</var>
+edges using the Erdos-Renyi model A. The output of the command <code>er_A</code>
+will be the edge-list of the resulting graph, where each (undirected)
+edge is reported only once. In order to be useful, such edge-list
+should be saved into a file. The following command:</p>
+
+<pre><code> $ er_A 1000 3000 &gt; er_A_1000_3000.net
+</code></pre>
+
+<p>will save the resulting graph in the file er_A_1000_3000.net. Notice
+the usage of the symbol ">" to redirect the output of the program to a
+file.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="er_B.1.html">er_B<span class="s">(1)</span></a>, <a class="man-ref" href="ws.1.html">ws<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>P. Erdos, &amp; A. Rényi, "On Random Graphs I", Publ. Math. Debrecen, 6,
+290 (1959)</p></li>
+<li><p>P.Erdos, &amp; A. Renyi, "On the evolution of random graphs"
+Publ. Math. Inst. Hungary. Acad. Sci., 5, 17-61 (1960)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 3, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 10, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>er_A(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/er_A.md b/doc/er_A.md
new file mode 100644
index 0000000..0019c4b
--- /dev/null
+++ b/doc/er_A.md
@@ -0,0 +1,69 @@
+er_A(1) -- Sample a random graph from the Erdos-Renyi model A
+======
+
+## SYNOPSIS
+
+`er_A` <N> <K> [<fileout>]
+
+## DESCRIPTION
+
+`er_A` samples a random graph with <N> nodes and <K> edges from the
+Erdos-Renyi model A, i.e. the ensemble of random graphs where K links
+are placed uniformly at random among N nodes. The program dumps the
+edge list of the resulting graph on output. If the optional <fileout>
+is provided, the output is written on a file with that name.
+
+## PARAMETERS
+
+* <N>:
+ Number of nodes in the final graph.
+
+* <K>:
+ Number of edges in the final graph.
+
+* <fileout>:
+ The (optional) name of the filename where the edge list of the
+ graph will be saved.
+
+## EXAMPLES
+
+The following command:
+
+ $ er_A 1000 3000
+
+samples an undirected random network with <N=1000> nodes and <K=3000>
+edges using the Erdos-Renyi model A. The output of the command `er_A`
+will be the edge-list of the resulting graph, where each (undirected)
+edge is reported only once. In order to be useful, such edge-list
+should be saved into a file. The following command:
+
+ $ er_A 1000 3000 > er_A_1000_3000.net
+
+will save the resulting graph in the file er\_A\_1000\_3000.net. Notice
+the usage of the symbol "\>" to redirect the output of the program to a
+file.
+
+## SEE ALSO
+
+er_B(1), ws(1)
+
+## REFERENCES
+
+* P\. Erdos, & A. Rényi, "On Random Graphs I", Publ. Math. Debrecen, 6,
+ 290 (1959)
+
+* P\.Erdos, & A. Renyi, "On the evolution of random graphs"
+ Publ. Math. Inst. Hungary. Acad. Sci., 5, 17-61 (1960)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 3, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 10, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/er_B.1 b/doc/er_B.1
new file mode 100644
index 0000000..5093f16
--- /dev/null
+++ b/doc/er_B.1
@@ -0,0 +1,78 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "ER_B" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBer_B\fR \- Sample a random graph from the Erdos\-Renyi model B
+.
+.SH "SYNOPSIS"
+\fBer_B\fR \fIN\fR \fIp\fR [\fIfileout\fR]
+.
+.SH "DESCRIPTION"
+\fBer_B\fR samples a random graph from the Erdos\-Renyi model B, i\.e\. a graph with \fIN\fR nodes where each of the <N(N\-1)/2> edges is created independently with probability \fIp\fR\. The program dumps the edge list of the resulting graph on output\. If the optional \fIfileout\fR is provided, the output is written on a file with that name\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIN\fR
+Number of nodes in the final graph\.
+.
+.TP
+\fIp\fR
+Edge probability\.
+.
+.TP
+\fIfileout\fR
+The (optional) name of the filename where the edge list of the graph will be saved\.
+.
+.SH "EXAMPLES"
+The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ er_B 1000 0\.006
+.
+.fi
+.
+.IP "" 0
+.
+.P
+samples an undirected random network with \fIN=1000\fR nodes where each possible edge is created with probability \fIp=0\.006\fR\. The output of the command \fBer_B\fR will be the edge\-list of the resulting graph, where each (undirected) edge is reported only once\. In order to be useful, such edge\-list should be saved into a file\. The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ er_B 1000 0\.006 > er_B_1000_0\.006\.net
+.
+.fi
+.
+.IP "" 0
+.
+.P
+will save the resulting graph in the file er_B_1000_0\.006\.net\. Notice the usage of the symbol ">" to redirect the output of the program to a file\.
+.
+.SH "SEE ALSO"
+er_A(1), ws(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+P\. Erdos, & A\. Rényi, "On Random Graphs I", Publ\. Math\. Debrecen, 6, 290 (1959)
+.
+.IP "\(bu" 4
+P\.Erdos, & A\. Renyi, "On the evolution of random graphs" Publ\. Math\. Inst\. Hungary\. Acad\. Sci\., 5, 17\-61 (1960)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 3, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 10, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/er_B.1.html b/doc/er_B.1.html
new file mode 100644
index 0000000..4b7a963
--- /dev/null
+++ b/doc/er_B.1.html
@@ -0,0 +1,158 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>er_B(1) - Sample a random graph from the Erdos-Renyi model B</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>er_B(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>er_B(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>er_B</code> - <span class="man-whatis">Sample a random graph from the Erdos-Renyi model B</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>er_B</code> <var>N</var> <em>p</em> [<var>fileout</var>]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>er_B</code> samples a random graph from the Erdos-Renyi model B, i.e. a
+graph with <var>N</var> nodes where each of the &lt;N(N-1)/2> edges is created
+independently with probability <em>p</em>. The program dumps the edge list of
+the resulting graph on output. If the optional <var>fileout</var> is provided,
+the output is written on a file with that name.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt class="flush"><var>N</var></dt><dd><p> Number of nodes in the final graph.</p></dd>
+<dt class="flush"><em>p</em></dt><dd><p> Edge probability.</p></dd>
+<dt class="flush"><var>fileout</var></dt><dd><p> The (optional) name of the filename where the edge list of the
+ graph will be saved.</p></dd>
+</dl>
+
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The following command:</p>
+
+<pre><code> $ er_B 1000 0.006
+</code></pre>
+
+<p>samples an undirected random network with <var>N=1000</var> nodes where each
+possible edge is created with probability <em>p=0.006</em>. The output of
+the command <code>er_B</code> will be the edge-list of the resulting graph, where
+each (undirected) edge is reported only once. In order to be useful,
+such edge-list should be saved into a file. The following command:</p>
+
+<pre><code> $ er_B 1000 0.006 &gt; er_B_1000_0.006.net
+</code></pre>
+
+<p>will save the resulting graph in the file
+er_B_1000_0.006.net. Notice the usage of the symbol ">" to
+redirect the output of the program to a file.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="er_A.1.html">er_A<span class="s">(1)</span></a>, <a class="man-ref" href="ws.1.html">ws<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>P. Erdos, &amp; A. Rényi, "On Random Graphs I", Publ. Math. Debrecen, 6,
+290 (1959)</p></li>
+<li><p>P.Erdos, &amp; A. Renyi, "On the evolution of random graphs"
+Publ. Math. Inst. Hungary. Acad. Sci., 5, 17-61 (1960)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 3, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 10, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>er_B(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/er_B.md b/doc/er_B.md
new file mode 100644
index 0000000..a087494
--- /dev/null
+++ b/doc/er_B.md
@@ -0,0 +1,70 @@
+er_B(1) -- Sample a random graph from the Erdos-Renyi model B
+======
+
+## SYNOPSIS
+
+`er_B` <N> _p_ [<fileout>]
+
+## DESCRIPTION
+
+`er_B` samples a random graph from the Erdos-Renyi model B, i.e. a
+graph with <N> nodes where each of the <N(N-1)/2> edges is created
+independently with probability _p_. The program dumps the edge list of
+the resulting graph on output. If the optional <fileout> is provided,
+the output is written on a file with that name.
+
+## PARAMETERS
+
+* <N>:
+ Number of nodes in the final graph.
+
+* _p_:
+ Edge probability.
+
+* <fileout>:
+ The (optional) name of the filename where the edge list of the
+ graph will be saved.
+
+## EXAMPLES
+
+The following command:
+
+ $ er_B 1000 0.006
+
+samples an undirected random network with <N=1000> nodes where each
+possible edge is created with probability _p=0.006_. The output of
+the command `er_B` will be the edge-list of the resulting graph, where
+each (undirected) edge is reported only once. In order to be useful,
+such edge-list should be saved into a file. The following command:
+
+ $ er_B 1000 0.006 > er_B_1000_0.006.net
+
+will save the resulting graph in the file
+er\_B\_1000\_0.006.net. Notice the usage of the symbol "\>" to
+redirect the output of the program to a file.
+
+## SEE ALSO
+
+er_A(1), ws(1)
+
+
+## REFERENCES
+
+* P\. Erdos, & A. Rényi, "On Random Graphs I", Publ. Math. Debrecen, 6,
+ 290 (1959)
+
+* P\.Erdos, & A. Renyi, "On the evolution of random graphs"
+ Publ. Math. Inst. Hungary. Acad. Sci., 5, 17-61 (1960)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 3, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 10, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/f3m.1 b/doc/f3m.1
new file mode 100644
index 0000000..fb1a919
--- /dev/null
+++ b/doc/f3m.1
@@ -0,0 +1,156 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "F3M" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBf3m\fR \- Count all the 3\-node subgraphs of a directed graph
+.
+.SH "SYNOPSIS"
+\fBf3m\fR \fIgraph_in\fR [\fInum_random\fR]
+.
+.SH "DESCRIPTION"
+\fBf3m\fR performs a motif analysis on \fIgraph_in\fR, i\.e\., it counts all the 3\-node subgraphs and computes the z\-score of that count with respect to the corresponding configuration model ensemble\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+input graph (edge list)\. It must be an existing file\.
+.
+.TP
+\fInum_random\fR
+The number of random graphs to sample from the configuration model for the computation of the z\-score of the motifs\.
+.
+.SH "OUTPUT"
+\fBf3m\fR prints on the standard output a table with 13 rows, one for each of the 13 possible 3\-node motifs\. Each line is in the format:
+.
+.IP "" 4
+.
+.nf
+
+ motif_number count mean_rnd std_rnd z\-score
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBmotif_number\fR is a number between 1 and 13 that identifies the motif (see \fIMOTIF NUMBERS\fR below), \fBcount\fR is the number of subgraphs ot type \fBmotif_number\fR found in \fIgraph_in\fR, \fBmean_rnd\fR is the average number of subgraphs of type \fBmotif_number\fR in the corresponding configuration model ensemble, and \fBstd_rnd\fR is the associated standard deviation\. Finally, \fBz\-score\fR is the quantity:
+.
+.IP "" 4
+.
+.nf
+
+ (count \- mean_rnd) / std_rnd
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The program also prints a progress bar on STDERR\.
+.
+.SH "MOTIF NUMBERS"
+We report below the correspondence between the 13 possible 3\-node subgraphs and the corresponding \fBmotif_number\fR\. In the diagrams, \'O\-\-\->O\' indicates a single edge form the left node to the right node, while \'O\fI==\fRO\' indicates a double (bi\-directional) edge between the two nodes:
+.
+.IP "" 4
+.
+.nf
+
+ (1) O<\-\-\-O\-\-\->O
+
+ (2) O\-\-\->O\-\-\->O
+
+ (3) O<==>O\-\-\->O
+
+ (4) O\-\-\->O<\-\-\-O
+
+ (5) O\-\-\->O\-\-\->O
+ \e ^
+ \e_______|
+
+ (6) O<==>O\-\-\->O
+ \e ^
+ \e_______|
+
+ (7) O<==>O<\-\-\-O
+
+ (8) O<==>O<==>O
+
+ (9) O<\-\-\-O<\-\-\-O
+ \e ^
+ \e_______|
+
+ (10) O<==>O<\-\-\-O
+ \e ^
+ \e_______|
+
+ (11) O\-\-\->O<==>O
+ \e ^
+ \e_______|
+
+ (12) O<==>O<==>O
+ \e ^
+ \e_______|
+
+ (13) O<==>O<==>O
+ ^\e ^/
+ \e\e_____//
+ \e_____/
+.
+.fi
+.
+.IP "" 0
+.
+.SH "EXAMPLES"
+To perform a motif analysis on the E\.coli transcription regulation graph, using 1000 randomised networks, we run the command:
+.
+.IP "" 4
+.
+.nf
+
+ $ f3m e_coli\.net 1000
+ 1 4760 4400\.11 137\.679 +2\.614
+ 2 162 188\.78 8\.022 \-3\.338
+ 3 0 0\.89 3\.903 \-0\.228
+ 4 226 238\.32 7\.657 \-1\.609
+ 5 40 6\.54 2\.836 +11\.800
+ 6 0 0\.01 0\.077 \-0\.078
+ 7 0 0\.12 0\.642 \-0\.192
+ 8 0 0\.00 0\.032 \-0\.032
+ 9 0 0\.01 0\.109 \-0\.110
+ 10 0 0\.00 0\.000 +0\.000
+ 11 0 0\.00 0\.032 \-0\.032
+ 12 0 0\.00 0\.000 +0\.000
+ 13 0 0\.00 0\.000 +0\.000
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Notice that the motif \fB5\fR (the so\-called "feed\-forward loop") has a z\-score equal to 11\.8, meaning that it is highly overrepresented in the E\.coli graph with respect to the corresponding configuration model ensemble\. Conversely, the motif \fB2\fR (three\-node chain) is underrepresented, as made evident by value of the z\-score (\-3\.338)\.
+.
+.SH "SEE ALSO"
+johnson_cycles(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+R\. Milo et al\. "Network Motifs: Simple Building Blocks of Complex Networks"\. Science 298 (2002), 824\-827\.
+.
+.IP "\(bu" 4
+R\. Milo et al\. "Superfamilies of evolved and designed networks\." Science 303 (2004), 1538\-1542
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 8, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 16, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/f3m.1.html b/doc/f3m.1.html
new file mode 100644
index 0000000..3890394
--- /dev/null
+++ b/doc/f3m.1.html
@@ -0,0 +1,235 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>f3m(1) - Count all the 3-node subgraphs of a directed graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#MOTIF-NUMBERS">MOTIF NUMBERS</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>f3m(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>f3m(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>f3m</code> - <span class="man-whatis">Count all the 3-node subgraphs of a directed graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>f3m</code> <var>graph_in</var> [<var>num_random</var>]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>f3m</code> performs a motif analysis on <var>graph_in</var>, i.e., it counts all the
+3-node subgraphs and computes the z-score of that count with respect
+to the corresponding configuration model ensemble.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> input graph (edge list). It must be an existing file.</p></dd>
+<dt><var>num_random</var></dt><dd><p> The number of random graphs to sample from the configuration model
+ for the computation of the z-score of the motifs.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>f3m</code> prints on the standard output a table with 13 rows, one for each
+of the 13 possible 3-node motifs. Each line is in the format:</p>
+
+<pre><code> motif_number count mean_rnd std_rnd z-score
+</code></pre>
+
+<p>where <code>motif_number</code> is a number between 1 and 13 that identifies the
+motif (see <a href="#MOTIF-NUMBERS" title="MOTIF NUMBERS" data-bare-link="true">MOTIF NUMBERS</a> below), <code>count</code> is the number of
+subgraphs ot type <code>motif_number</code> found in <var>graph_in</var>, <code>mean_rnd</code> is
+the average number of subgraphs of type <code>motif_number</code> in the
+corresponding configuration model ensemble, and <code>std_rnd</code> is the
+associated standard deviation. Finally, <code>z-score</code> is the quantity:</p>
+
+<pre><code> (count - mean_rnd) / std_rnd
+</code></pre>
+
+<p>The program also prints a progress bar on STDERR.</p>
+
+<h2 id="MOTIF-NUMBERS">MOTIF NUMBERS</h2>
+
+<p>We report below the correspondence between the 13 possible 3-node
+subgraphs and the corresponding <code>motif_number</code>. In the diagrams,
+'O--->O' indicates a single edge form the left node to the right node,
+while 'O<var>==</var>O' indicates a double (bi-directional) edge between the
+two nodes:</p>
+
+<pre><code> (1) O&lt;---O--->O
+
+ (2) O---&gt;O---&gt;O
+
+ (3) O&lt;==>O---&gt;O
+
+ (4) O---&gt;O&lt;---O
+
+ (5) O--->O---&gt;O
+ \ ^
+ \_______|
+
+ (6) O&lt;==>O---&gt;O
+ \ ^
+ \_______|
+
+ (7) O&lt;==>O&lt;---O
+
+ (8) O&lt;==>O&lt;==>O
+
+ (9) O&lt;---O&lt;---O
+ \ ^
+ \_______|
+
+ (10) O&lt;==>O&lt;---O
+ \ ^
+ \_______|
+
+ (11) O--->O&lt;==>O
+ \ ^
+ \_______|
+
+ (12) O&lt;==>O&lt;==>O
+ \ ^
+ \_______|
+
+ (13) O&lt;==>O&lt;==>O
+ ^\ ^/
+ \\_____//
+ \_____/
+</code></pre>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>To perform a motif analysis on the E.coli transcription regulation
+graph, using 1000 randomised networks, we run the command:</p>
+
+<pre><code> $ f3m e_coli.net 1000
+ 1 4760 4400.11 137.679 +2.614
+ 2 162 188.78 8.022 -3.338
+ 3 0 0.89 3.903 -0.228
+ 4 226 238.32 7.657 -1.609
+ 5 40 6.54 2.836 +11.800
+ 6 0 0.01 0.077 -0.078
+ 7 0 0.12 0.642 -0.192
+ 8 0 0.00 0.032 -0.032
+ 9 0 0.01 0.109 -0.110
+ 10 0 0.00 0.000 +0.000
+ 11 0 0.00 0.032 -0.032
+ 12 0 0.00 0.000 +0.000
+ 13 0 0.00 0.000 +0.000
+ $
+</code></pre>
+
+<p>Notice that the motif <code>5</code> (the so-called "feed-forward loop") has a
+z-score equal to 11.8, meaning that it is highly overrepresented in
+the E.coli graph with respect to the corresponding configuration model
+ensemble. Conversely, the motif <code>2</code> (three-node chain) is
+underrepresented, as made evident by value of the z-score (-3.338).</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="johnson_cycles.1.html">johnson_cycles<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>R. Milo et al. "Network Motifs: Simple Building Blocks of Complex
+Networks". Science 298 (2002), 824-827.</p></li>
+<li><p>R. Milo et al. "Superfamilies of evolved and designed networks."
+Science 303 (2004), 1538-1542</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 8, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 16, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>f3m(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/f3m.md b/doc/f3m.md
new file mode 100644
index 0000000..63b5ff7
--- /dev/null
+++ b/doc/f3m.md
@@ -0,0 +1,144 @@
+f3m(1) -- Count all the 3-node subgraphs of a directed graph
+======
+
+## SYNOPSIS
+
+`f3m` <graph_in> [<num_random>]
+
+## DESCRIPTION
+
+`f3m` performs a motif analysis on <graph_in>, i.e., it counts all the
+3-node subgraphs and computes the z-score of that count with respect
+to the corresponding configuration model ensemble.
+
+## PARAMETERS
+
+* <graph_in>:
+ input graph (edge list). It must be an existing file.
+
+* <num_random>:
+ The number of random graphs to sample from the configuration model
+ for the computation of the z-score of the motifs.
+
+
+## OUTPUT
+
+`f3m` prints on the standard output a table with 13 rows, one for each
+of the 13 possible 3-node motifs. Each line is in the format:
+
+ motif_number count mean_rnd std_rnd z-score
+
+where `motif_number` is a number between 1 and 13 that identifies the
+motif (see [MOTIF NUMBERS][] below), `count` is the number of
+subgraphs ot type `motif_number` found in <graph_in>, `mean_rnd` is
+the average number of subgraphs of type `motif_number` in the
+corresponding configuration model ensemble, and `std_rnd` is the
+associated standard deviation. Finally, `z-score` is the quantity:
+
+ (count - mean_rnd) / std_rnd
+
+The program also prints a progress bar on STDERR.
+
+
+## MOTIF NUMBERS
+
+We report below the correspondence between the 13 possible 3-node
+subgraphs and the corresponding `motif_number`. In the diagrams,
+'O--->O' indicates a single edge form the left node to the right node,
+while 'O<==>O' indicates a double (bi-directional) edge between the
+two nodes:
+
+ (1) O<---O--->O
+
+ (2) O--->O--->O
+
+ (3) O<==>O--->O
+
+ (4) O--->O<---O
+
+ (5) O--->O--->O
+ \ ^
+ \_______|
+
+ (6) O<==>O--->O
+ \ ^
+ \_______|
+
+ (7) O<==>O<---O
+
+ (8) O<==>O<==>O
+
+ (9) O<---O<---O
+ \ ^
+ \_______|
+
+ (10) O<==>O<---O
+ \ ^
+ \_______|
+
+ (11) O--->O<==>O
+ \ ^
+ \_______|
+
+ (12) O<==>O<==>O
+ \ ^
+ \_______|
+
+ (13) O<==>O<==>O
+ ^\ ^/
+ \\_____//
+ \_____/
+
+
+
+## EXAMPLES
+
+To perform a motif analysis on the E.coli transcription regulation
+graph, using 1000 randomised networks, we run the command:
+
+ $ f3m e_coli.net 1000
+ 1 4760 4400.11 137.679 +2.614
+ 2 162 188.78 8.022 -3.338
+ 3 0 0.89 3.903 -0.228
+ 4 226 238.32 7.657 -1.609
+ 5 40 6.54 2.836 +11.800
+ 6 0 0.01 0.077 -0.078
+ 7 0 0.12 0.642 -0.192
+ 8 0 0.00 0.032 -0.032
+ 9 0 0.01 0.109 -0.110
+ 10 0 0.00 0.000 +0.000
+ 11 0 0.00 0.032 -0.032
+ 12 0 0.00 0.000 +0.000
+ 13 0 0.00 0.000 +0.000
+ $
+
+Notice that the motif `5` (the so-called "feed-forward loop") has a
+z-score equal to 11.8, meaning that it is highly overrepresented in
+the E.coli graph with respect to the corresponding configuration model
+ensemble. Conversely, the motif `2` (three-node chain) is
+underrepresented, as made evident by value of the z-score (-3.338).
+
+## SEE ALSO
+
+johnson_cycles(1)
+
+## REFERENCES
+
+* R\. Milo et al. "Network Motifs: Simple Building Blocks of Complex
+ Networks". Science 298 (2002), 824-827.
+
+* R\. Milo et al. "Superfamilies of evolved and designed networks."
+ Science 303 (2004), 1538-1542
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 8, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 16, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/fitmle.1 b/doc/fitmle.1
new file mode 100644
index 0000000..75a43d1
--- /dev/null
+++ b/doc/fitmle.1
@@ -0,0 +1,136 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "FITMLE" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBfitmle\fR \- Fit a set of values with a power\-law distribution
+.
+.SH "SYNOPSIS"
+\fBfitmle\fR \fIdata_in\fR [\fItol\fR [TEST [\fInum_test\fR]]]
+.
+.SH "DESCRIPTION"
+\fBfitmle\fR fits the data points contained in the file \fIdata_in\fR with a power\-law function P(k) ~ k, using the Maximum\-Likelihood Estimator (MLE)\. In particular, \fBfitmle\fR finds the exponent \fBgamma\fR and the minimum of the values provided on input for which the power\-law behaviour holds\. The second (optional) argument \fItol\fR sets the acceptable statistical error on the estimate of the exponent\.
+.
+.P
+If \fBTEST\fR is provided, the program associates a p\-value to the goodness of the fit, based on the Kolmogorov\-Smirnov statistics computed on \fInum_test\fR sampled distributions from the theoretical power\-law function\. If \fInum_test\fR is not provided, the test is based on 100 sampled distributions\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIdata_in\fR
+Set of values to fit\. If is equal to \fB\-\fR (dash), read the set from STDIN\.
+.
+.TP
+\fItol\fR
+The acceptable statistical error on the estimation of the exponent\. If omitted, it is set to 0\.1\.
+.
+.TP
+TEST
+If the third parameter is \fBTEST\fR, the program computes an estimate of the p\-value associated to the best\-fit, based on \fInum_test\fR synthetic samples of the same size of the input set\.
+.
+.TP
+\fInum_test\fR
+Number of synthetic samples to use for the estimation of the p\-value of the best fit\.
+.
+.SH "OUTPUT"
+If \fBfitmle\fR is given less than three parameters (i\.e\., if \fBTEST\fR is not specified), the output is a line in the format:
+.
+.IP "" 4
+.
+.nf
+
+ gamma k_min ks
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBgamma\fR is the estimate for the exponent, \fBk_min\fR is the smallest of the input values for which the power\-law behaviour holds, and \fBks\fR is the value of the Kolmogorov\-Smirnov statistics of the best\-fit\.
+.
+.P
+If \fBTEST\fR is specified, the output line contains also the estimate of the p\-value of the best fit:
+.
+.IP "" 4
+.
+.nf
+
+ gamma k_min ks p\-value
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBp\-value\fR is based on \fInum_test\fR samples (or just 100, if \fInum_test\fR is not specified) of the same size of the input, obtained from the theoretical power\-law function computed as a best fit\.
+.
+.SH "EXAMPLES"
+Let us assume 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 the AS level in March 2001)\. The exponent of the best\-fit power\-law distribution can be obtained by using:
+.
+.IP "" 4
+.
+.nf
+
+ $ fitmle AS\-20010316\.net_degs
+ Using discrete fit
+ 2\.06165 6 0\.031626 0\.17
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fB2\.06165\fR is the estimated value of the exponent \fBgamma\fR, \fB6\fR is the minimum degree value for which the power\-law behaviour holds, and \fB0\.031626\fR is the value of the Kolmogorov\-Smirnov statistics of the best\-fit\. The program is also telling us that it decided to use the discrete fitting procedure, since all the values in \fBAS\-20010316\.net_degs\fR are integers\. The latter information is printed to STDERR\.
+.
+.P
+It is possible to compute the p\-value of the estimate by running:
+.
+.IP "" 4
+.
+.nf
+
+ $ fitmle AS\-20010316\.net_degs 0\.1 TEST
+ Using discrete fit
+ 2\.06165 6 0\.031626 0\.17
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+which provides a p\-value equal to 0\.17, meaning that 17% of the synthetic samples showed a value of the KS statistics larger than that of the best\-fit\. The estimation of the p\-value here is based on 100 synthetic samples, since \fInum_test\fR was not provided\. If we allow a slightly larger value of the statistical error on the estimate of the exponent \fBgamma\fR, we obtain different values of \fBgamma\fR and \fBk_min\fR, and a much higher p\-value:
+.
+.IP "" 4
+.
+.nf
+
+ $ fitmle AS\-20010316\.net_degs 0\.15 TEST 1000
+ Using discrete fit
+ 2\.0585 19 0\.0253754 0\.924
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Notice that in this case, the p\-value of the estimate is equal to 0\.924, and is based on 1000 synthetic samples\.
+.
+.SH "SEE ALSO"
+deg_seq(1), power_law(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+A\. Clauset, C\. R\. Shalizi, and M\. E\. J\. Newman\. "Power\-law distributions in empirical data"\. SIAM Rev\. 51, (2007), 661\-703\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 5, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/fitmle.1.html b/doc/fitmle.1.html
new file mode 100644
index 0000000..863099c
--- /dev/null
+++ b/doc/fitmle.1.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>fitmle(1) - Fit a set of values with a power-law distribution</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>fitmle(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>fitmle(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>fitmle</code> - <span class="man-whatis">Fit a set of values with a power-law distribution</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>fitmle</code> <var>data_in</var> [<var>tol</var> [TEST [<var>num_test</var>]]]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>fitmle</code> fits the data points contained in the file <var>data_in</var> with a
+power-law function P(k) ~ k<sup>-gamma</sup>, using the Maximum-Likelihood
+Estimator (MLE). In particular, <code>fitmle</code> finds the exponent <code>gamma</code>
+and the minimum of the values provided on input for which the
+power-law behaviour holds. The second (optional) argument <var>tol</var> sets
+the acceptable statistical error on the estimate of the exponent.</p>
+
+<p>If <code>TEST</code> is provided, the program associates a p-value to the
+goodness of the fit, based on the Kolmogorov-Smirnov statistics
+computed on <var>num_test</var> sampled distributions from the theoretical
+power-law function. If <var>num_test</var> is not provided, the test is based
+on 100 sampled distributions.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt class="flush"><var>data_in</var></dt><dd><p> Set of values to fit. If is equal to <code>-</code> (dash), read the set from
+ STDIN.</p></dd>
+<dt class="flush"><var>tol</var></dt><dd><p> The acceptable statistical error on the estimation of the
+ exponent. If omitted, it is set to 0.1.</p></dd>
+<dt class="flush">TEST</dt><dd><p> If the third parameter is <code>TEST</code>, the program computes an estimate
+ of the p-value associated to the best-fit, based on <var>num_test</var>
+ synthetic samples of the same size of the input set.</p></dd>
+<dt><var>num_test</var></dt><dd><p> Number of synthetic samples to use for the estimation of the
+ p-value of the best fit.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p>If <code>fitmle</code> is given less than three parameters (i.e., if <code>TEST</code> is
+not specified), the output is a line in the format:</p>
+
+<pre><code> gamma k_min ks
+</code></pre>
+
+<p>where <code>gamma</code> is the estimate for the exponent, <code>k_min</code> is the
+smallest of the input values for which the power-law behaviour holds,
+and <code>ks</code> is the value of the Kolmogorov-Smirnov statistics of the
+best-fit.</p>
+
+<p>If <code>TEST</code> is specified, the output line contains also the estimate of
+the p-value of the best fit:</p>
+
+<pre><code> gamma k_min ks p-value
+</code></pre>
+
+<p>where <code>p-value</code> is based on <var>num_test</var> samples (or just 100, if
+<var>num_test</var> is not specified) of the same size of the input, obtained
+from the theoretical power-law function computed as a best fit.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>Let us assume that the file <code>AS-20010316.net_degs</code> contains the degree
+sequence of the data set <code>AS-20010316.net</code> (the graph of the Internet
+at the AS level in March 2001). The exponent of the best-fit power-law
+distribution can be obtained by using:</p>
+
+<pre><code> $ fitmle AS-20010316.net_degs
+ Using discrete fit
+ 2.06165 6 0.031626 0.17
+ $
+</code></pre>
+
+<p>where <code>2.06165</code> is the estimated value of the exponent <code>gamma</code>, <code>6</code> is
+the minimum degree value for which the power-law behaviour holds, and
+<code>0.031626</code> is the value of the Kolmogorov-Smirnov statistics of the
+best-fit. The program is also telling us that it decided to use the
+discrete fitting procedure, since all the values in
+<code>AS-20010316.net_degs</code> are integers. The latter information is printed
+to STDERR.</p>
+
+<p>It is possible to compute the p-value of the estimate by running:</p>
+
+<pre><code> $ fitmle AS-20010316.net_degs 0.1 TEST
+ Using discrete fit
+ 2.06165 6 0.031626 0.17
+ $
+</code></pre>
+
+<p>which provides a p-value equal to 0.17, meaning that 17% of the
+synthetic samples showed a value of the KS statistics larger than that
+of the best-fit. The estimation of the p-value here is based on 100
+synthetic samples, since <var>num_test</var> was not provided. If we allow a
+slightly larger value of the statistical error on the estimate of the
+exponent <code>gamma</code>, we obtain different values of <code>gamma</code> and <code>k_min</code>,
+and a much higher p-value:</p>
+
+<pre><code> $ fitmle AS-20010316.net_degs 0.15 TEST 1000
+ Using discrete fit
+ 2.0585 19 0.0253754 0.924
+ $
+</code></pre>
+
+<p>Notice that in this case, the p-value of the estimate is equal to
+0.924, and is based on 1000 synthetic samples.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="deg_seq.1.html">deg_seq<span class="s">(1)</span></a>, <a class="man-ref" href="power_law.1.html">power_law<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>A. Clauset, C. R. Shalizi, and M. E. J. Newman. "Power-law
+distributions in empirical data". SIAM Rev. 51, (2007), 661-703.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 5, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>fitmle(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/fitmle.md b/doc/fitmle.md
new file mode 100644
index 0000000..cfac74f
--- /dev/null
+++ b/doc/fitmle.md
@@ -0,0 +1,125 @@
+fitmle(1) -- Fit a set of values with a power-law distribution
+======
+
+## SYNOPSIS
+
+`fitmle` <data_in> [<tol> [TEST [<num\_test>]]]
+
+## DESCRIPTION
+
+`fitmle` fits the data points contained in the file <data_in> with a
+power-law function P(k) ~ k^(-gamma), using the Maximum-Likelihood
+Estimator (MLE). In particular, `fitmle` finds the exponent `gamma`
+and the minimum of the values provided on input for which the
+power-law behaviour holds. The second (optional) argument <tol> sets
+the acceptable statistical error on the estimate of the exponent.
+
+If `TEST` is provided, the program associates a p-value to the
+goodness of the fit, based on the Kolmogorov-Smirnov statistics
+computed on <num_test> sampled distributions from the theoretical
+power-law function. If <num_test> is not provided, the test is based
+on 100 sampled distributions.
+
+
+## PARAMETERS
+
+* <data_in>:
+ Set of values to fit. If is equal to `-` (dash), read the set from
+ STDIN.
+
+* <tol>:
+ The acceptable statistical error on the estimation of the
+ exponent. If omitted, it is set to 0.1.
+
+* TEST:
+ If the third parameter is `TEST`, the program computes an estimate
+ of the p-value associated to the best-fit, based on <num_test>
+ synthetic samples of the same size of the input set.
+
+* <num_test>:
+ Number of synthetic samples to use for the estimation of the
+ p-value of the best fit.
+
+## OUTPUT
+
+If `fitmle` is given less than three parameters (i.e., if `TEST` is
+not specified), the output is a line in the format:
+
+ gamma k_min ks
+
+where `gamma` is the estimate for the exponent, `k_min` is the
+smallest of the input values for which the power-law behaviour holds,
+and `ks` is the value of the Kolmogorov-Smirnov statistics of the
+best-fit.
+
+If `TEST` is specified, the output line contains also the estimate of
+the p-value of the best fit:
+
+ gamma k_min ks p-value
+
+where `p-value` is based on <num_test> samples (or just 100, if
+<num_test> is not specified) of the same size of the input, obtained
+from the theoretical power-law function computed as a best fit.
+
+## EXAMPLES
+
+Let us assume that the file `AS-20010316.net_degs` contains the degree
+sequence of the data set `AS-20010316.net` (the graph of the Internet
+at the AS level in March 2001). The exponent of the best-fit power-law
+distribution can be obtained by using:
+
+ $ fitmle AS-20010316.net_degs
+ Using discrete fit
+ 2.06165 6 0.031626 0.17
+ $
+
+where `2.06165` is the estimated value of the exponent `gamma`, `6` is
+the minimum degree value for which the power-law behaviour holds, and
+`0.031626` is the value of the Kolmogorov-Smirnov statistics of the
+best-fit. The program is also telling us that it decided to use the
+discrete fitting procedure, since all the values in
+`AS-20010316.net_degs` are integers. The latter information is printed
+to STDERR.
+
+It is possible to compute the p-value of the estimate by running:
+
+ $ fitmle AS-20010316.net_degs 0.1 TEST
+ Using discrete fit
+ 2.06165 6 0.031626 0.17
+ $
+
+which provides a p-value equal to 0.17, meaning that 17% of the
+synthetic samples showed a value of the KS statistics larger than that
+of the best-fit. The estimation of the p-value here is based on 100
+synthetic samples, since <num_test> was not provided. If we allow a
+slightly larger value of the statistical error on the estimate of the
+exponent `gamma`, we obtain different values of `gamma` and `k_min`,
+and a much higher p-value:
+
+ $ fitmle AS-20010316.net_degs 0.15 TEST 1000
+ Using discrete fit
+ 2.0585 19 0.0253754 0.924
+ $
+
+Notice that in this case, the p-value of the estimate is equal to
+0.924, and is based on 1000 synthetic samples.
+
+## SEE ALSO
+
+deg_seq(1), power_law(1)
+
+
+## REFERENCES
+
+* A\. Clauset, C. R. Shalizi, and M. E. J. Newman. "Power-law
+ distributions in empirical data". SIAM Rev. 51, (2007), 661-703.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 5, Cambridge University Press
+ (2017)
+
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/gn.1 b/doc/gn.1
new file mode 100644
index 0000000..cf112c5
--- /dev/null
+++ b/doc/gn.1
@@ -0,0 +1,110 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "GN" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBgn\fR \- Find communities using the Girvan\-Newman algorithm
+.
+.SH "SYNOPSIS"
+\fBgn\fR \fIgraph_in\fR
+.
+.SH "DESCRIPTION"
+\fBgn\fR finds the communities in \fIgraph_in\fR using the Girvan\-Newman algorithm, based on the successive removal of edges with high betweenness\. The program prints on STDOUT the partition corresponding to the highest value of the modularity function, and reports on STDERR the number of communities after each edge removal and the corresponding value of modularity\.
+.
+.P
+\fBN\.B\.\fR: the program recomputes the edge betweenness of the graph after the removal of each edge, so it is not feasible to use it on large graphs\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+undirected input graph (edge list)\. If is equal to \fB\-\fR (dash), read the edge list from STDIN\.
+.
+.SH "OUTPUT"
+The program prints on STDOUT the partition corresponding to the highest value of modularity, in the format:
+.
+.IP "" 4
+.
+.nf
+
+ ## nc: NUM_COMM Q_max: Q_MAX
+ node_1 comm_1
+ node_2 comm_2
+ node_3 comm_3
+ \.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBcomm_i\fR is the community to which \fBnode_i\fR belongs\. The first output line reports the number of communities \fBNUM_COMM\fR and the corresponding value of modularity \fBQ_MAX\fR of the partition\.
+.
+.P
+The program prints on STDERR the number of communities (connected components) after the removal of each edge, and the corresponding value of modularity, in the format:
+.
+.IP "" 4
+.
+.nf
+
+ nc_1 Q_1
+ nc_2 Q_2
+ nc_3 Q_3
+ \.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBnc_i\fR is the number of communities after the i\-th edge has been removed and \fBQ_i\fR is the corresponding value of modularity\.
+.
+.SH "EXAMPLES"
+We can use \fBgn\fR to find communities in the graph \fBkarate_club_unweighted\.txt\fR (Zachary Karate Club network) with the command:
+.
+.IP "" 4
+.
+.nf
+
+ $ gn karate_club_unweighted\.net 2> karate_gn_trace
+ ### nc: 4 Q_max: 0\.365631
+ 0 1
+ 1 1
+ 2 2
+ 3 1
+ 4 3
+ 5 3
+ 6 3
+ \.\.\.
+ 30 2
+ 31 2
+ 32 2
+ 33 2
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+In this run, the command has found a partition with 4 communities corrisponding to a modularity Q=0\.365631\. Notice that node 0, 1, 3, are in community 1, node 2 is in community 2, node 4,5,6, are in community 3 and so forth\. In general, different runs will provide different partitions, since any tie in betweenness values is broke by choosing one of the edges with equal betweenness uniformly at random\. In this example, we have chosen to save the information about number of communities and modularity after each edge removal in the file \fBkarate_gn_trace\fR\.
+.
+.SH "SEE ALSO"
+modularity(1), cnm(1), label_prop(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+M\. Girvan and M\. E\. J\. Newman\. "Community structure in social and biological networks"\. P\. Natl\. Acad\. Sci\. USA 99 (2002), 7821\-\-7826\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 17, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 9, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/gn.1.html b/doc/gn.1.html
new file mode 100644
index 0000000..0b1c476
--- /dev/null
+++ b/doc/gn.1.html
@@ -0,0 +1,201 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>gn(1) - Find communities using the Girvan-Newman algorithm</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>gn(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>gn(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>gn</code> - <span class="man-whatis">Find communities using the Girvan-Newman algorithm</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>gn</code> <var>graph_in</var></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>gn</code> finds the communities in <var>graph_in</var> using the Girvan-Newman
+algorithm, based on the successive removal of edges with high
+betweenness. The program prints on STDOUT the partition corresponding
+to the highest value of the modularity function, and reports on STDERR
+the number of communities after each edge removal and the
+corresponding value of modularity.</p>
+
+<p><code>N.B.</code>: the program recomputes the edge betweenness of the graph after
+the removal of each edge, so it is not feasible to use it on large
+graphs.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd> undirected input graph (edge list). If is equal to <code>-</code> (dash), read
+ the edge list from STDIN.</dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p>The program prints on STDOUT the partition corresponding to the
+highest value of modularity, in the format:</p>
+
+<pre><code> ## nc: NUM_COMM Q_max: Q_MAX
+ node_1 comm_1
+ node_2 comm_2
+ node_3 comm_3
+ ...
+</code></pre>
+
+<p>where <code>comm_i</code> is the community to which <code>node_i</code> belongs. The first
+output line reports the number of communities <code>NUM_COMM</code> and the
+corresponding value of modularity <code>Q_MAX</code> of the partition.</p>
+
+<p>The program prints on STDERR the number of communities (connected
+components) after the removal of each edge, and the corresponding
+value of modularity, in the format:</p>
+
+<pre><code> nc_1 Q_1
+ nc_2 Q_2
+ nc_3 Q_3
+ ....
+</code></pre>
+
+<p>where <code>nc_i</code> is the number of communities after the i-th edge has been
+removed and <code>Q_i</code> is the corresponding value of modularity.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>We can use <code>gn</code> to find communities in the graph <code>karate_club_unweighted.txt</code>
+(Zachary Karate Club network) with the command:</p>
+
+<pre><code> $ gn karate_club_unweighted.net 2&gt; karate_gn_trace
+ ### nc: 4 Q_max: 0.365631
+ 0 1
+ 1 1
+ 2 2
+ 3 1
+ 4 3
+ 5 3
+ 6 3
+ ...
+ 30 2
+ 31 2
+ 32 2
+ 33 2
+ $
+</code></pre>
+
+<p>In this run, the command has found a partition with 4 communities
+corrisponding to a modularity Q=0.365631. Notice that node 0, 1, 3,
+are in community 1, node 2 is in community 2, node 4,5,6, are in
+community 3 and so forth. In general, different runs will provide
+different partitions, since any tie in betweenness values is broke by
+choosing one of the edges with equal betweenness uniformly at
+random. In this example, we have chosen to save the information about
+number of communities and modularity after each edge removal in the
+file <code>karate_gn_trace</code>.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="modularity.1.html">modularity<span class="s">(1)</span></a>, <a class="man-ref" href="cnm.1.html">cnm<span class="s">(1)</span></a>, <a class="man-ref" href="label_prop.1.html">label_prop<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>M. Girvan and M. E. J. Newman. "Community structure in social and
+biological networks". P. Natl. Acad. Sci. USA 99 (2002), 7821--7826.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 17, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 9, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>gn(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/gn.md b/doc/gn.md
new file mode 100644
index 0000000..089a9d9
--- /dev/null
+++ b/doc/gn.md
@@ -0,0 +1,104 @@
+gn(1) -- Find communities using the Girvan-Newman algorithm
+======
+
+## SYNOPSIS
+
+`gn` <graph_in>
+
+## DESCRIPTION
+
+`gn` finds the communities in <graph_in> using the Girvan-Newman
+algorithm, based on the successive removal of edges with high
+betweenness. The program prints on STDOUT the partition corresponding
+to the highest value of the modularity function, and reports on STDERR
+the number of communities after each edge removal and the
+corresponding value of modularity.
+
+`N.B.`: the program recomputes the edge betweenness of the graph after
+the removal of each edge, so it is not feasible to use it on large
+graphs.
+
+## PARAMETERS
+
+* <graph_in>:
+ undirected input graph (edge list). If is equal to `-` (dash), read
+ the edge list from STDIN.
+
+## OUTPUT
+
+The program prints on STDOUT the partition corresponding to the
+highest value of modularity, in the format:
+
+ ## nc: NUM_COMM Q_max: Q_MAX
+ node_1 comm_1
+ node_2 comm_2
+ node_3 comm_3
+ ...
+
+where `comm_i` is the community to which `node_i` belongs. The first
+output line reports the number of communities `NUM_COMM` and the
+corresponding value of modularity `Q_MAX` of the partition.
+
+The program prints on STDERR the number of communities (connected
+components) after the removal of each edge, and the corresponding
+value of modularity, in the format:
+
+ nc_1 Q_1
+ nc_2 Q_2
+ nc_3 Q_3
+ ....
+
+where `nc_i` is the number of communities after the i-th edge has been
+removed and `Q_i` is the corresponding value of modularity.
+
+## EXAMPLES
+
+We can use `gn` to find communities in the graph `karate_club_unweighted.txt`
+(Zachary Karate Club network) with the command:
+
+ $ gn karate_club_unweighted.net 2> karate_gn_trace
+ ### nc: 4 Q_max: 0.365631
+ 0 1
+ 1 1
+ 2 2
+ 3 1
+ 4 3
+ 5 3
+ 6 3
+ ...
+ 30 2
+ 31 2
+ 32 2
+ 33 2
+ $
+
+In this run, the command has found a partition with 4 communities
+corrisponding to a modularity Q=0.365631. Notice that node 0, 1, 3,
+are in community 1, node 2 is in community 2, node 4,5,6, are in
+community 3 and so forth. In general, different runs will provide
+different partitions, since any tie in betweenness values is broke by
+choosing one of the edges with equal betweenness uniformly at
+random. In this example, we have chosen to save the information about
+number of communities and modularity after each edge removal in the
+file `karate_gn_trace`.
+
+## SEE ALSO
+
+modularity(1), cnm(1), label_prop(1)
+
+## REFERENCES
+
+* M\. Girvan and M. E. J. Newman. "Community structure in social and
+ biological networks". P. Natl. Acad. Sci. USA 99 (2002), 7821--7826.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 17, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 9, Cambridge University Press
+ (2017)
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/graph_info.1 b/doc/graph_info.1
new file mode 100644
index 0000000..6eaaec3
--- /dev/null
+++ b/doc/graph_info.1
@@ -0,0 +1,48 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "GRAPH_INFO" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBgraph_info\fR \- Print basic information about a graph
+.
+.SH "SYNOPSIS"
+\fBgraph_info\fR \fIgraph_in\fR
+.
+.SH "DESCRIPTION"
+\fBgraph_info\fR prints the number of nodes, number of edges, average degree, and average squared degree of \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\.
+.
+.SH "OUTPUT"
+The program prints on STDOUT a single line in the format:
+.
+.IP "" 4
+.
+.nf
+
+ N K avg_k avg_k2
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBN\fR is the number of nodes, \fBK\fR is the number of edges, \fBavg_k\fR is the average degree, and \fBavg_k2\fR is the average squared degree of \fIgraph_in\fR\.
+.
+.SH "SEE ALSO"
+clust(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/graph_info.1.html b/doc/graph_info.1.html
new file mode 100644
index 0000000..5f41f36
--- /dev/null
+++ b/doc/graph_info.1.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>graph_info(1) - Print basic information about a graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>graph_info(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>graph_info(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>graph_info</code> - <span class="man-whatis">Print basic information about a graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>graph_info</code> <var>graph_in</var></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>graph_info</code> prints the number of nodes, number of edges, average
+degree, and average squared degree of <var>graph_in</var>.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd> undirected input graph (edge list). If is equal to <code>-</code> (dash), read
+ the edge list from STDIN.</dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p>The program prints on STDOUT a single line in the format:</p>
+
+<pre><code> N K avg_k avg_k2
+</code></pre>
+
+<p>where <code>N</code> is the number of nodes, <code>K</code> is the number of edges, <code>avg_k</code>
+is the average degree, and <code>avg_k2</code> is the average squared degree of <var>graph_in</var>.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="clust.1.html">clust<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Cambridge University Press (2017)</li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>graph_info(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/graph_info.md b/doc/graph_info.md
new file mode 100644
index 0000000..d353a81
--- /dev/null
+++ b/doc/graph_info.md
@@ -0,0 +1,41 @@
+graph_info(1) -- Print basic information about a graph
+======
+
+## SYNOPSIS
+
+`graph_info` <graph_in>
+
+## DESCRIPTION
+
+`graph_info` prints the number of nodes, number of edges, average
+degree, and average squared degree of <graph_in>.
+
+
+## PARAMETERS
+
+* <graph_in>:
+ undirected input graph (edge list). If is equal to `-` (dash), read
+ the edge list from STDIN.
+
+## OUTPUT
+
+The program prints on STDOUT a single line in the format:
+
+ N K avg_k avg_k2
+
+where `N` is the number of nodes, `K` is the number of edges, `avg_k`
+is the average degree, and `avg_k2` is the average squared degree of <graph_in>.
+
+## SEE ALSO
+
+clust(1)
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Cambridge University Press (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/hv_net.1 b/doc/hv_net.1
new file mode 100644
index 0000000..70cf788
--- /dev/null
+++ b/doc/hv_net.1
@@ -0,0 +1,83 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "HV_NET" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBhv_net\fR \- Sample a random graph with an assigned joint degree distribution
+.
+.SH "SYNOPSIS"
+\fBhv_net\fR \fIgraph_in\fR [SHOW]
+.
+.SH "DESCRIPTION"
+\fBhv_net\fR samples a random graph whose joint degree distribution is equal to that of another graph provided as input, using the hidden\-variable model proposed by Boguna ans Pastor\-Satorras\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+File containing the edge list of the existing graph\. If equal to \'\-\' (dash), read the edge list from STDIN\.
+.
+.TP
+SHOW
+If the second parameter is equal to \fBSHOW\fR, the program prints on STDERR the hidden variable and actual degree of each node\.
+.
+.SH "EXAMPLES"
+Let us assume that we want to create a graph whose joint degree distribution is equal to that of the graph contained in \fBAS\-20010316\.net\fR (i\.e\., the graph of the Internet at the AS level in March 2001)\. We can use the command:
+.
+.IP "" 4
+.
+.nf
+
+ $ hv_net AS\-20010316\.net > AS\-20010316\.net_rand
+.
+.fi
+.
+.IP "" 0
+.
+.P
+which will sample a random graph with the same joint\-degree distribution and will save its edge list in the file \fBAS\-20010316\.net_rand\fR (notice the STDOUT redirection operator \fB>\fR)\. Additionally, we can also save the values of the hidden variables and actual degrees of the nodes by specifying \fBSHOW\fR as a second parameter:
+.
+.IP "" 4
+.
+.nf
+
+ $ hv_net AS\-20010316\.net SHOW > AS\-20010316\.net_rand 2>AS\-20010316\.net_rand_hv
+.
+.fi
+.
+.IP "" 0
+.
+.P
+In this case, the file \fBAS\-20010316\.net_rand_hv\fR will contain the values of the hidden variable of each node and of the actual degree of the node in the sampled graph, in the format:
+.
+.IP "" 4
+.
+.nf
+
+ h1 k1
+ h2 k2
+ \.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.SH "SEE ALSO"
+conf_model_deg(1), conf_model_deg_nocheck(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+M\. Boguna and R\. Pastor\-Satorras\. "Class of correlated random networks with hidden variables"\. Phys\. Rev\. E 68 (2003), 036112\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 7, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 14, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/hv_net.1.html b/doc/hv_net.1.html
new file mode 100644
index 0000000..d01545c
--- /dev/null
+++ b/doc/hv_net.1.html
@@ -0,0 +1,163 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>hv_net(1) - Sample a random graph with an assigned joint degree distribution</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>hv_net(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>hv_net(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>hv_net</code> - <span class="man-whatis">Sample a random graph with an assigned joint degree distribution</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>hv_net</code> <var>graph_in</var> [SHOW]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>hv_net</code> samples a random graph whose joint degree distribution is
+equal to that of another graph provided as input, using the
+hidden-variable model proposed by Boguna ans Pastor-Satorras.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> File containing the edge list of the existing graph. If equal to
+ '-' (dash), read the edge list from STDIN.</p></dd>
+<dt class="flush">SHOW</dt><dd><p> If the second parameter is equal to <code>SHOW</code>, the program prints on
+ STDERR the hidden variable and actual degree of each node.</p></dd>
+</dl>
+
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>Let us assume that we want to create a graph whose joint degree
+distribution is equal to that of the graph contained in
+<code>AS-20010316.net</code> (i.e., the graph of the Internet at the AS level in
+March 2001). We can use the command:</p>
+
+<pre><code> $ hv_net AS-20010316.net &gt; AS-20010316.net_rand
+</code></pre>
+
+<p>which will sample a random graph with the same joint-degree
+distribution and will save its edge list in the file
+<code>AS-20010316.net_rand</code> (notice the STDOUT redirection operator
+<code>&gt;</code>). Additionally, we can also save the values of the hidden
+variables and actual degrees of the nodes by specifying <code>SHOW</code> as a
+second parameter:</p>
+
+<pre><code> $ hv_net AS-20010316.net SHOW &gt; AS-20010316.net_rand 2&gt;AS-20010316.net_rand_hv
+</code></pre>
+
+<p>In this case, the file <code>AS-20010316.net_rand_hv</code> will contain the
+values of the hidden variable of each node and of the actual degree of
+the node in the sampled graph, in the format:</p>
+
+<pre><code> h1 k1
+ h2 k2
+ ....
+</code></pre>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="conf_model_deg.1.html">conf_model_deg<span class="s">(1)</span></a>, <a class="man-ref" href="conf_model_deg_nocheck.1.html">conf_model_deg_nocheck<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>M. Boguna and R. Pastor-Satorras. "Class of correlated random
+networks with hidden variables". Phys. Rev. E 68 (2003), 036112.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 7, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 14, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>hv_net(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/hv_net.md b/doc/hv_net.md
new file mode 100644
index 0000000..89bcce1
--- /dev/null
+++ b/doc/hv_net.md
@@ -0,0 +1,72 @@
+hv_net(1) -- Sample a random graph with an assigned joint degree distribution
+======
+
+## SYNOPSIS
+
+`hv_net` <graph_in> [SHOW]
+
+## DESCRIPTION
+
+`hv_net` samples a random graph whose joint degree distribution is
+equal to that of another graph provided as input, using the
+hidden-variable model proposed by Boguna ans Pastor-Satorras.
+
+## PARAMETERS
+
+* <graph_in>:
+ File containing the edge list of the existing graph. If equal to
+ '-' (dash), read the edge list from STDIN.
+
+* SHOW:
+ If the second parameter is equal to `SHOW`, the program prints on
+ STDERR the hidden variable and actual degree of each node.
+
+## EXAMPLES
+
+Let us assume that we want to create a graph whose joint degree
+distribution is equal to that of the graph contained in
+`AS-20010316.net` (i.e., the graph of the Internet at the AS level in
+March 2001). We can use the command:
+
+ $ hv_net AS-20010316.net > AS-20010316.net_rand
+
+which will sample a random graph with the same joint-degree
+distribution and will save its edge list in the file
+`AS-20010316.net_rand` (notice the STDOUT redirection operator
+`>`). Additionally, we can also save the values of the hidden
+variables and actual degrees of the nodes by specifying `SHOW` as a
+second parameter:
+
+ $ hv_net AS-20010316.net SHOW > AS-20010316.net_rand 2>AS-20010316.net_rand_hv
+
+In this case, the file `AS-20010316.net_rand_hv` will contain the
+values of the hidden variable of each node and of the actual degree of
+the node in the sampled graph, in the format:
+
+ h1 k1
+ h2 k2
+ ....
+
+
+## SEE ALSO
+
+conf_model_deg(1), conf_model_deg_nocheck(1)
+
+## REFERENCES
+
+* M\. Boguna and R. Pastor-Satorras. "Class of correlated random
+ networks with hidden variables". Phys. Rev. E 68 (2003), 036112.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 7, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 14, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
+
diff --git a/doc/johnson_cycles.1 b/doc/johnson_cycles.1
new file mode 100644
index 0000000..1bed7ad
--- /dev/null
+++ b/doc/johnson_cycles.1
@@ -0,0 +1,205 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "JOHNSON_CYCLES" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBjohnson_cycles\fR \- Enumerate the simple cycles of a graph
+.
+.SH "SYNOPSIS"
+\fBjohnson_cycles\fR \fIgraph_in\fR [\fImax_length\fR [SHOW]]
+.
+.SH "DESCRIPTION"
+\fBjohnson_cycles\fR enumerates all the simple cycles of the graph given on input, and prints the total number of cycles of each length\. If \fImax_length\fR is provided, \fBjohnson_cycles\fR ignores any cycle whose length is larger than \fImax_length\fR\. If \fBSHOW\fR is given as third argument, all the found cycles are printed on STDERR as soon as they are found\.
+.
+.SH "PARAMETERS"
+.
+.IP "\(bu" 4
+\fIgraph_in\fR: input graph (edge list) if equal to \fB\-\fR (dash), read the edge list from STDIN\.
+.
+.IP "\(bu" 4
+\fImax_length\fR: The maximum length of cycles to count/print\. If not provided, \fBjohnson_cycles\fR tries to find all the cycles of the graph (see the \fBWARNING\fR in the section \fIOUTPUT\fR below)\.
+.
+.IP "\(bu" 4
+SHOW: If the third (optional) parameter is equal to \fBSHOW\fR, the program will dump on the standard error all the cycles found\.
+.
+.IP "" 0
+.
+.SH "OUTPUT"
+\fBjohnson_cycles\fR prints on the standard output the number of cycles of each length, in the format:
+.
+.IP "" 4
+.
+.nf
+
+ 2 N_2
+ 3 N_3
+ 4 N_4
+ 5 N_5
+ \.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where 2, 3, 4, 5\.\.\. is the cycle lengths and N_2, N_3, N_4, N_5\.\.\. is (twice) the number of cycles of that length\. If \fBSHOW\fR is given, each cycle is also printed on STDERR as soon as it is found, in the format:
+.
+.IP "" 4
+.
+.nf
+
+node_l node_(l\-1) node_(l\-2) \.\.\. node_0
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBnode_l\fR, \fBnode_(l\-1)\fR, etc\. are the labels of the nodes belonging to the cycle which starts at node \fBnode_0\fR\.
+.
+.P
+\fBWARNING\fR: If the second parameter \fImax_length\fR is not provided, \fBjohnson_cycles\fR will try to enumerate \fBall\fR the cycles of the graph\. In general, this might take a time \fBexponential\fR in the number of nodes and edges of the graph\. As a consequence, specifying a maximum length is \fBhighly recommended\fR if you are not interested in finding the number of cycles of any length\.
+.
+.SH "EXAMPLES"
+We can count the cycle of any length in the graph of Florentine families using the command:
+.
+.IP "" 4
+.
+.nf
+
+ $ johnson_cycles florentine\.net
+ 2 20
+ 3 6
+ 4 4
+ 5 6
+ 6 10
+ 7 20
+ 8 22
+ 9 8
+ 10 2
+ 11 0
+ 12 0
+ 13 0
+ 14 0
+ 15 0
+ 16 0
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The output means that the graph has 20 cycles of length 2 (edges), 6/2=3 cycles of length 3, 4/2=2 cycles of length 4, and so on\. We could otherwise focus on the cycles of length up to 5 and have each cycle printed on output:
+.
+.IP "" 4
+.
+.nf
+
+ $ johnson_cycles florentine\.net 5 SHOW
+ 8 0
+ 5 1
+ 8 15 6 1
+ 8 12 15 6 1
+ 6 1
+ 6 15 12 8 1
+ 6 15 8 1
+ 8 1
+ 8 12 14 4 2
+ \.\.\.\.
+ 15 12
+ 2 20
+ 3 6
+ 4 4
+ 5 6
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Apart from the degenerate cycles like "8 0", "5 1", etc\., corresponding to the cycles obtained by traversing the same undirected edge in the two possible directions, we see in that list some of the cycles of length 4 (such as "8 15 6 1") and of length 5 (such as "8 12 15 6 1")\.
+.
+.P
+The enumeration of all the cycles is normally impractical on larger graphs, so it is highly recommended to limit the search to short sizes\. For instance, the command:
+.
+.IP "" 4
+.
+.nf
+
+ $ johnson_cycles er_1000_5000\.net 6
+ 2 5000
+ 3 340
+ 4 2406
+ 5 19416
+ 6 160554
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+will require less than one second on a modern desktop computer, but the command:
+.
+.IP "" 4
+.
+.nf
+
+ $ johnson_cycles er_1000_5000\.net 7
+ 2 5000
+ 3 340
+ 4 2406
+ 5 19416
+ 6 160554
+ 7 1360104
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+will probably take about 15 seconds, while:
+.
+.IP "" 4
+.
+.nf
+
+ $ johnson_cycles er_1000_5000\.net 8
+ 2 5000
+ 3 340
+ 4 2406
+ 5 19416
+ 6 160554
+ 7 1360104
+ 8 11743500
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+will run for more than 2 minutes, and larger cycle lengths will require exponentially more time\.
+.
+.SH "SEE ALSO"
+f3m(1), shortest(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+D\. B\. Johnson\. "Finding All the Elementary Circuits of a Directed Graph"\. SIAM J\. Comput\. 4 (1975), 77\-84\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 8, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 15, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/johnson_cycles.1.html b/doc/johnson_cycles.1.html
new file mode 100644
index 0000000..225f95c
--- /dev/null
+++ b/doc/johnson_cycles.1.html
@@ -0,0 +1,268 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>johnson_cycles(1) - Enumerate the simple cycles of a graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>johnson_cycles(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>johnson_cycles(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>johnson_cycles</code> - <span class="man-whatis">Enumerate the simple cycles of a graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>johnson_cycles</code> <var>graph_in</var> [<var>max_length</var> [SHOW]]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>johnson_cycles</code> enumerates all the simple cycles of the graph given
+on input, and prints the total number of cycles of each length. If
+<var>max_length</var> is provided, <code>johnson_cycles</code> ignores any cycle whose
+length is larger than <var>max_length</var>. If <code>SHOW</code> is given as third
+argument, all the found cycles are printed on STDERR as soon as they
+are found.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<ul>
+<li><p><var>graph_in</var>:
+ input graph (edge list) if equal to <code>-</code> (dash), read the edge list
+ from STDIN.</p></li>
+<li><p><var>max_length</var>: The maximum length of cycles to count/print. If not
+ provided, <code>johnson_cycles</code> tries to find all the cycles of the
+ graph (see the <strong>WARNING</strong> in the section <a href="#OUTPUT" title="OUTPUT" data-bare-link="true">OUTPUT</a> below).</p></li>
+<li><p>SHOW:
+ If the third (optional) parameter is equal to <code>SHOW</code>, the program
+ will dump on the standard error all the cycles found.</p></li>
+</ul>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>johnson_cycles</code> prints on the standard output the number of cycles of
+each length, in the format:</p>
+
+<pre><code> 2 N_2
+ 3 N_3
+ 4 N_4
+ 5 N_5
+ ...
+</code></pre>
+
+<p>where 2, 3, 4, 5... is the cycle lengths and N_2, N_3, N_4, N_5... is
+(twice) the number of cycles of that length. If <code>SHOW</code> is given, each
+cycle is also printed on STDERR as soon as it is found, in the format:</p>
+
+<pre><code>node_l node_(l-1) node_(l-2) ... node_0
+</code></pre>
+
+<p>where <code>node_l</code>, <code>node_(l-1)</code>, etc. are the labels of the nodes
+belonging to the cycle which starts at node <code>node_0</code>.</p>
+
+<p><strong>WARNING</strong>: If the second parameter <var>max_length</var> is not provided,
+ <code>johnson_cycles</code> will try to enumerate <strong>all</strong> the cycles of the
+ graph. In general, this might take a time <strong>exponential</strong> in the
+ number of nodes and edges of the graph. As a consequence, specifying
+ a maximum length is <strong>highly recommended</strong> if you are not interested
+ in finding the number of cycles of any length.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>We can count the cycle of any length in the graph of Florentine
+families using the command:</p>
+
+<pre><code> $ johnson_cycles florentine.net
+ 2 20
+ 3 6
+ 4 4
+ 5 6
+ 6 10
+ 7 20
+ 8 22
+ 9 8
+ 10 2
+ 11 0
+ 12 0
+ 13 0
+ 14 0
+ 15 0
+ 16 0
+ $
+</code></pre>
+
+<p>The output means that the graph has 20 cycles of length 2 (edges),
+6/2=3 cycles of length 3, 4/2=2 cycles of length 4, and so on. We
+could otherwise focus on the cycles of length up to 5 and have each
+cycle printed on output:</p>
+
+<pre><code> $ johnson_cycles florentine.net 5 SHOW
+ 8 0
+ 5 1
+ 8 15 6 1
+ 8 12 15 6 1
+ 6 1
+ 6 15 12 8 1
+ 6 15 8 1
+ 8 1
+ 8 12 14 4 2
+ ....
+ 15 12
+ 2 20
+ 3 6
+ 4 4
+ 5 6
+ $
+</code></pre>
+
+<p>Apart from the degenerate cycles like "8 0", "5 1", etc.,
+corresponding to the cycles obtained by traversing the same undirected
+edge in the two possible directions, we see in that list some of the
+cycles of length 4 (such as "8 15 6 1") and of length 5 (such as "8 12
+15 6 1").</p>
+
+<p>The enumeration of all the cycles is normally impractical on larger
+graphs, so it is highly recommended to limit the search to short
+sizes. For instance, the command:</p>
+
+<pre><code> $ johnson_cycles er_1000_5000.net 6
+ 2 5000
+ 3 340
+ 4 2406
+ 5 19416
+ 6 160554
+ $
+</code></pre>
+
+<p>will require less than one second on a modern desktop computer, but
+the command:</p>
+
+<pre><code> $ johnson_cycles er_1000_5000.net 7
+ 2 5000
+ 3 340
+ 4 2406
+ 5 19416
+ 6 160554
+ 7 1360104
+ $
+</code></pre>
+
+<p>will probably take about 15 seconds, while:</p>
+
+<pre><code> $ johnson_cycles er_1000_5000.net 8
+ 2 5000
+ 3 340
+ 4 2406
+ 5 19416
+ 6 160554
+ 7 1360104
+ 8 11743500
+ $
+</code></pre>
+
+<p>will run for more than 2 minutes, and larger cycle lengths will
+require exponentially more time.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="f3m.1.html">f3m<span class="s">(1)</span></a>, <a class="man-ref" href="shortest.1.html">shortest<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>D. B. Johnson. "Finding All the Elementary Circuits of a Directed
+Graph". SIAM J. Comput. 4 (1975), 77-84.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 8, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 15, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>johnson_cycles(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/johnson_cycles.md b/doc/johnson_cycles.md
new file mode 100644
index 0000000..bf2d92f
--- /dev/null
+++ b/doc/johnson_cycles.md
@@ -0,0 +1,171 @@
+johnson_cycles(1) -- Enumerate the simple cycles of a graph
+======
+
+## SYNOPSIS
+
+`johnson_cycles` <graph_in> [<max_length> [SHOW]]
+
+## DESCRIPTION
+
+`johnson_cycles` enumerates all the simple cycles of the graph given
+on input, and prints the total number of cycles of each length. If
+<max_length> is provided, `johnson_cycles` ignores any cycle whose
+length is larger than <max_length>. If `SHOW` is given as third
+argument, all the found cycles are printed on STDERR as soon as they
+are found.
+
+## PARAMETERS
+
+* <graph_in>:
+ input graph (edge list) if equal to `-` (dash), read the edge list
+ from STDIN.
+
+* <max_length>: The maximum length of cycles to count/print. If not
+ provided, `johnson_cycles` tries to find all the cycles of the
+ graph (see the **WARNING** in the section [OUTPUT][] below).
+
+* SHOW:
+ If the third (optional) parameter is equal to `SHOW`, the program
+ will dump on the standard error all the cycles found.
+
+## OUTPUT
+
+`johnson_cycles` prints on the standard output the number of cycles of
+each length, in the format:
+
+ 2 N_2
+ 3 N_3
+ 4 N_4
+ 5 N_5
+ ...
+
+where 2, 3, 4, 5... is the cycle lengths and N_2, N_3, N_4, N_5... is
+(twice) the number of cycles of that length. If `SHOW` is given, each
+cycle is also printed on STDERR as soon as it is found, in the format:
+
+ node_l node_(l-1) node_(l-2) ... node_0
+
+where `node_l`, `node_(l-1)`, etc. are the labels of the nodes
+belonging to the cycle which starts at node `node_0`.
+
+**WARNING**: If the second parameter <max_length> is not provided,
+ `johnson_cycles` will try to enumerate **all** the cycles of the
+ graph. In general, this might take a time **exponential** in the
+ number of nodes and edges of the graph. As a consequence, specifying
+ a maximum length is **highly recommended** if you are not interested
+ in finding the number of cycles of any length.
+
+
+## EXAMPLES
+
+We can count the cycle of any length in the graph of Florentine
+families using the command:
+
+ $ johnson_cycles florentine.net
+ 2 20
+ 3 6
+ 4 4
+ 5 6
+ 6 10
+ 7 20
+ 8 22
+ 9 8
+ 10 2
+ 11 0
+ 12 0
+ 13 0
+ 14 0
+ 15 0
+ 16 0
+ $
+
+The output means that the graph has 20 cycles of length 2 (edges),
+6/2=3 cycles of length 3, 4/2=2 cycles of length 4, and so on. We
+could otherwise focus on the cycles of length up to 5 and have each
+cycle printed on output:
+
+ $ johnson_cycles florentine.net 5 SHOW
+ 8 0
+ 5 1
+ 8 15 6 1
+ 8 12 15 6 1
+ 6 1
+ 6 15 12 8 1
+ 6 15 8 1
+ 8 1
+ 8 12 14 4 2
+ ....
+ 15 12
+ 2 20
+ 3 6
+ 4 4
+ 5 6
+ $
+
+Apart from the degenerate cycles like "8 0", "5 1", etc.,
+corresponding to the cycles obtained by traversing the same undirected
+edge in the two possible directions, we see in that list some of the
+cycles of length 4 (such as "8 15 6 1") and of length 5 (such as "8 12
+15 6 1").
+
+The enumeration of all the cycles is normally impractical on larger
+graphs, so it is highly recommended to limit the search to short
+sizes. For instance, the command:
+
+ $ johnson_cycles er_1000_5000.net 6
+ 2 5000
+ 3 340
+ 4 2406
+ 5 19416
+ 6 160554
+ $
+
+will require less than one second on a modern desktop computer, but
+the command:
+
+ $ johnson_cycles er_1000_5000.net 7
+ 2 5000
+ 3 340
+ 4 2406
+ 5 19416
+ 6 160554
+ 7 1360104
+ $
+
+will probably take about 15 seconds, while:
+
+ $ johnson_cycles er_1000_5000.net 8
+ 2 5000
+ 3 340
+ 4 2406
+ 5 19416
+ 6 160554
+ 7 1360104
+ 8 11743500
+ $
+
+will run for more than 2 minutes, and larger cycle lengths will
+require exponentially more time.
+
+
+## SEE ALSO
+
+f3m(1), shortest(1)
+
+## REFERENCES
+
+* D\. B. Johnson. "Finding All the Elementary Circuits of a Directed
+ Graph". SIAM J. Comput. 4 (1975), 77-84.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 8, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 15, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/knn.1 b/doc/knn.1
new file mode 100644
index 0000000..b3a63db
--- /dev/null
+++ b/doc/knn.1
@@ -0,0 +1,158 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "KNN" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBknn\fR \- Compute the average nearest neighbours degree function
+.
+.SH "SYNOPSIS"
+\fBknn\fR \fIgraph_in\fR [\fINO|LIN|EXP\fR \fIbin_param\fR]
+.
+.SH "DESCRIPTION"
+\fBknn\fR computes the average nearest neighbours degree function knn(k) of the graph \fIgraph_in\fR given as input\. The program can (optionally) average the results over bins of equal or exponentially increasing width (the latter is also known as logarithmic binning)\.
+.
+.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
+NO
+If the second (optional) parameter is equal to \fBNO\fR, or omitted, the program will print on output the values of knn(k) for all the degrees in \fIgraph_in\fR\.
+.
+.TP
+LIN
+If the second (optional) parameter is equal to \fBLIN\fR, the program will average the values of knn(k) over \fIbin_param\fR bins of equal length\.
+.
+.TP
+EXP
+If the second (optional) parameter is equal to \fBEXP\fR, the progam will average the values of knn(k) over bins of exponentially increasing width (also known as \'logarithmic binning\', which is odd, since the width of subsequent bins increases exponentially, not logarithmically, but there you go\.\.\.)\. In this case, \fIbin_param\fR is the exponent of the increase\.
+.
+.TP
+\fIbin_param\fR
+If the second parameter is equal to \fBLIN\fR, \fIbin_param\fR is the number of bins used in the linear binning\. If the second parameter is \fBEXP\fR, \fIbin_param\fR is the exponent used to determine the width of each bin\.
+.
+.SH "OUTPUT"
+The output is in the form:
+.
+.IP "" 4
+.
+.nf
+
+ k1 knn(k1)
+ k2 knn(k2)
+ \.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+If no binning is selected, \fBk1\fR, \fBk2\fR, etc\. are the degrees observed in \fIgraph_in\fR\. If linear or exponential binning is required, then \fBk1\fR, \fBk2\fR, etc\. are the right extremes of the corresponding bin\.
+.
+.SH "EXAMPLES"
+To compute the average neanest\-neighbours degree function for a given graph we just run:
+.
+.IP "" 4
+.
+.nf
+
+ $ knn er_1000_5000\.net
+ 2 10\.5
+ 3 11\.333333
+ 4 10\.785714
+ 5 11\.255319
+ 6 11\.336601
+ 7 11\.176292
+ 8 11\.067568
+ 9 11\.093519
+ 10 10\.898438
+ 11 10\.906009
+ 12 11\.031353
+ 13 10\.73938
+ 14 10\.961538
+ 15 10\.730864
+ 16 10\.669118
+ 17 10\.702206
+ 18 10\.527778
+ 19 11\.302632
+ 20 11\.8
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Since we have not requested a binning, the program will output the value of knn(k) for each of the degrees actually observed in the graph \fBer_1000_5000\.net\fR (the mininum degree is 2 and the maximum degree is 20)\. Notice that in this case, as expected in a graph without degree\-degree correlations, the values of knn(k) are almost independent of k\.
+.
+.P
+We can also ask \fBknn\fR to bin the results over 5 bins of equal width by running:
+.
+.IP "" 4
+.
+.nf
+
+ $ knn er_1000_5000\.net LIN 5
+ 6 11\.249206
+ 10 11\.037634
+ 14 10\.919366
+ 18 10\.68685
+ 22 11\.474138
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Let us consider the case of \fBmovie_actors\.net\fR, i\.e\. the actors collaboration network\. Here we ask \fBknn\fR to compute the average nearest\-neighbours degrees using exponential binning:
+.
+.IP "" 4
+.
+.nf
+
+ $ knn movie_actors\.net EXP 1\.4
+ 2 142\.56552
+ 5 129\.09559
+ 9 158\.44493
+ 15 198\.77922
+ 23 205\.96538
+ 34 210\.07379
+ 50 227\.57167
+ 72 235\.89857
+ 102 254\.47583
+ 144 276\.572
+ 202 307\.11004
+ 283 337\.83733
+ 397 370\.34222
+ 556 410\.89117
+ 779 446\.66331
+ 1091 498\.73118
+ 1527 547\.31923
+ 2137 577\.87852
+ 2991 582\.6855
+ 4187 557\.44801
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Notice that, due to the presence of the second parameter \fBEXP\fR, the program has printed on output knn(k) over bins of exponentially increasing width, using an exponent \fB1\.4\fR\. This is useful for plotting with log or semilog axes\. In this case, the clear increasing trend of knn(k) indicates the presence of assortative correlations\.
+.
+.SH "SEE ALSO"
+knn_w(1), deg_seq(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 7, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/knn.1.html b/doc/knn.1.html
new file mode 100644
index 0000000..c8ea160
--- /dev/null
+++ b/doc/knn.1.html
@@ -0,0 +1,239 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>knn(1) - Compute the average nearest neighbours degree function</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>knn(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>knn(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>knn</code> - <span class="man-whatis">Compute the average nearest neighbours degree function</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>knn</code> <var>graph_in</var> [<var>NO|LIN|EXP</var> <var>bin_param</var>]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>knn</code> computes the average nearest neighbours degree function knn(k)
+of the graph <var>graph_in</var> given as input. The program can (optionally)
+average the results over bins of equal or exponentially increasing
+width (the latter is also known as logarithmic binning).</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> undirected input graph (edge list). If is equal to <code>-</code> (dash), read
+ the edge list from STDIN.</p></dd>
+<dt class="flush">NO</dt><dd><p> If the second (optional) parameter is equal to <code>NO</code>, or omitted,
+ the program will print on output the values of knn(k) for all the
+ degrees in <var>graph_in</var>.</p></dd>
+<dt class="flush">LIN</dt><dd><p> If the second (optional) parameter is equal to <code>LIN</code>, the program
+ will average the values of knn(k) over <var>bin_param</var> bins of equal
+ length.</p></dd>
+<dt class="flush">EXP</dt><dd><p> If the second (optional) parameter is equal to <code>EXP</code>, the progam
+ will average the values of knn(k) over bins of exponentially
+ increasing width (also known as 'logarithmic binning', which is
+ odd, since the width of subsequent bins increases exponentially,
+ not logarithmically, but there you go...). In this case,
+ <var>bin_param</var> is the exponent of the increase.</p></dd>
+<dt><var>bin_param</var></dt><dd><p> If the second parameter is equal to <code>LIN</code>, <var>bin_param</var> is the
+ number of bins used in the linear binning. If the second parameter
+ is <code>EXP</code>, <var>bin_param</var> is the exponent used to determine the width
+ of each bin.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p>The output is in the form:</p>
+
+<pre><code> k1 knn(k1)
+ k2 knn(k2)
+ ....
+</code></pre>
+
+<p>If no binning is selected, <code>k1</code>, <code>k2</code>, etc. are the degrees observed
+in <var>graph_in</var>. If linear or exponential binning is required, then
+<code>k1</code>, <code>k2</code>, etc. are the right extremes of the corresponding bin.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>To compute the average neanest-neighbours degree function for a given
+graph we just run:</p>
+
+<pre><code> $ knn er_1000_5000.net
+ 2 10.5
+ 3 11.333333
+ 4 10.785714
+ 5 11.255319
+ 6 11.336601
+ 7 11.176292
+ 8 11.067568
+ 9 11.093519
+ 10 10.898438
+ 11 10.906009
+ 12 11.031353
+ 13 10.73938
+ 14 10.961538
+ 15 10.730864
+ 16 10.669118
+ 17 10.702206
+ 18 10.527778
+ 19 11.302632
+ 20 11.8
+ $
+</code></pre>
+
+<p>Since we have not requested a binning, the program will output the
+value of knn(k) for each of the degrees actually observed in the graph
+<code>er_1000_5000.net</code> (the mininum degree is 2 and the maximum degree is
+20). Notice that in this case, as expected in a graph without
+degree-degree correlations, the values of knn(k) are almost
+independent of k.</p>
+
+<p>We can also ask <code>knn</code> to bin the results over 5 bins of equal width by
+running:</p>
+
+<pre><code> $ knn er_1000_5000.net LIN 5
+ 6 11.249206
+ 10 11.037634
+ 14 10.919366
+ 18 10.68685
+ 22 11.474138
+ $
+</code></pre>
+
+<p>Let us consider the case of <code>movie_actors.net</code>, i.e. the actors
+collaboration network. Here we ask <code>knn</code> to compute the average
+nearest-neighbours degrees using exponential binning:</p>
+
+<pre><code> $ knn movie_actors.net EXP 1.4
+ 2 142.56552
+ 5 129.09559
+ 9 158.44493
+ 15 198.77922
+ 23 205.96538
+ 34 210.07379
+ 50 227.57167
+ 72 235.89857
+ 102 254.47583
+ 144 276.572
+ 202 307.11004
+ 283 337.83733
+ 397 370.34222
+ 556 410.89117
+ 779 446.66331
+ 1091 498.73118
+ 1527 547.31923
+ 2137 577.87852
+ 2991 582.6855
+ 4187 557.44801
+ $
+</code></pre>
+
+<p>Notice that, due to the presence of the second parameter <code>EXP</code>, the
+program has printed on output knn(k) over bins of exponentially
+increasing width, using an exponent <code>1.4</code>. This is useful for plotting
+with log or semilog axes. In this case, the clear increasing trend of
+knn(k) indicates the presence of assortative correlations.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="knn_w.1.html">knn_w<span class="s">(1)</span></a>, <a class="man-ref" href="deg_seq.1.html">deg_seq<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 7, Cambridge University Press
+(2017)</li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>knn(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/knn.md b/doc/knn.md
new file mode 100644
index 0000000..9646f79
--- /dev/null
+++ b/doc/knn.md
@@ -0,0 +1,148 @@
+knn(1) -- Compute the average nearest neighbours degree function
+======
+
+## SYNOPSIS
+
+`knn` <graph_in> [<NO|LIN|EXP> <bin_param>]
+
+## DESCRIPTION
+
+`knn` computes the average nearest neighbours degree function knn(k)
+of the graph <graph_in> given as input. The program can (optionally)
+average the results over bins of equal or exponentially increasing
+width (the latter is also known as logarithmic binning).
+
+## PARAMETERS
+
+* <graph_in>:
+ undirected input graph (edge list). If is equal to `-` (dash), read
+ the edge list from STDIN.
+
+* NO:
+ If the second (optional) parameter is equal to `NO`, or omitted,
+ the program will print on output the values of knn(k) for all the
+ degrees in <graph_in>.
+
+* LIN:
+ If the second (optional) parameter is equal to `LIN`, the program
+ will average the values of knn(k) over <bin_param> bins of equal
+ length.
+
+* EXP:
+ If the second (optional) parameter is equal to `EXP`, the progam
+ will average the values of knn(k) over bins of exponentially
+ increasing width (also known as 'logarithmic binning', which is
+ odd, since the width of subsequent bins increases exponentially,
+ not logarithmically, but there you go...). In this case,
+ <bin_param> is the exponent of the increase.
+
+* <bin_param>:
+ If the second parameter is equal to `LIN`, <bin_param> is the
+ number of bins used in the linear binning. If the second parameter
+ is `EXP`, <bin_param> is the exponent used to determine the width
+ of each bin.
+
+## OUTPUT
+
+The output is in the form:
+
+ k1 knn(k1)
+ k2 knn(k2)
+ ....
+
+If no binning is selected, `k1`, `k2`, etc. are the degrees observed
+in <graph_in>. If linear or exponential binning is required, then
+`k1`, `k2`, etc. are the right extremes of the corresponding bin.
+
+## EXAMPLES
+
+To compute the average neanest-neighbours degree function for a given
+graph we just run:
+
+ $ knn er_1000_5000.net
+ 2 10.5
+ 3 11.333333
+ 4 10.785714
+ 5 11.255319
+ 6 11.336601
+ 7 11.176292
+ 8 11.067568
+ 9 11.093519
+ 10 10.898438
+ 11 10.906009
+ 12 11.031353
+ 13 10.73938
+ 14 10.961538
+ 15 10.730864
+ 16 10.669118
+ 17 10.702206
+ 18 10.527778
+ 19 11.302632
+ 20 11.8
+ $
+
+Since we have not requested a binning, the program will output the
+value of knn(k) for each of the degrees actually observed in the graph
+`er_1000_5000.net` (the mininum degree is 2 and the maximum degree is
+20). Notice that in this case, as expected in a graph without
+degree-degree correlations, the values of knn(k) are almost
+independent of k.
+
+We can also ask `knn` to bin the results over 5 bins of equal width by
+running:
+
+ $ knn er_1000_5000.net LIN 5
+ 6 11.249206
+ 10 11.037634
+ 14 10.919366
+ 18 10.68685
+ 22 11.474138
+ $
+
+Let us consider the case of `movie_actors.net`, i.e. the actors
+collaboration network. Here we ask `knn` to compute the average
+nearest-neighbours degrees using exponential binning:
+
+ $ knn movie_actors.net EXP 1.4
+ 2 142.56552
+ 5 129.09559
+ 9 158.44493
+ 15 198.77922
+ 23 205.96538
+ 34 210.07379
+ 50 227.57167
+ 72 235.89857
+ 102 254.47583
+ 144 276.572
+ 202 307.11004
+ 283 337.83733
+ 397 370.34222
+ 556 410.89117
+ 779 446.66331
+ 1091 498.73118
+ 1527 547.31923
+ 2137 577.87852
+ 2991 582.6855
+ 4187 557.44801
+ $
+
+Notice that, due to the presence of the second parameter `EXP`, the
+program has printed on output knn(k) over bins of exponentially
+increasing width, using an exponent `1.4`. This is useful for plotting
+with log or semilog axes. In this case, the clear increasing trend of
+knn(k) indicates the presence of assortative correlations.
+
+## SEE ALSO
+
+knn_w(1), deg_seq(1)
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 7, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/knn_w.1 b/doc/knn_w.1
new file mode 100644
index 0000000..289e657
--- /dev/null
+++ b/doc/knn_w.1
@@ -0,0 +1,147 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "KNN_W" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBknn_w\fR \- Compute the weighted average nearest neighbours degree function
+.
+.SH "SYNOPSIS"
+\fBknn_w\fR \fIgraph_in\fR [\fINO|LIN|EXP\fR \fIbin_param\fR]
+.
+.SH "DESCRIPTION"
+\fBknn_w\fR computes the weighted average nearest neighbours degree function knn_w(k) of the weighted graph \fIgraph_in\fR given as input\. The program can (optionally) average the results over bins of equal or exponentially increasing width (the latter is also known as logarithmic binning)\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+undirected and weighted input graph (edge list)\. If is equal to \fB\-\fR (dash), read the edge list from STDIN\.
+.
+.TP
+NO
+If the second (optional) parameter is equal to \fBNO\fR, or omitted, the program will print on output the values of knn_w(k) for all the degrees in \fIgraph_in\fR\.
+.
+.TP
+LIN
+If the second (optional) parameter is equal to \fBLIN\fR, the program will average the values of knn_w(k) over \fIbin_param\fR bins of equal length\.
+.
+.TP
+EXP
+If the second (optional) parameter is equal to \fBEXP\fR, the progam will average the values of knn_w(k) over bins of exponentially increasing width (also known as \'logarithmic binning\', which is odd, since the width of subsequent bins increases exponentially, not logarithmically, but there you go\.\.\.)\. In this case, \fIbin_param\fR is the exponent of the increase\.
+.
+.TP
+\fIbin_param\fR
+If the second parameter is equal to \fBLIN\fR, \fIbin_param\fR is the number of bins used in the linear binning\. If the second parameter is \fBEXP\fR, \fIbin_param\fR is the exponent used to determine the width of each bin\.
+.
+.SH "OUTPUT"
+The output is in the form:
+.
+.IP "" 4
+.
+.nf
+
+ k1 knn_w(k1)
+ k2 knn_w(k2)
+ \.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+If no binning is selected, \fBk1\fR, \fBk2\fR, etc\. are the degrees observed in \fIgraph_in\fR\. If linear or exponential binning is required, then \fBk1\fR, \fBk2\fR, etc\. are the right extremes of the corresponding bin\.
+.
+.SH "EXAMPLES"
+To compute the average neanest\-neighbours degree function of the US air transportation network we can run:
+.
+.IP "" 4
+.
+.nf
+
+ $ knn_w US_airports\.net
+ 1 81\.8
+ 2 30\.350938
+ 3 15\.198846
+ 4 15\.046341
+ 5 13\.967998
+ 6 16\.293341
+ 7 11\.746223
+ 8 11\.53912
+ 9 7\.9134643
+ 10 8\.317504
+ \.\.\.\.
+ 132 0\.46248989
+ 136 0\.47312661
+ 145 0\.37386548
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Since we have not requested a binning, the program will output the value of knn_w(k) for each of the degrees actually observed in the input graph (the mininum degree is 1 and the maximum degree is 145)\. We can also ask \fBknn_w\fR to bin the results over 10 bins of equal width by running:
+.
+.IP "" 4
+.
+.nf
+
+ $ knn_w US_airports\.net 10
+ 16 68\.359133
+ 31 89\.519255
+ 46 78\.911709
+ 61 78\.802765
+ 76 76\.352358
+ 91 71\.589354
+ 106 60\.433329
+ 121 62\.600988
+ 136 64\.81641
+ 151 54\.210494
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+or to use instead an exponential binning:
+.
+.IP "" 4
+.
+.nf
+
+ $ knn_w US_airports\.net EXP 1\.3
+ 3 63\.062388
+ 6 70\.319368
+ 10 81\.856768
+ 15 79\.766008
+ 21 96\.172011
+ 29 84\.771533
+ 39 79\.591139
+ 52 80\.222237
+ 69 79\.776163
+ 91 72\.217712
+ 119 61\.878435
+ 155 62\.695227
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.SH "SEE ALSO"
+knn(1), deg_seq(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+A\. Barrat et al\. "The architecture of complex weighted networks"\. P\. Natl\. Acad\. Sci USA 101 (2004), 3747\-3752\.
+.
+.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\.
diff --git a/doc/knn_w.1.html b/doc/knn_w.1.html
new file mode 100644
index 0000000..7f2a11d
--- /dev/null
+++ b/doc/knn_w.1.html
@@ -0,0 +1,222 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>knn_w(1) - Compute the weighted average nearest neighbours degree function</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>knn_w(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>knn_w(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>knn_w</code> - <span class="man-whatis">Compute the weighted average nearest neighbours degree function</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>knn_w</code> <var>graph_in</var> [<var>NO|LIN|EXP</var> <var>bin_param</var>]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>knn_w</code> computes the weighted average nearest neighbours degree
+function knn_w(k) of the weighted graph <var>graph_in</var> given as input. The
+program can (optionally) average the results over bins of equal or
+exponentially increasing width (the latter is also known as
+logarithmic binning).</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> undirected and weighted input graph (edge list). If is equal to
+ <code>-</code> (dash), read the edge list from STDIN.</p></dd>
+<dt class="flush">NO</dt><dd><p> If the second (optional) parameter is equal to <code>NO</code>, or omitted,
+ the program will print on output the values of knn_w(k) for all the
+ degrees in <var>graph_in</var>.</p></dd>
+<dt class="flush">LIN</dt><dd><p> If the second (optional) parameter is equal to <code>LIN</code>, the program
+ will average the values of knn_w(k) over <var>bin_param</var> bins of equal
+ length.</p></dd>
+<dt class="flush">EXP</dt><dd><p> If the second (optional) parameter is equal to <code>EXP</code>, the progam
+ will average the values of knn_w(k) over bins of exponentially
+ increasing width (also known as 'logarithmic binning', which is
+ odd, since the width of subsequent bins increases exponentially,
+ not logarithmically, but there you go...). In this case,
+ <var>bin_param</var> is the exponent of the increase.</p></dd>
+<dt><var>bin_param</var></dt><dd><p> If the second parameter is equal to <code>LIN</code>, <var>bin_param</var> is the
+ number of bins used in the linear binning. If the second parameter
+ is <code>EXP</code>, <var>bin_param</var> is the exponent used to determine the width
+ of each bin.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p>The output is in the form:</p>
+
+<pre><code> k1 knn_w(k1)
+ k2 knn_w(k2)
+ ....
+</code></pre>
+
+<p>If no binning is selected, <code>k1</code>, <code>k2</code>, etc. are the degrees observed
+in <var>graph_in</var>. If linear or exponential binning is required, then
+<code>k1</code>, <code>k2</code>, etc. are the right extremes of the corresponding bin.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>To compute the average neanest-neighbours degree function of the US
+air transportation network we can run:</p>
+
+<pre><code> $ knn_w US_airports.net
+ 1 81.8
+ 2 30.350938
+ 3 15.198846
+ 4 15.046341
+ 5 13.967998
+ 6 16.293341
+ 7 11.746223
+ 8 11.53912
+ 9 7.9134643
+ 10 8.317504
+ ....
+ 132 0.46248989
+ 136 0.47312661
+ 145 0.37386548
+ $
+</code></pre>
+
+<p>Since we have not requested a binning, the program will output the
+value of knn_w(k) for each of the degrees actually observed in the
+input graph (the mininum degree is 1 and the maximum degree is
+145). We can also ask <code>knn_w</code> to bin the results over 10 bins of equal
+width by running:</p>
+
+<pre><code> $ knn_w US_airports.net 10
+ 16 68.359133
+ 31 89.519255
+ 46 78.911709
+ 61 78.802765
+ 76 76.352358
+ 91 71.589354
+ 106 60.433329
+ 121 62.600988
+ 136 64.81641
+ 151 54.210494
+ $
+</code></pre>
+
+<p>or to use instead an exponential binning:</p>
+
+<pre><code> $ knn_w US_airports.net EXP 1.3
+ 3 63.062388
+ 6 70.319368
+ 10 81.856768
+ 15 79.766008
+ 21 96.172011
+ 29 84.771533
+ 39 79.591139
+ 52 80.222237
+ 69 79.776163
+ 91 72.217712
+ 119 61.878435
+ 155 62.695227
+ $
+</code></pre>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="knn.1.html">knn<span class="s">(1)</span></a>, <a class="man-ref" href="deg_seq.1.html">deg_seq<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>A. Barrat et al. "The architecture of complex weighted
+networks". P. Natl. Acad. Sci USA 101 (2004), 3747-3752.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 10, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>knn_w(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/knn_w.md b/doc/knn_w.md
new file mode 100644
index 0000000..56e2328
--- /dev/null
+++ b/doc/knn_w.md
@@ -0,0 +1,131 @@
+knn_w(1) -- Compute the weighted average nearest neighbours degree function
+======
+
+## SYNOPSIS
+
+`knn_w` <graph_in> [<NO|LIN|EXP> <bin_param>]
+
+## DESCRIPTION
+
+`knn_w` computes the weighted average nearest neighbours degree
+function knn_w(k) of the weighted graph <graph_in> given as input. The
+program can (optionally) average the results over bins of equal or
+exponentially increasing width (the latter is also known as
+logarithmic binning).
+
+## PARAMETERS
+
+* <graph_in>:
+ undirected and weighted input graph (edge list). If is equal to
+ `-` (dash), read the edge list from STDIN.
+
+* NO:
+ If the second (optional) parameter is equal to `NO`, or omitted,
+ the program will print on output the values of knn_w(k) for all the
+ degrees in <graph_in>.
+
+* LIN:
+ If the second (optional) parameter is equal to `LIN`, the program
+ will average the values of knn_w(k) over <bin_param> bins of equal
+ length.
+
+* EXP:
+ If the second (optional) parameter is equal to `EXP`, the progam
+ will average the values of knn_w(k) over bins of exponentially
+ increasing width (also known as 'logarithmic binning', which is
+ odd, since the width of subsequent bins increases exponentially,
+ not logarithmically, but there you go...). In this case,
+ <bin_param> is the exponent of the increase.
+
+* <bin_param>:
+ If the second parameter is equal to `LIN`, <bin_param> is the
+ number of bins used in the linear binning. If the second parameter
+ is `EXP`, <bin_param> is the exponent used to determine the width
+ of each bin.
+
+## OUTPUT
+
+The output is in the form:
+
+ k1 knn_w(k1)
+ k2 knn_w(k2)
+ ....
+
+If no binning is selected, `k1`, `k2`, etc. are the degrees observed
+in <graph_in>. If linear or exponential binning is required, then
+`k1`, `k2`, etc. are the right extremes of the corresponding bin.
+
+## EXAMPLES
+
+To compute the average neanest-neighbours degree function of the US
+air transportation network we can run:
+
+ $ knn_w US_airports.net
+ 1 81.8
+ 2 30.350938
+ 3 15.198846
+ 4 15.046341
+ 5 13.967998
+ 6 16.293341
+ 7 11.746223
+ 8 11.53912
+ 9 7.9134643
+ 10 8.317504
+ ....
+ 132 0.46248989
+ 136 0.47312661
+ 145 0.37386548
+ $
+
+Since we have not requested a binning, the program will output the
+value of knn_w(k) for each of the degrees actually observed in the
+input graph (the mininum degree is 1 and the maximum degree is
+145). We can also ask `knn_w` to bin the results over 10 bins of equal
+width by running:
+
+ $ knn_w US_airports.net 10
+ 16 68.359133
+ 31 89.519255
+ 46 78.911709
+ 61 78.802765
+ 76 76.352358
+ 91 71.589354
+ 106 60.433329
+ 121 62.600988
+ 136 64.81641
+ 151 54.210494
+ $
+
+or to use instead an exponential binning:
+
+ $ knn_w US_airports.net EXP 1.3
+ 3 63.062388
+ 6 70.319368
+ 10 81.856768
+ 15 79.766008
+ 21 96.172011
+ 29 84.771533
+ 39 79.591139
+ 52 80.222237
+ 69 79.776163
+ 91 72.217712
+ 119 61.878435
+ 155 62.695227
+ $
+
+## SEE ALSO
+
+knn(1), deg_seq(1)
+
+## REFERENCES
+
+* A\. Barrat et al. "The architecture of complex weighted
+ networks". P. Natl. Acad. Sci USA 101 (2004), 3747-3752.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 10, Cambridge University Press
+ (2017)
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
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\.
diff --git a/doc/kruskal.1.html b/doc/kruskal.1.html
new file mode 100644
index 0000000..c0aeece
--- /dev/null
+++ b/doc/kruskal.1.html
@@ -0,0 +1,182 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>kruskal(1) - Find the minimum/maximum spanning tree of a graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>kruskal(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>kruskal(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>kruskal</code> - <span class="man-whatis">Find the minimum/maximum spanning tree of a graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>kruskal</code> <var>graph_in</var> [MAX]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>kruskal</code> computes the minimum (or maximum) spanning tree of
+<var>graph_in</var>, using the Kruskal's algorithm. If <var>grahp_in</var> is
+unweighted, <code>kruskal</code> computes one of the spanning trees of the
+graph. The program prints on output the (weighted) edge list of the
+spanning tree.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> undirected input graph (edge list). It must be an existing file.</p></dd>
+<dt class="flush"><code>MAX</code></dt><dd><p> If the second (optional) parameter is equal to <code>MAX</code>, compute the
+ maximum spanning tree. Otherwise, compute the minimum spanning tree.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p>The program prints on STDOUT the edge list of the minimum (maximum)
+spannig tree of <var>graph_in</var>, in the format:</p>
+
+<pre><code> i_1 j_1 w_ij_1
+ i_2 j_2 w_ij_2
+ ....
+</code></pre>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>To find the minimum spanning tree of the graph <code>stocks_62_weight.net</code>
+(the network of stocks in the New York Exchange market) we use the
+command:</p>
+
+<pre><code> $ 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
+ $
+</code></pre>
+
+<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 <code>MAX</code> as
+second parameter:</p>
+
+<pre><code> $ 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
+ $
+</code></pre>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="clust_w.1.html">clust_w<span class="s">(1)</span></a>, <a class="man-ref" href="dijkstra.1.html">dijkstra<span class="s">(1)</span></a>, <a class="man-ref" href="largest_component.1.html">largest_component<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>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.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 20, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 10, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>kruskal(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/kruskal.md b/doc/kruskal.md
new file mode 100644
index 0000000..b46e543
--- /dev/null
+++ b/doc/kruskal.md
@@ -0,0 +1,89 @@
+kruskal(1) -- Find the minimum/maximum spanning tree of a graph
+======
+
+## SYNOPSIS
+
+`kruskal` <graph_in> [MAX]
+
+## DESCRIPTION
+
+`kruskal` computes the minimum (or maximum) spanning tree of
+<graph_in>, using the Kruskal's algorithm. If <grahp_in> is
+unweighted, `kruskal` computes one of the spanning trees of the
+graph. The program prints on output the (weighted) edge list of the
+spanning tree.
+
+## PARAMETERS
+
+* <graph_in>:
+ undirected input graph (edge list). It must be an existing file.
+
+* `MAX`:
+ If the second (optional) parameter is equal to `MAX`, compute the
+ maximum spanning tree. Otherwise, compute the minimum spanning tree.
+
+## OUTPUT
+
+The program prints on STDOUT the edge list of the minimum (maximum)
+spannig tree of <graph_in>, in the format:
+
+ i_1 j_1 w_ij_1
+ i_2 j_2 w_ij_2
+ ....
+
+
+## EXAMPLES
+
+To find the minimum spanning tree of the graph `stocks_62_weight.net`
+(the network of stocks in the New York Exchange market) we use the
+command:
+
+ $ 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
+ $
+
+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 `MAX` as
+second parameter:
+
+ $ 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
+ $
+
+## SEE ALSO
+
+clust_w(1), dijkstra(1), largest_component(1)
+
+## REFERENCES
+
+
+* 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.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 20, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 10, Cambridge University Press
+ (2017)
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/label_prop.1 b/doc/label_prop.1
new file mode 100644
index 0000000..8ba45f6
--- /dev/null
+++ b/doc/label_prop.1
@@ -0,0 +1,112 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "LABEL_PROP" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBlabel_prop\fR \- Find communities using label propagation
+.
+.SH "SYNOPSIS"
+\fBlabel_prop\fR [SYNC|ASYNC] \fIgraph_in\fR [\fImax_epochs\fR]
+.
+.SH "DESCRIPTION"
+\fBlabel_prop\fR finds the communities in \fIgraph_in\fR using the label propagation algorithm proposed by Raghavan, Albert, and Kumara\. The program prints on STDOUT the partition obtained where no more label flips are possible, and reports on STDERR the number of communities and the corresponding value of modularity at each epoch\. When used in ASYNC mode, the algorithm is suitable to find communities in large graphs\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fBSYNC\fR|\fBASYNC\fR
+The first parameter is used to choose between synchronous (\fBSYNC\fR) or asynchronous (\fBASYNC\fR) label update\.
+.
+.TP
+\fIgraph_in\fR
+undirected input graph (edge list)\. If is equal to \fB\-\fR (dash), read the edge list from STDIN\.
+.
+.TP
+\fImax_epochs\fR
+Sets the maximum number of epochs to run (optional)\.
+.
+.SH "OUTPUT"
+The program prints on STDOUT the partition obtained where no more label flips are possible, in the format:
+.
+.IP "" 4
+.
+.nf
+
+ ## nc: NUM_COMM Q_max: Q_MAX Epochs: EPOCHS
+ node_1 comm_1
+ node_2 comm_2
+ node_3 comm_3
+ \.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBcomm_i\fR is the community to which \fBnode_i\fR belongs\. The first output line reports the number of communities \fBNUM_COMM\fR, the corresponding value of modularity \fBQ_MAX\fR, and the number of epochs \fBEPOCHS\fR used to find the partition\.
+.
+.P
+The program prints on STDERR the epoch number, the value of modularity of the partition at that epoch, and the number of flips made in that epoch, in the format:
+.
+.IP "" 4
+.
+.nf
+
+ 1 Q_1 flips_1
+ 2 Q_2 flips_2
+ 3 Q_3 flips_3
+ \.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBQ_i\fR is the modularity of the partition at the i\-th epoch, and \fBflips_i\fR is the number of label flips performed during that epoch\.
+.
+.SH "EXAMPLES"
+We can use \fBlabel_prop\fR to find communities in the graph \fBkarate_club_unweighted\.net\fR (Zachary Karate Club network) with the command:
+.
+.IP "" 4
+.
+.nf
+
+ $ label_prop ASYNC karate_club_unweighted\.net 2> karate_label\-prop_trace
+ ### nc: 2 Q_max: 0\.371795 Epochs: 6
+ 0 0
+ 1 0
+ 2 0
+ 3 0
+ \.\.\.
+ 30 1
+ 31 1
+ 32 1
+ 33 1
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The program has found a partition with 2 communities corrisponding to a modularity Q=0\.371795\. Notice that node 0, 1, 2, 3, are in community 0, while node 30, 31, 32, 33 are in community 1\. In this example, we have chosen to save the information about the modularity and number of flips at each epoch in the file \fBkarate_label\-prop_trace\fR\.
+.
+.SH "SEE ALSO"
+modularity(1), gn(1), cnm(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+U\. N\. Raghavan, R\. Albert, and S\. Kumara\. "Near linear time algorithm to detect community structures in large\-scale networks"\. Phys\. Rev\. E 76 (2007), 036106\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 19, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 9, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/label_prop.1.html b/doc/label_prop.1.html
new file mode 100644
index 0000000..1e0eb28
--- /dev/null
+++ b/doc/label_prop.1.html
@@ -0,0 +1,197 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>label_prop(1) - Find communities using label propagation</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>label_prop(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>label_prop(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>label_prop</code> - <span class="man-whatis">Find communities using label propagation</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>label_prop</code> [SYNC|ASYNC] <var>graph_in</var> [<var>max_epochs</var>]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>label_prop</code> finds the communities in <var>graph_in</var> using the label
+propagation algorithm proposed by Raghavan, Albert, and Kumara. The
+program prints on STDOUT the partition obtained where no more label
+flips are possible, and reports on STDERR the number of communities
+and the corresponding value of modularity at each epoch. When used in
+ASYNC mode, the algorithm is suitable to find communities in large
+graphs.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><code>SYNC</code>|<code>ASYNC</code></dt><dd><p> The first parameter is used to choose between synchronous (<code>SYNC</code>)
+ or asynchronous (<code>ASYNC</code>) label update.</p></dd>
+<dt><var>graph_in</var></dt><dd><p> undirected input graph (edge list). If is equal to <code>-</code> (dash), read
+ the edge list from STDIN.</p></dd>
+<dt><var>max_epochs</var></dt><dd><p> Sets the maximum number of epochs to run (optional).</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p>The program prints on STDOUT the partition obtained where no more
+label flips are possible, in the format:</p>
+
+<pre><code> ## nc: NUM_COMM Q_max: Q_MAX Epochs: EPOCHS
+ node_1 comm_1
+ node_2 comm_2
+ node_3 comm_3
+ ...
+</code></pre>
+
+<p>where <code>comm_i</code> is the community to which <code>node_i</code> belongs. The first
+output line reports the number of communities <code>NUM_COMM</code>, the
+corresponding value of modularity <code>Q_MAX</code>, and the number of epochs
+<code>EPOCHS</code> used to find the partition.</p>
+
+<p>The program prints on STDERR the epoch number, the value of modularity
+of the partition at that epoch, and the number of flips made in that
+epoch, in the format:</p>
+
+<pre><code> 1 Q_1 flips_1
+ 2 Q_2 flips_2
+ 3 Q_3 flips_3
+ ....
+</code></pre>
+
+<p>where <code>Q_i</code> is the modularity of the partition at the i-th epoch, and
+<code>flips_i</code> is the number of label flips performed during that
+epoch.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>We can use <code>label_prop</code> to find communities in the graph
+<code>karate_club_unweighted.net</code> (Zachary Karate Club network) with the command:</p>
+
+<pre><code> $ label_prop ASYNC karate_club_unweighted.net 2&gt; karate_label-prop_trace
+ ### nc: 2 Q_max: 0.371795 Epochs: 6
+ 0 0
+ 1 0
+ 2 0
+ 3 0
+ ...
+ 30 1
+ 31 1
+ 32 1
+ 33 1
+ $
+</code></pre>
+
+<p>The program has found a partition with 2 communities corrisponding to
+a modularity Q=0.371795. Notice that node 0, 1, 2, 3, are in community
+0, while node 30, 31, 32, 33 are in community 1. In this example, we
+have chosen to save the information about the modularity and number of
+flips at each epoch in the file <code>karate_label-prop_trace</code>.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="modularity.1.html">modularity<span class="s">(1)</span></a>, <a class="man-ref" href="gn.1.html">gn<span class="s">(1)</span></a>, <a class="man-ref" href="cnm.1.html">cnm<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>U. N. Raghavan, R. Albert, and S. Kumara. "Near linear time
+algorithm to detect community structures in large-scale
+networks". Phys. Rev. E 76 (2007), 036106.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 19, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 9, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>label_prop(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/label_prop.md b/doc/label_prop.md
new file mode 100644
index 0000000..4a0c382
--- /dev/null
+++ b/doc/label_prop.md
@@ -0,0 +1,104 @@
+label_prop(1) -- Find communities using label propagation
+======
+
+## SYNOPSIS
+
+`label_prop` [SYNC|ASYNC] <graph_in> [<max_epochs>]
+
+## DESCRIPTION
+
+`label_prop` finds the communities in <graph_in> using the label
+propagation algorithm proposed by Raghavan, Albert, and Kumara. The
+program prints on STDOUT the partition obtained where no more label
+flips are possible, and reports on STDERR the number of communities
+and the corresponding value of modularity at each epoch. When used in
+ASYNC mode, the algorithm is suitable to find communities in large
+graphs.
+
+## PARAMETERS
+
+* `SYNC`|`ASYNC`:
+ The first parameter is used to choose between synchronous (`SYNC`)
+ or asynchronous (`ASYNC`) label update.
+
+* <graph_in>:
+ undirected input graph (edge list). If is equal to `-` (dash), read
+ the edge list from STDIN.
+
+* <max_epochs>:
+ Sets the maximum number of epochs to run (optional).
+
+## OUTPUT
+
+The program prints on STDOUT the partition obtained where no more
+label flips are possible, in the format:
+
+ ## nc: NUM_COMM Q_max: Q_MAX Epochs: EPOCHS
+ node_1 comm_1
+ node_2 comm_2
+ node_3 comm_3
+ ...
+
+where `comm_i` is the community to which `node_i` belongs. The first
+output line reports the number of communities `NUM_COMM`, the
+corresponding value of modularity `Q_MAX`, and the number of epochs
+`EPOCHS` used to find the partition.
+
+The program prints on STDERR the epoch number, the value of modularity
+of the partition at that epoch, and the number of flips made in that
+epoch, in the format:
+
+ 1 Q_1 flips_1
+ 2 Q_2 flips_2
+ 3 Q_3 flips_3
+ ....
+
+where `Q_i` is the modularity of the partition at the i-th epoch, and
+`flips_i` is the number of label flips performed during that
+epoch.
+
+## EXAMPLES
+
+We can use `label_prop` to find communities in the graph
+`karate_club_unweighted.net` (Zachary Karate Club network) with the command:
+
+ $ label_prop ASYNC karate_club_unweighted.net 2> karate_label-prop_trace
+ ### nc: 2 Q_max: 0.371795 Epochs: 6
+ 0 0
+ 1 0
+ 2 0
+ 3 0
+ ...
+ 30 1
+ 31 1
+ 32 1
+ 33 1
+ $
+
+The program has found a partition with 2 communities corrisponding to
+a modularity Q=0.371795. Notice that node 0, 1, 2, 3, are in community
+0, while node 30, 31, 32, 33 are in community 1. In this example, we
+have chosen to save the information about the modularity and number of
+flips at each epoch in the file `karate_label-prop_trace`.
+
+## SEE ALSO
+
+modularity(1), gn(1), cnm(1)
+
+## REFERENCES
+
+* U\. N. Raghavan, R. Albert, and S. Kumara. "Near linear time
+ algorithm to detect community structures in large-scale
+ networks". Phys. Rev. E 76 (2007), 036106.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 19, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 9, Cambridge University Press
+ (2017)
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/largest_component.1 b/doc/largest_component.1
new file mode 100644
index 0000000..2251849
--- /dev/null
+++ b/doc/largest_component.1
@@ -0,0 +1,50 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "LARGEST_COMPONENT" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBlargest_component\fR \- Find largest connected component of a graph
+.
+.SH "SYNOPSIS"
+\fBlargest_component\fR \fIgraph_in\fR
+.
+.SH "DESCRIPTION"
+\fBlargest_component\fR computes the largest connected component of \fIgraph_in\fR, and prints on STDOUT the corresponding edge list\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+undirected input graph (edge list)\. If it is equal to \fB\-\fR (dash), read the edge list from STDIN\.
+.
+.SH "OUTPUT"
+The program prints on STDOUT the edge list of the largest connected component of \fIgraph_in\fR, in the format:
+.
+.IP "" 4
+.
+.nf
+
+ i_1 j_1
+ i_2 j_2
+ \.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.SH "SEE ALSO"
+components(1), node_components(1), strong_conn(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 6, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 8, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/largest_component.1.html b/doc/largest_component.1.html
new file mode 100644
index 0000000..1d0af04
--- /dev/null
+++ b/doc/largest_component.1.html
@@ -0,0 +1,139 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>largest_component(1) - Find largest connected component of a graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>largest_component(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>largest_component(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>largest_component</code> - <span class="man-whatis">Find largest connected component of a graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>largest_component</code> <var>graph_in</var></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>largest_component</code> computes the largest connected component of
+<var>graph_in</var>, and prints on STDOUT the corresponding edge list.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd> undirected input graph (edge list). If it is equal to <code>-</code> (dash),
+ read the edge list from STDIN.</dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p>The program prints on STDOUT the edge list of the largest connected
+component of <var>graph_in</var>, in the format:</p>
+
+<pre><code> i_1 j_1
+ i_2 j_2
+ ....
+</code></pre>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="components.1.html">components<span class="s">(1)</span></a>, <a class="man-ref" href="node_components.1.html">node_components<span class="s">(1)</span></a>, <a class="man-ref" href="strong_conn.1.html">strong_conn<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 6, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 8, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>largest_component(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/largest_component.md b/doc/largest_component.md
new file mode 100644
index 0000000..5c5b5d6
--- /dev/null
+++ b/doc/largest_component.md
@@ -0,0 +1,47 @@
+largest_component(1) -- Find largest connected component of a graph
+======
+
+## SYNOPSIS
+
+`largest_component` <graph_in>
+
+## DESCRIPTION
+
+`largest_component` computes the largest connected component of
+<graph_in>, and prints on STDOUT the corresponding edge list.
+
+## PARAMETERS
+
+* <graph_in>:
+ undirected input graph (edge list). If it is equal to `-` (dash),
+ read the edge list from STDIN.
+
+
+## OUTPUT
+
+The program prints on STDOUT the edge list of the largest connected
+component of <graph_in>, in the format:
+
+ i_1 j_1
+ i_2 j_2
+ ....
+
+
+## SEE ALSO
+
+components(1), node_components(1), strong_conn(1)
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 6, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 8, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/modularity.1 b/doc/modularity.1
new file mode 100644
index 0000000..3a0706b
--- /dev/null
+++ b/doc/modularity.1
@@ -0,0 +1,70 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "MODULARITY" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBmodularity\fR \- Compute the modularity of a partition of a graph
+.
+.SH "SYNOPSIS"
+\fBmodularity\fR \fIgraph_in\fR \fIpartition\fR
+.
+.SH "DESCRIPTION"
+\fBmodularity\fR computes the value of the modularity function associated to a partition of the nodes of the graph given as input\.
+.
+.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
+\fIpartition\fR
+The name of the file containing the association of nodes to communities (the partition of which one wants to compute the modularity)\. See \fIINPUT FORMAT\fR for details\.
+.
+.SH "INPUT FORMAT"
+\fIgraph_in\fR is an edge\-list\. The file \fIpartition\fR is in the format:
+.
+.IP "" 4
+.
+.nf
+
+ node_0 community_0
+ node_1 community_1
+ \.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \'node_0\' is the label of the first node and \'community_0\' is the community to which \'node_0\' belongs, and so on\.
+.
+.SH "OUTPUT"
+\fBmodularity\fR prints on STDOUT the value of the modularity function associated to the partition of the graph provided as input\. The program also prints on STDERR one line in the format:
+.
+.IP "" 4
+.
+.nf
+
+ ## nc: NUM_COMMUNITIES
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \'NUM_COMMUNITIES\' is the number of communities in the partition provided as input\.
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+M\. E\. J\. Newman and M\. Girvan\. "Finding and evaluating community structure in networks"\. Phys\. Rev\. E 69, (2004), 026113\.
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 9, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/modularity.1.html b/doc/modularity.1.html
new file mode 100644
index 0000000..a6d4242
--- /dev/null
+++ b/doc/modularity.1.html
@@ -0,0 +1,151 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>modularity(1) - Compute the modularity of a partition of a graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#INPUT-FORMAT">INPUT FORMAT</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>modularity(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>modularity(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>modularity</code> - <span class="man-whatis">Compute the modularity of a partition of a graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>modularity</code> <var>graph_in</var> <var>partition</var></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>modularity</code> computes the value of the modularity function associated
+to a partition of the nodes of the graph given as input.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> undirected input graph (edge list). If is equal to <code>-</code> (dash), read
+ the edge list from STDIN.</p></dd>
+<dt><var>partition</var></dt><dd><p> The name of the file containing the association of nodes to
+ communities (the partition of which one wants to compute the
+ modularity). See <a href="#INPUT-FORMAT" title="INPUT FORMAT" data-bare-link="true">INPUT FORMAT</a> for details.</p></dd>
+</dl>
+
+
+<h2 id="INPUT-FORMAT">INPUT FORMAT</h2>
+
+<p><var>graph_in</var> is an edge-list. The file <var>partition</var> is in the format:</p>
+
+<pre><code> node_0 community_0
+ node_1 community_1
+ ....
+</code></pre>
+
+<p>where 'node_0' is the label of the first node and 'community_0' is the
+community to which 'node_0' belongs, and so on.</p>
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>modularity</code> prints on STDOUT the value of the modularity function
+associated to the partition of the graph provided as input. The
+program also prints on STDERR one line in the format:</p>
+
+<pre><code> ## nc: NUM_COMMUNITIES
+</code></pre>
+
+<p>where 'NUM_COMMUNITIES' is the number of communities in the partition
+provided as input.</p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>M. E. J. Newman and M. Girvan. "Finding and evaluating community
+structure in networks". Phys. Rev. E 69, (2004), 026113.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 9, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>modularity(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/modularity.md b/doc/modularity.md
new file mode 100644
index 0000000..445e705
--- /dev/null
+++ b/doc/modularity.md
@@ -0,0 +1,59 @@
+modularity(1) -- Compute the modularity of a partition of a graph
+======
+
+## SYNOPSIS
+
+`modularity` <graph_in> <partition>
+
+## DESCRIPTION
+
+`modularity` computes the value of the modularity function associated
+to a partition of the nodes of the graph given as input.
+
+## PARAMETERS
+
+* <graph_in>:
+ undirected input graph (edge list). If is equal to `-` (dash), read
+ the edge list from STDIN.
+
+* <partition>:
+ The name of the file containing the association of nodes to
+ communities (the partition of which one wants to compute the
+ modularity). See [INPUT FORMAT][] for details.
+
+## INPUT FORMAT
+
+<graph_in> is an edge-list. The file <partition> is in the format:
+
+ node_0 community_0
+ node_1 community_1
+ ....
+
+where 'node_0' is the label of the first node and 'community_0' is the
+community to which 'node_0' belongs, and so on.
+
+## OUTPUT
+
+`modularity` prints on STDOUT the value of the modularity function
+associated to the partition of the graph provided as input. The
+program also prints on STDERR one line in the format:
+
+ ## nc: NUM_COMMUNITIES
+
+where 'NUM_COMMUNITIES' is the number of communities in the partition
+provided as input.
+
+
+## REFERENCES
+
+* M\. E. J. Newman and M. Girvan. "Finding and evaluating community
+ structure in networks". Phys. Rev. E 69, (2004), 026113.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 9, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/node_components.1 b/doc/node_components.1
new file mode 100644
index 0000000..b96c686
--- /dev/null
+++ b/doc/node_components.1
@@ -0,0 +1,137 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "NODE_COMPONENTS" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBnode_components\fR \- Find the components associated to a specific node
+.
+.SH "SYNOPSIS"
+\fBnode_components\fR \fIgraph_in\fR \fInode\fR [\fIcomponent\fR [SHOW]]
+.
+.SH "DESCRIPTION"
+\fBnode_components\fR finds the components associated to the node \fInode\fR of the graph \fIgraph_in\fR provided as input, and prints on output the size of those components\. The value of the third parameter \fIcomponent\fR can be set to \fBIN\fR, \fBOUT\fR, \fBINOUT\fR, \fBSSC\fR, \fBWCC\fR, or \fBALL\fR\. According to the value of \fIcomponent\fR, the program will compute the IN\-component (\fBIN\fR), the OUT\-component (\fBOUT\fR), both the IN\- and OUT\-component (\fBINOUT\fR), the strongly connected components (\fBSCC\fR), or the weakly\-connected component (\fBWCC\fR) to which \fInode\fR belongs\. If the third parameter is omitted or equal to \fBALL\fR, then \fBnode_components\fR computes all the components associated to \fInode\fR\. If \fBSHOW\fR is specified as the fourth parameter, the program also shows the list of nodes which belong to each of the required components\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+input graph (edge list) if equal to \fB\-\fR (dash), read the edge list from STDIN\.
+.
+.TP
+\fInode\fR
+the label of the node\.
+.
+.TP
+\fIcomponent\fR
+the component to compute\. Can be set to one of \fBIN\fR (IN\-component), \fBOUT\fR (OUT\-component), \fBINOUT\fR (both the IN\- and the OUT\-component), \fBSSC\fR (strongly connected component), \fBWCC\fR (weakly connected component), or \fBALL\fR (all the above)\. If \fIcomponent\fR is not set, compute all the components\.
+.
+.TP
+SHOW
+If the (optional) fourth parameter is equal to \fBSHOW\fR, the program will dump on output the list of all the nodes belonging to each component\.
+.
+.SH "OUTPUT"
+\fBnode_components\fR prints on the standard output the size of the required components, one per line, in the format:
+.
+.IP "" 4
+.
+.nf
+
+comp_type_1: size_1
+comp_type_2: size_2
+\.\.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBcomp_type_1\fR is the type of component (one of \fBIN\fR, \fBOUT\fR, \fBSCC\fR, or \fBWCC\fR) and \fBsize_1\fR is its size, and so on\. Notice that the sizes are not sorted\. If \fBSHOW\fR is given, the program shows the list of nodes belonging to each component, in the format:
+.
+.IP "" 4
+.
+.nf
+
+comp_type_1: size_1 node_1 node_2 node_3 \.\.\.
+comp_type_2: size_2 node_1 node_2 node_3 \.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.SH "EXAMPLES"
+We can use \fBnode_components\fR to compute the IN\-component of a specific node\. For instance, the command:
+.
+.IP "" 4
+.
+.nf
+
+ $ node_components web\-NotreDame\.net 2711 IN
+ IN: 53968
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+computes the size of the IN\-component of node 2711 in the graph \fBwww_nd\.net\fR (WWW Notre Dame)\. This component contains 53968 nodes\. Similarly:
+.
+.IP "" 4
+.
+.nf
+
+ $ node_components web\-NotreDame\.net 2711 OUT SHOW
+ OUT: 21 559 2711 2712 2713 2714 2715 2716 \.\.\. 33271 33272
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+computes and shows the OUT\-component of node 2711, which contains 21 nodes, including node 2711\. Finally, we can obtain the size of all the components associated to node 2711 by running:
+.
+.IP "" 4
+.
+.nf
+
+ $ node_components web\-NotreDame\.net 2711
+ IN: 53986
+ OUT: 21
+ WCC: 325729
+ SCC: 18
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+In this case, the IN\-component of node 2711 contains 53986 nodes, the OUT\-component contains 21 nodes, the weakly connected components contains 325729 nodes (the whole graph), and the strongly connected component contains 18 nodes\. It is also possible to show the list of nodes belonging to each component by providing \fBSHOW\fR as fourth parameter\. IN this case, it is better to save the output of \fBnode_components\fR into a file, e\.g\. by using:
+.
+.IP "" 4
+.
+.nf
+
+ $ node_components web\-NotreDame\.net 2711 ALL SHOW > web\-NotreDame\.net_components_2711
+.
+.fi
+.
+.IP "" 0
+.
+.SH "SEE ALSO"
+components(1), strong_conn(1), largest_component(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 6, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 8, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) (c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/node_components.1.html b/doc/node_components.1.html
new file mode 100644
index 0000000..cdbf09b
--- /dev/null
+++ b/doc/node_components.1.html
@@ -0,0 +1,210 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>node_components(1) - Find the components associated to a specific node</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>node_components(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>node_components(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>node_components</code> - <span class="man-whatis">Find the components associated to a specific node</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>node_components</code> <var>graph_in</var> <var>node</var> [<var>component</var> [SHOW]]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>node_components</code> finds the components associated to the node <var>node</var>
+of the graph <var>graph_in</var> provided as input, and prints on output the
+size of those components. The value of the third parameter <var>component</var>
+can be set to <code>IN</code>, <code>OUT</code>, <code>INOUT</code>, <code>SSC</code>, <code>WCC</code>, or <code>ALL</code>. According
+to the value of <var>component</var>, the program will compute the IN-component
+(<code>IN</code>), the OUT-component (<code>OUT</code>), both the IN- and OUT-component
+(<code>INOUT</code>), the strongly connected components (<code>SCC</code>), or the
+weakly-connected component (<code>WCC</code>) to which <var>node</var> belongs. If the
+third parameter is omitted or equal to <code>ALL</code>, then <code>node_components</code>
+computes all the components associated to <var>node</var>. If <code>SHOW</code> is
+specified as the fourth parameter, the program also shows the list of
+nodes which belong to each of the required components.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd> input graph (edge list) if equal to <code>-</code> (dash), read the edge list
+ from STDIN.</dd>
+<dt class="flush"><var>node</var></dt><dd><p> the label of the node.</p></dd>
+<dt><var>component</var></dt><dd><p> the component to compute. Can be set to one of <code>IN</code>
+ (IN-component), <code>OUT</code> (OUT-component), <code>INOUT</code> (both the IN- and
+ the OUT-component), <code>SSC</code> (strongly connected component), <code>WCC</code>
+ (weakly connected component), or <code>ALL</code> (all the above). If
+ <var>component</var> is not set, compute all the components.</p></dd>
+<dt class="flush">SHOW</dt><dd><p> If the (optional) fourth parameter is equal to <code>SHOW</code>, the program
+ will dump on output the list of all the nodes belonging to each
+ component.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>node_components</code> prints on the standard output the size of the
+required components, one per line, in the format:</p>
+
+<pre><code>comp_type_1: size_1
+comp_type_2: size_2
+.....
+</code></pre>
+
+<p>where <code>comp_type_1</code> is the type of component (one of <code>IN</code>, <code>OUT</code>,
+<code>SCC</code>, or <code>WCC</code>) and <code>size_1</code> is its size, and so on. Notice that the
+sizes are not sorted. If <code>SHOW</code> is given, the program shows the list
+of nodes belonging to each component, in the format:</p>
+
+<pre><code>comp_type_1: size_1 node_1 node_2 node_3 ...
+comp_type_2: size_2 node_1 node_2 node_3 ...
+</code></pre>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>We can use <code>node_components</code> to compute the IN-component of a specific
+node. For instance, the command:</p>
+
+<pre><code> $ node_components web-NotreDame.net 2711 IN
+ IN: 53968
+ $
+</code></pre>
+
+<p>computes the size of the IN-component of node 2711 in the graph
+<code>www_nd.net</code> (WWW Notre Dame). This component contains 53968
+nodes. Similarly:</p>
+
+<pre><code> $ node_components web-NotreDame.net 2711 OUT SHOW
+ OUT: 21 559 2711 2712 2713 2714 2715 2716 ... 33271 33272
+ $
+</code></pre>
+
+<p>computes and shows the OUT-component of node 2711, which contains 21
+nodes, including node 2711. Finally, we can obtain the size of all the
+components associated to node 2711 by running:</p>
+
+<pre><code> $ node_components web-NotreDame.net 2711
+ IN: 53986
+ OUT: 21
+ WCC: 325729
+ SCC: 18
+ $
+</code></pre>
+
+<p>In this case, the IN-component of node 2711 contains 53986 nodes, the
+OUT-component contains 21 nodes, the weakly connected components
+contains 325729 nodes (the whole graph), and the strongly connected
+component contains 18 nodes. It is also possible to show the list of
+nodes belonging to each component by providing <code>SHOW</code> as fourth
+parameter. IN this case, it is better to save the output of
+<code>node_components</code> into a file, e.g. by using:</p>
+
+<pre><code> $ node_components web-NotreDame.net 2711 ALL SHOW &gt; web-NotreDame.net_components_2711
+</code></pre>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="components.1.html">components<span class="s">(1)</span></a>, <a class="man-ref" href="strong_conn.1.html">strong_conn<span class="s">(1)</span></a>, <a class="man-ref" href="largest_component.1.html">largest_component<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 6, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 8, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) (c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>node_components(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/node_components.md b/doc/node_components.md
new file mode 100644
index 0000000..c82ed2b
--- /dev/null
+++ b/doc/node_components.md
@@ -0,0 +1,116 @@
+node_components(1) -- Find the components associated to a specific node
+======
+
+## SYNOPSIS
+
+`node_components` <graph_in> <node> [<component> [SHOW]]
+
+## DESCRIPTION
+
+`node_components` finds the components associated to the node <node>
+of the graph <graph_in> provided as input, and prints on output the
+size of those components. The value of the third parameter <component>
+can be set to `IN`, `OUT`, `INOUT`, `SSC`, `WCC`, or `ALL`. According
+to the value of <component>, the program will compute the IN-component
+(`IN`), the OUT-component (`OUT`), both the IN- and OUT-component
+(`INOUT`), the strongly connected components (`SCC`), or the
+weakly-connected component (`WCC`) to which <node> belongs. If the
+third parameter is omitted or equal to `ALL`, then `node_components`
+computes all the components associated to <node>. If `SHOW` is
+specified as the fourth parameter, the program also shows the list of
+nodes which belong to each of the required components.
+
+## PARAMETERS
+
+* <graph_in>:
+ input graph (edge list) if equal to `-` (dash), read the edge list
+ from STDIN.
+* <node>:
+ the label of the node.
+
+* <component>:
+ the component to compute. Can be set to one of `IN`
+ (IN-component), `OUT` (OUT-component), `INOUT` (both the IN- and
+ the OUT-component), `SSC` (strongly connected component), `WCC`
+ (weakly connected component), or `ALL` (all the above). If
+ <component> is not set, compute all the components.
+
+* SHOW:
+ If the (optional) fourth parameter is equal to `SHOW`, the program
+ will dump on output the list of all the nodes belonging to each
+ component.
+
+## OUTPUT
+
+`node_components` prints on the standard output the size of the
+required components, one per line, in the format:
+
+ comp_type_1: size_1
+ comp_type_2: size_2
+ .....
+
+where `comp_type_1` is the type of component (one of `IN`, `OUT`,
+`SCC`, or `WCC`) and `size_1` is its size, and so on. Notice that the
+sizes are not sorted. If `SHOW` is given, the program shows the list
+of nodes belonging to each component, in the format:
+
+ comp_type_1: size_1 node_1 node_2 node_3 ...
+ comp_type_2: size_2 node_1 node_2 node_3 ...
+
+## EXAMPLES
+
+We can use `node_components` to compute the IN-component of a specific
+node. For instance, the command:
+
+ $ node_components web-NotreDame.net 2711 IN
+ IN: 53968
+ $
+
+computes the size of the IN-component of node 2711 in the graph
+`www_nd.net` (WWW Notre Dame). This component contains 53968
+nodes. Similarly:
+
+ $ node_components web-NotreDame.net 2711 OUT SHOW
+ OUT: 21 559 2711 2712 2713 2714 2715 2716 ... 33271 33272
+ $
+
+computes and shows the OUT-component of node 2711, which contains 21
+nodes, including node 2711. Finally, we can obtain the size of all the
+components associated to node 2711 by running:
+
+ $ node_components web-NotreDame.net 2711
+ IN: 53986
+ OUT: 21
+ WCC: 325729
+ SCC: 18
+ $
+
+In this case, the IN-component of node 2711 contains 53986 nodes, the
+OUT-component contains 21 nodes, the weakly connected components
+contains 325729 nodes (the whole graph), and the strongly connected
+component contains 18 nodes. It is also possible to show the list of
+nodes belonging to each component by providing `SHOW` as fourth
+parameter. IN this case, it is better to save the output of
+`node_components` into a file, e.g. by using:
+
+ $ node_components web-NotreDame.net 2711 ALL SHOW > web-NotreDame.net_components_2711
+
+## SEE ALSO
+
+components(1), strong_conn(1), largest_component(1)
+
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 6, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 8, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) (c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/pm.1 b/doc/pm.1
new file mode 100644
index 0000000..f948a2d
--- /dev/null
+++ b/doc/pm.1
@@ -0,0 +1,68 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "PM" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBpm\fR \- Compute the leading eigenvalue and eigenvector of a graph
+.
+.SH "SYNOPSIS"
+\fBpm\fR \fIgraph_in\fR \fIis_dir\fR \fIeps\fR
+.
+.SH "DESCRIPTION"
+\fBpm\fR computes the leading eigenvalue and the corresponding eigenvector of the matrix given as input, using the Power Method\. In particular, this implementation uses the Rayleigh iteration, which allows faster convergence on undirected graphs\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+input graph (edge list) if equal to \fB\-\fR (dash), read the edge list from STDIN (standard input)\.
+.
+.TP
+\fIis_dir\fR
+set either to \fB0\fR (zero) for undirected graphs, or to \fB1\fR (one) for directed graphs\.
+.
+.TP
+\fIeps\fR
+Required relative error on the approximation of the leading eigenvalue\. The program terminates when the relative change in the approximation of the eigenvalue is smaller than \fBeps\fR
+.
+.SH "EXAMPLES"
+The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ pm er_1000_5000\.net 0 0\.0000001
+.
+.fi
+.
+.IP "" 0
+.
+.P
+computes the leading eigenvalue and the corresponding eigenvector of the undirected graph stored in the file \fBer_1000_5000\.txt\fR\. We can store the leading eigenvector in a file, e\.g\. by using the command:
+.
+.IP "" 4
+.
+.nf
+
+ $ pm er_1000_5000\.net 0 0\.0000001 > er_1000_5000\.net_eig
+ 11\.0335794552533
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+which will save the leading eigenvector in the file \fBer_1000_5000\.net_eig\fR, one component for each row, and shown on output the leading eigenvalue of the graph\.
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 5, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/pm.1.html b/doc/pm.1.html
new file mode 100644
index 0000000..e0e35c3
--- /dev/null
+++ b/doc/pm.1.html
@@ -0,0 +1,148 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>pm(1) - Compute the leading eigenvalue and eigenvector of a graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>pm(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>pm(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>pm</code> - <span class="man-whatis">Compute the leading eigenvalue and eigenvector of a graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>pm</code> <var>graph_in</var> <var>is_dir</var> <var>eps</var></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>pm</code> computes the leading eigenvalue and the corresponding eigenvector
+of the matrix given as input, using the Power Method. In particular,
+this implementation uses the Rayleigh iteration, which allows faster
+convergence on undirected graphs.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> input graph (edge list) if equal to <code>-</code> (dash), read the edge list
+ from STDIN (standard input).</p></dd>
+<dt class="flush"><var>is_dir</var></dt><dd><p> set either to <code>0</code> (zero) for undirected graphs, or to <code>1</code> (one)
+ for directed graphs.</p></dd>
+<dt class="flush"><var>eps</var></dt><dd><p> Required relative error on the approximation of the leading
+ eigenvalue. The program terminates when the relative change in the
+ approximation of the eigenvalue is smaller than <code>eps</code></p></dd>
+</dl>
+
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The following command:</p>
+
+<pre><code> $ pm er_1000_5000.net 0 0.0000001
+</code></pre>
+
+<p>computes the leading eigenvalue and the corresponding eigenvector of
+the undirected graph stored in the file <code>er_1000_5000.txt</code>. We can
+store the leading eigenvector in a file, e.g. by using the command:</p>
+
+<pre><code> $ pm er_1000_5000.net 0 0.0000001 &gt; er_1000_5000.net_eig
+ 11.0335794552533
+ $
+</code></pre>
+
+<p>which will save the leading eigenvector in the file
+<code>er_1000_5000.net_eig</code>, one component for each row, and shown on
+output the leading eigenvalue of the graph.</p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 5, Cambridge University Press
+(2017)</li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>pm(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/pm.md b/doc/pm.md
new file mode 100644
index 0000000..3dea06b
--- /dev/null
+++ b/doc/pm.md
@@ -0,0 +1,57 @@
+pm(1) -- Compute the leading eigenvalue and eigenvector of a graph
+======
+
+## SYNOPSIS
+
+`pm` <graph_in> <is_dir> <eps>
+
+## DESCRIPTION
+
+`pm` computes the leading eigenvalue and the corresponding eigenvector
+of the matrix given as input, using the Power Method. In particular,
+this implementation uses the Rayleigh iteration, which allows faster
+convergence on undirected graphs.
+
+## PARAMETERS
+
+* <graph_in>:
+ input graph (edge list) if equal to `-` (dash), read the edge list
+ from STDIN (standard input).
+
+* <is_dir>:
+ set either to `0` (zero) for undirected graphs, or to `1` (one)
+ for directed graphs.
+
+* <eps>:
+ Required relative error on the approximation of the leading
+ eigenvalue. The program terminates when the relative change in the
+ approximation of the eigenvalue is smaller than `eps`
+
+## EXAMPLES
+
+The following command:
+
+ $ pm er_1000_5000.net 0 0.0000001
+
+computes the leading eigenvalue and the corresponding eigenvector of
+the undirected graph stored in the file `er_1000_5000.txt`. We can
+store the leading eigenvector in a file, e.g. by using the command:
+
+ $ pm er_1000_5000.net 0 0.0000001 > er_1000_5000.net_eig
+ 11.0335794552533
+ $
+
+which will save the leading eigenvector in the file
+`er_1000_5000.net_eig`, one component for each row, and shown on
+output the leading eigenvalue of the graph.
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 5, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/power_law.1 b/doc/power_law.1
new file mode 100644
index 0000000..bfe45fd
--- /dev/null
+++ b/doc/power_law.1
@@ -0,0 +1,160 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "POWER_LAW" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBpower_law\fR \- Sample N integers from a discrete power\-law distribution
+.
+.SH "SYNOPSIS"
+\fBpower_law\fR \fIgamma\fR \fIk_min\fR \fIk_max\fR \fIN\fR
+.
+.SH "DESCRIPTION"
+\fBpower_law\fR samples \fIN\fR elements from the discrete power\-law distribution
+.
+.IP "" 4
+.
+.nf
+
+P(k) ~ k^{gamma}
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where
+.
+.IP "" 4
+.
+.nf
+
+k_min <= k <= k_max, gamma < 1
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The program can be used to generate a power\-law degree distribution with an assigned value of the exponent <gamma\.
+.
+.SH "PARAMETERS"
+.
+.IP "\(bu" 4
+\fIgamma\fR: Exponent of the power\-law distribution\.
+.
+.IP "\(bu" 4
+\fIk_min\fR, \fIk_max\fR: Boundaries of the sampling interval\.
+.
+.IP "\(bu" 4
+\fIN\fR The number of samples to generate
+.
+.IP "" 0
+.
+.SH "OUTPUT"
+\fBpower_law\fR prints on the standard output the sampled values, one per line, in the format:
+.
+.IP "" 4
+.
+.nf
+
+s1
+s2
+s3
+ \.\.\.
+sN
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The program returns the value \fB0\fR if the sum of the samples is even, or returns \fB1\fR otherwise\. The return value can be used to determine whether the set of samples can correspond to a degree sequence (if the sum of the sequence is odd, then the sequence cannot be a valid degree sequence)\. See \fIRETURN VALUES\fR below\.
+.
+.SH "EXAMPLES"
+To generate \fIN=1000\fR independent samples from the power\-law distribution \fBP(k) ~ k^(\-3)\fR, where samples are in the interval \fB[3, 50]\fR, we can use:
+.
+.IP "" 4
+.
+.nf
+
+$ power_law \-3\.0 3 50 1000
+11
+3
+3
+5
+6
+7
+ \.\.\.\.
+8
+3
+$
+.
+.fi
+.
+.IP "" 0
+.
+.P
+To save the samples in the file \fBpl_\-3\.0_3_50_1000\fR, we redirect STDOUT:
+.
+.IP "" 4
+.
+.nf
+
+$ power_law \-3\.0 3 50 1000 > pl_\-3\.0_3_50_1000
+.
+.fi
+.
+.IP "" 0
+.
+.SH "RETURN VALUES"
+The value returned by \fBpower_law\fR can be used to test whether the sum of the resulting set of samples is even or odd\. Under Windows PowerShell, you can check the last exit code by inspecting the variable \fB$lastExitCode\fR right after executing \fBpower_law\fR, as in:
+.
+.IP "" 4
+.
+.nf
+
+> power_law \-2\.7 4 300 5000 > pl_\-2\.7_4_300_5000
+> $lastExitCode
+
+0
+>
+.
+.fi
+.
+.IP "" 0
+.
+.P
+In this case, the exit code is \fB0\fR, meaning that the resulting set of samples has an even sum (and can be thus used as a degree sequence)\. Under Linux/MacOS/Unix (and in general when using any POSIX\-compliant shell) you should check the value of the variable \fB$?\fR, right after executing \fBpower_law\fR, i\.e\.:
+.
+.IP "" 4
+.
+.nf
+
+$ power_law \-2\.5 3 500 5000 > pl_\-2\.5_3_500_5000
+$ echo $?
+1
+$
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Notice that this particular run of \fBpower_law\fR has produced a sequence with an odd sum, which thus cannot correspond to a valid degree sequence\.
+.
+.SH "SEE ALSO"
+deg_seq(1), conf_model_deg(1), conf_model_deg_nocheck(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 9, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/power_law.1.html b/doc/power_law.1.html
new file mode 100644
index 0000000..7ebae1c
--- /dev/null
+++ b/doc/power_law.1.html
@@ -0,0 +1,217 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>power_law(1) - Sample N integers from a discrete power-law distribution</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#RETURN-VALUES">RETURN VALUES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>power_law(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>power_law(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>power_law</code> - <span class="man-whatis">Sample N integers from a discrete power-law distribution</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>power_law</code> <var>gamma</var> <var>k_min</var> <var>k_max</var> <var>N</var></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>power_law</code> samples <var>N</var> elements from the discrete power-law
+distribution</p>
+
+<pre><code>P(k) ~ k^{gamma}
+</code></pre>
+
+<p>where</p>
+
+<pre><code>k_min &lt;= k &lt;= k_max, gamma &lt; 1
+</code></pre>
+
+<p>The program can be used to generate a power-law degree distribution
+with an assigned value of the exponent &lt;gamma.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<ul>
+<li><p><var>gamma</var>:
+ Exponent of the power-law distribution.</p></li>
+<li><p><var>k_min</var>, <var>k_max</var>:
+ Boundaries of the sampling interval.</p></li>
+<li><p><var>N</var>
+ The number of samples to generate</p></li>
+</ul>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>power_law</code> prints on the standard output the sampled values, one per
+line, in the format:</p>
+
+<pre><code>s1
+s2
+s3
+ ...
+sN
+</code></pre>
+
+<p>The program returns the value <code>0</code> if the sum of the samples is even,
+or returns <code>1</code> otherwise. The return value can be used to determine
+whether the set of samples can correspond to a degree sequence (if the
+sum of the sequence is odd, then the sequence cannot be a valid degree
+sequence). See <a href="#RETURN-VALUES" title="RETURN VALUES" data-bare-link="true">RETURN VALUES</a> below.</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>To generate <var>N=1000</var> independent samples from the power-law
+distribution <code>P(k) ~ k^(-3)</code>, where samples are in the interval
+<code>[3, 50]</code>, we can use:</p>
+
+<pre><code>$ power_law -3.0 3 50 1000
+11
+3
+3
+5
+6
+7
+ ....
+8
+3
+$
+</code></pre>
+
+<p>To save the samples in the file <code>pl_-3.0_3_50_1000</code>, we redirect STDOUT:</p>
+
+<pre><code>$ power_law -3.0 3 50 1000 &gt; pl_-3.0_3_50_1000
+</code></pre>
+
+<h2 id="RETURN-VALUES">RETURN VALUES</h2>
+
+<p>The value returned by <code>power_law</code> can be used to test whether the sum
+of the resulting set of samples is even or odd. Under Windows
+PowerShell, you can check the last exit code by inspecting the
+variable <code>$lastExitCode</code> right after executing <code>power_law</code>, as in:</p>
+
+<pre><code>&gt; power_law -2.7 4 300 5000 &gt; pl_-2.7_4_300_5000
+&gt; $lastExitCode
+
+0
+&gt;
+</code></pre>
+
+<p>In this case, the exit code is <code>0</code>, meaning that the resulting set of
+samples has an even sum (and can be thus used as a degree
+sequence). Under Linux/MacOS/Unix (and in general when using any
+POSIX-compliant shell) you should check the value of the variable
+<code>$?</code>, right after executing <code>power_law</code>, i.e.:</p>
+
+<pre><code>$ power_law -2.5 3 500 5000 &gt; pl_-2.5_3_500_5000
+$ echo $?
+1
+$
+</code></pre>
+
+<p>Notice that this particular run of <code>power_law</code> has produced a sequence
+with an odd sum, which thus cannot correspond to a valid degree sequence.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="deg_seq.1.html">deg_seq<span class="s">(1)</span></a>, <a class="man-ref" href="conf_model_deg.1.html">conf_model_deg<span class="s">(1)</span></a>, <a class="man-ref" href="conf_model_deg_nocheck.1.html">conf_model_deg_nocheck<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 5, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 9, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>power_law(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/power_law.md b/doc/power_law.md
new file mode 100644
index 0000000..47bef2c
--- /dev/null
+++ b/doc/power_law.md
@@ -0,0 +1,118 @@
+power_law(1) -- Sample N integers from a discrete power-law distribution
+======
+
+## SYNOPSIS
+
+`power_law` <gamma> <k_min> <k_max> <N>
+
+## DESCRIPTION
+
+`power_law` samples <N> elements from the discrete power-law
+distribution
+
+ P(k) ~ k^{gamma}
+
+where
+
+ k_min <= k <= k_max, gamma < 1
+
+The program can be used to generate a power-law degree distribution
+with an assigned value of the exponent <gamma>.
+
+
+## PARAMETERS
+
+* <gamma>:
+ Exponent of the power-law distribution.
+
+* <k_min>, <k_max>:
+ Boundaries of the sampling interval.
+
+* <N>
+ The number of samples to generate
+
+## OUTPUT
+
+`power_law` prints on the standard output the sampled values, one per
+line, in the format:
+
+ s1
+ s2
+ s3
+ ...
+ sN
+
+The program returns the value `0` if the sum of the samples is even,
+or returns `1` otherwise. The return value can be used to determine
+whether the set of samples can correspond to a degree sequence (if the
+sum of the sequence is odd, then the sequence cannot be a valid degree
+sequence). See [RETURN VALUES][] below.
+
+## EXAMPLES
+
+To generate <N=1000> independent samples from the power-law
+distribution `P(k) ~ k^(-3)`, where samples are in the interval
+`[3, 50]`, we can use:
+
+ $ power_law -3.0 3 50 1000
+ 11
+ 3
+ 3
+ 5
+ 6
+ 7
+ ....
+ 8
+ 3
+ $
+
+To save the samples in the file `pl_-3.0_3_50_1000`, we redirect STDOUT:
+
+ $ power_law -3.0 3 50 1000 > pl_-3.0_3_50_1000
+
+## RETURN VALUES
+
+The value returned by `power_law ` can be used to test whether the sum
+of the resulting set of samples is even or odd. Under Windows
+PowerShell, you can check the last exit code by inspecting the
+variable `$lastExitCode` right after executing `power_law`, as in:
+
+ > power_law -2.7 4 300 5000 > pl_-2.7_4_300_5000
+ > $lastExitCode
+
+ 0
+ >
+
+In this case, the exit code is `0`, meaning that the resulting set of
+samples has an even sum (and can be thus used as a degree
+sequence). Under Linux/MacOS/Unix (and in general when using any
+POSIX-compliant shell) you should check the value of the variable
+`$?`, right after executing `power_law`, i.e.:
+
+ $ power_law -2.5 3 500 5000 > pl_-2.5_3_500_5000
+ $ echo $?
+ 1
+ $
+
+Notice that this particular run of `power_law` has produced a sequence
+with an odd sum, which thus cannot correspond to a valid degree sequence.
+
+## SEE ALSO
+
+deg_seq(1), conf_model_deg(1), conf_model_deg_nocheck(1)
+
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 5, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 9, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/shortest.1 b/doc/shortest.1
new file mode 100644
index 0000000..a227efa
--- /dev/null
+++ b/doc/shortest.1
@@ -0,0 +1,105 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "SHORTEST" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBshortest\fR \- Compute the distance between one node and all the other nodes of a graph
+.
+.SH "SYNOPSIS"
+\fBshortest\fR \fIgraph_in\fR \fInode\fR [SHOW]
+.
+.SH "DESCRIPTION"
+\fBshortest\fR computes the distance (and the shortest paths) between a given node and all the other nodes of an undirected graph provided as input\. The program implements the Breadth\-First Search algorithm\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+input graph (edge list) if equal to \fB\-\fR (dash), read the edge list from STDIN\.
+.
+.TP
+\fInode\fR
+The label of the node from which distances are to be computed
+.
+.TP
+SHOW
+If the third (optional) parameter is equal to \fBSHOW\fR, the program will dump on the standard error also all the shortest paths between \fInode\fR and all the other nodes of the graph
+.
+.SH "OUTPUT"
+\fBshortest\fR prints on the standard output the distances betwen \fInode\fR and all the other nodes of the graph, in the format:
+.
+.IP "" 4
+.
+.nf
+
+d0 d1 d2 d3\.\.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBd0\fR is the distance to node \fB0\fR, \fBd1\fR is the distance to node \fB1\fR, and so forth\. If \fBSHOW\fR is given, the list of all the shortest paths between \fInode\fR and the other nodes is printed on the standard error, one path per line, in the format:
+.
+.IP "" 4
+.
+.nf
+
+label0 label1 label2 \.\.\. node
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBlabel1\fR, \fBlabel2\fR, etc\. are the labels of a shortest path between \fBlabel0\fR and \fInode\fR
+.
+.SH "EXAMPLES"
+The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ shortest er_1000_5000\.net 25
+ 3 4 4 4 2\.\.\.\.\.\.\.
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+will show on output the distances between node 25 and all the other nodes in the graph \fBer_1000_5000\.net\fR\. If we invoke the program with:
+.
+.IP "" 4
+.
+.nf
+
+ $ shortest er_1000_5000\.net 25 SHOW 2>er_1000_5000\.net_25_paths
+ 3 4 4 4 2\.\.\.\.\.\.\.
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+the program will dump on STDERR the list of all the shortest paths between \'node\' and all the other nodes of the graph\. Since we used the redirection \fB2>er_1000_5000\.net_25_paths\fR (which can be read "redirect STDERR to \'er_1000_5000\.net_25_paths\' "), the list of shortest paths will be written to the file \fBer_1000_5000\.net_25_paths\fR\.
+.
+.SH "SEE ALSO"
+dijkstra(1), bet_dependency(1), betweenness(1), shortest_avg_max_hist(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 3, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 6, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/shortest.1.html b/doc/shortest.1.html
new file mode 100644
index 0000000..df962b0
--- /dev/null
+++ b/doc/shortest.1.html
@@ -0,0 +1,177 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>shortest(1) - Compute the distance between one node and all the other nodes of a graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>shortest(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>shortest(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>shortest</code> - <span class="man-whatis">Compute the distance between one node and all the other nodes of a graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>shortest</code> <var>graph_in</var> <var>node</var> [SHOW]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>shortest</code> computes the distance (and the shortest paths) between a
+given node and all the other nodes of an undirected graph provided as
+input. The program implements the Breadth-First Search algorithm.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> input graph (edge list) if equal to <code>-</code> (dash), read the edge list
+ from STDIN.</p></dd>
+<dt class="flush"><var>node</var></dt><dd><p> The label of the node from which distances are to be computed</p></dd>
+<dt class="flush">SHOW</dt><dd><p> If the third (optional) parameter is equal to <code>SHOW</code>, the program
+ will dump on the standard error also all the shortest paths
+ between <var>node</var> and all the other nodes of the graph</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>shortest</code> prints on the standard output the distances betwen <var>node</var>
+and all the other nodes of the graph, in the format:</p>
+
+<pre><code>d0 d1 d2 d3.....
+</code></pre>
+
+<p>where <code>d0</code> is the distance to node <code>0</code>, <code>d1</code> is the distance to node
+<code>1</code>, and so forth. If <code>SHOW</code> is given, the list of all the shortest
+paths between <var>node</var> and the other nodes is printed on the standard
+error, one path per line, in the format:</p>
+
+<pre><code>label0 label1 label2 ... node
+</code></pre>
+
+<p>where <code>label1</code>, <code>label2</code>, etc. are the labels of a shortest path
+between <code>label0</code> and <var>node</var></p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The following command:</p>
+
+<pre><code> $ shortest er_1000_5000.net 25
+ 3 4 4 4 2.......
+ $
+</code></pre>
+
+<p>will show on output the distances between node 25 and all the other
+nodes in the graph <code>er_1000_5000.net</code>. If we invoke the program with:</p>
+
+<pre><code> $ shortest er_1000_5000.net 25 SHOW 2&gt;er_1000_5000.net_25_paths
+ 3 4 4 4 2.......
+ $
+</code></pre>
+
+<p>the program will dump on STDERR the list of all the shortest paths
+between 'node' and all the other nodes of the graph. Since we used the
+redirection <code>2&gt;er_1000_5000.net_25_paths</code> (which can be read "redirect
+STDERR to 'er_1000_5000.net_25_paths' "), the list of shortest
+paths will be written to the file <code>er_1000_5000.net_25_paths</code>.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="dijkstra.1.html">dijkstra<span class="s">(1)</span></a>, <a class="man-ref" href="bet_dependency.1.html">bet_dependency<span class="s">(1)</span></a>, <a class="man-ref" href="betweenness.1.html">betweenness<span class="s">(1)</span></a>, <a class="man-ref" href="shortest_avg_max_hist.1.html">shortest_avg_max_hist<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 3, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 6, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>shortest(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/shortest.md b/doc/shortest.md
new file mode 100644
index 0000000..e66d845
--- /dev/null
+++ b/doc/shortest.md
@@ -0,0 +1,83 @@
+shortest(1) -- Compute the distance between one node and all the other nodes of a graph
+======
+
+## SYNOPSIS
+
+`shortest` <graph_in> <node> [SHOW]
+
+## DESCRIPTION
+
+`shortest` computes the distance (and the shortest paths) between a
+given node and all the other nodes of an undirected graph provided as
+input. The program implements the Breadth-First Search algorithm.
+
+## PARAMETERS
+
+* <graph_in>:
+ input graph (edge list) if equal to `-` (dash), read the edge list
+ from STDIN.
+
+* <node>:
+ The label of the node from which distances are to be computed
+
+* SHOW:
+ If the third (optional) parameter is equal to `SHOW`, the program
+ will dump on the standard error also all the shortest paths
+ between <node> and all the other nodes of the graph
+
+## OUTPUT
+
+`shortest` prints on the standard output the distances betwen <node>
+and all the other nodes of the graph, in the format:
+
+ d0 d1 d2 d3.....
+
+where `d0` is the distance to node `0`, `d1` is the distance to node
+`1`, and so forth. If `SHOW` is given, the list of all the shortest
+paths between <node> and the other nodes is printed on the standard
+error, one path per line, in the format:
+
+ label0 label1 label2 ... node
+
+where `label1`, `label2`, etc. are the labels of a shortest path
+between `label0` and <node>
+
+## EXAMPLES
+
+The following command:
+
+ $ shortest er_1000_5000.net 25
+ 3 4 4 4 2.......
+ $
+
+will show on output the distances between node 25 and all the other
+nodes in the graph `er_1000_5000.net`. If we invoke the program with:
+
+ $ shortest er_1000_5000.net 25 SHOW 2>er_1000_5000.net_25_paths
+ 3 4 4 4 2.......
+ $
+
+the program will dump on STDERR the list of all the shortest paths
+between 'node' and all the other nodes of the graph. Since we used the
+redirection `2>er_1000_5000.net_25_paths` (which can be read "redirect
+STDERR to 'er\_1000\_5000.net\_25\_paths' "), the list of shortest
+paths will be written to the file `er_1000_5000.net_25_paths`.
+
+## SEE ALSO
+
+dijkstra(1), bet_dependency(1), betweenness(1), shortest_avg_max_hist(1)
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 3, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 6, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/shortest_avg_max_hist.1 b/doc/shortest_avg_max_hist.1
new file mode 100644
index 0000000..8bb8653
--- /dev/null
+++ b/doc/shortest_avg_max_hist.1
@@ -0,0 +1,60 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "SHORTEST_AVG_MAX_HIST" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBshortest_avg_max_hist\fR \- Compute the distance between one node and all the other nodes of a graph
+.
+.SH "SYNOPSIS"
+\fBshortest_avg_max_hist\fR \fIgraph_in\fR \fInode\fR
+.
+.SH "DESCRIPTION"
+\fBshortest_avg_max_hist\fR computes the distance (and the shortest paths) between a given node and all the other nodes of an undirected graph provided as input\. The program implements the Breadth\-First Search algorithm, and works almost exactly as shortest(1) \fIshortest\.1\.html\fR, except for the output\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+input graph (edge list) if equal to \fB\-\fR (dash), read the edge list from STDIN\.
+.
+.TP
+\fInode\fR
+The label of the node from which distances are to be computed
+.
+.SH "OUTPUT"
+The output
+.
+.SH "EXAMPLES"
+The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ shortest_avg_max_hist er_1000_5000\.net 25
+ 3\.2002 4 11 111 544 333
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+is showing the average distance between node \fB25\fR and all the other nodes in the graph (\fB3\.2002\fR), the eccentricity of node \fB25\fR (equal to \fB4\fR), and the number of nodes at distance \fB1\fR (11), \fB2\fR (111), \fB3\fR (544) and \fB4\fR (333) from node \fB25\fR\.
+.
+.SH "SEE ALSO"
+shortest(1), betweenness(1), bet_dependency(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 3, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 6, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/shortest_avg_max_hist.1.html b/doc/shortest_avg_max_hist.1.html
new file mode 100644
index 0000000..8169b7c
--- /dev/null
+++ b/doc/shortest_avg_max_hist.1.html
@@ -0,0 +1,152 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>shortest_avg_max_hist(1) - Compute the distance between one node and all the other nodes of a graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>shortest_avg_max_hist(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>shortest_avg_max_hist(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>shortest_avg_max_hist</code> - <span class="man-whatis">Compute the distance between one node and all the other nodes of a graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>shortest_avg_max_hist</code> <var>graph_in</var> <var>node</var></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>shortest_avg_max_hist</code> computes the distance (and the shortest paths)
+between a given node and all the other nodes of an undirected graph
+provided as input. The program implements the Breadth-First Search
+algorithm, and works almost exactly as <a href="shortest.1.html">shortest(1)</a>, except for the
+output.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> input graph (edge list) if equal to <code>-</code> (dash), read the edge list
+ from STDIN.</p></dd>
+<dt class="flush"><var>node</var></dt><dd><p> The label of the node from which distances are to be computed</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p>The output</p>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The following command:</p>
+
+<pre><code> $ shortest_avg_max_hist er_1000_5000.net 25
+ 3.2002 4 11 111 544 333
+ $
+</code></pre>
+
+<p>is showing the average distance between node <code>25</code> and all the other
+nodes in the graph (<code>3.2002</code>), the eccentricity of node <code>25</code> (equal to
+<code>4</code>), and the number of nodes at distance <code>1</code> (11), <code>2</code> (111), <code>3</code>
+(544) and <code>4</code> (333) from node <code>25</code>.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="shortest.1.html">shortest<span class="s">(1)</span></a>, <a class="man-ref" href="betweenness.1.html">betweenness<span class="s">(1)</span></a>, <a class="man-ref" href="bet_dependency.1.html">bet_dependency<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 3, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 6, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>shortest_avg_max_hist(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/shortest_avg_max_hist.md b/doc/shortest_avg_max_hist.md
new file mode 100644
index 0000000..9d5055b
--- /dev/null
+++ b/doc/shortest_avg_max_hist.md
@@ -0,0 +1,61 @@
+shortest\_avg\_max\_hist(1) -- Compute the distance between one node and all the other nodes of a graph
+======
+
+## SYNOPSIS
+
+`shortest_avg_max_hist` <graph_in> <node>
+
+## DESCRIPTION
+
+`shortest_avg_max_hist` computes the distance (and the shortest paths)
+between a given node and all the other nodes of an undirected graph
+provided as input. The program implements the Breadth-First Search
+algorithm, and works almost exactly as [shortest(1)][], except for the
+output.
+
+## PARAMETERS
+
+* <graph_in>:
+ input graph (edge list) if equal to `-` (dash), read the edge list
+ from STDIN.
+
+* <node>:
+ The label of the node from which distances are to be computed
+
+## OUTPUT
+
+The output
+
+## EXAMPLES
+
+The following command:
+
+ $ shortest_avg_max_hist er_1000_5000.net 25
+ 3.2002 4 11 111 544 333
+ $
+
+is showing the average distance between node `25` and all the other
+nodes in the graph (`3.2002`), the eccentricity of node `25` (equal to
+`4`), and the number of nodes at distance `1` (11), `2` (111), `3`
+(544) and `4` (333) from node `25`.
+
+
+## SEE ALSO
+
+shortest(1), betweenness(1), bet_dependency(1)
+
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 3, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 6, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/strong_conn.1 b/doc/strong_conn.1
new file mode 100644
index 0000000..73cc0fe
--- /dev/null
+++ b/doc/strong_conn.1
@@ -0,0 +1,127 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "STRONG_CONN" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBstrong_conn\fR \- Find the strongly connected components of a directed graph
+.
+.SH "SYNOPSIS"
+\fBstrong_conn\fR \fIgraph_in\fR [SHOW]
+.
+.SH "DESCRIPTION"
+\fBstrong_conn\fR finds the strongly connected components of the directed graph given as input using the Kosaraju\-Sharir algorithm, and prints the size of each of them\. If the optional second parameter \fBSHOW\fR is provided, the program dumps on output also the list of nodes belonging to each component\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIgraph_in\fR
+input graph (edge list) if equal to \fB\-\fR (dash), read the edge list from STDIN\.
+.
+.TP
+SHOW
+If the (optional) second parameter is equal to \fBSHOW\fR, the program will dump on output the list of all the nodes belonging to each strongly connected component\.
+.
+.SH "OUTPUT"
+\fBstrong_conn\fR prints on the standard output the size of all the strongly connected components of the directed graph given as input, one per line:
+.
+.IP "" 4
+.
+.nf
+
+ size_1
+ size_2
+ size_3
+ \.\.\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+where \fBsize_1\fR is the size of the first component, \fBsize_2\fR is the size of the second component, and so on\. Notice that the sizes are not sorted\. If \fBSHOW\fR is given, the program shows the list of nodes belonging to each strongly connected component, in the format:
+.
+.IP "" 4
+.
+.nf
+
+size_1: node_1 node_2 node_3 \.\.\.
+size_2: node_1 node_2 node_3 \.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.SH "EXAMPLES"
+The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ strong_conn web\-NotreDame\.net
+ 53968
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ \.\.\.\.
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+shows on output the size of the strongly connected component of the graph \fBweb\-NotreDame\.net\fR (the NotreDame WWW data set), in no particular order\. In this case the graph has 203609 strongly connected components, most of them containing only 1 isolated node\. If we want to know who are the nodes belonging to each connected component, we run:
+.
+.IP "" 4
+.
+.nf
+
+ $ strong_conn web\-NotreDame\.net SHOW
+ 53968: 0 1 3 4 5 6 7 8\.\.\.\.\.
+ \.\.\.\.\. 325727 325728
+ 1: 351
+ 1: 350
+ 1: 2209
+ 1: 2208
+ 1: 2206
+ 1: 10609
+ \.\.\.\.
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+It is better to save the output of \fBstrong_conn\fR into a file, e\.g\. by using:
+.
+.IP "" 4
+.
+.nf
+
+ $ strong_conn web\-NotreDame\.net SHOW > web\-NotreDame\.net_scc
+.
+.fi
+.
+.IP "" 0
+.
+.SH "SEE ALSO"
+components(1), node_components(1), largest_component(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Chapter 6, Cambridge University Press (2017)
+.
+.IP "\(bu" 4
+V\. Latora, V\. Nicosia, G\. Russo, "Complex Networks: Principles, Methods and Applications", Appendix 8, Cambridge University Press (2017)
+.
+.IP "" 0
+.
+.SH "AUTHORS"
+(c) Vincenzo \'KatolaZ\' Nicosia 2009\-2017 \fB<v\.nicosia@qmul\.ac\.uk>\fR\.
diff --git a/doc/strong_conn.1.html b/doc/strong_conn.1.html
new file mode 100644
index 0000000..4b4e0af
--- /dev/null
+++ b/doc/strong_conn.1.html
@@ -0,0 +1,199 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>strong_conn(1) - Find the strongly connected components of a directed graph</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#OUTPUT">OUTPUT</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>strong_conn(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>strong_conn(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>strong_conn</code> - <span class="man-whatis">Find the strongly connected components of a directed graph</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>strong_conn</code> <var>graph_in</var> [SHOW]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>strong_conn</code> finds the strongly connected components of the directed
+graph given as input using the Kosaraju-Sharir algorithm, and prints
+the size of each of them. If the optional second parameter <code>SHOW</code> is
+provided, the program dumps on output also the list of nodes belonging
+to each component.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt><var>graph_in</var></dt><dd><p> input graph (edge list) if equal to <code>-</code> (dash), read the edge list
+ from STDIN.</p></dd>
+<dt class="flush">SHOW</dt><dd><p> If the (optional) second parameter is equal to <code>SHOW</code>, the program
+ will dump on output the list of all the nodes belonging to each
+ strongly connected component.</p></dd>
+</dl>
+
+
+<h2 id="OUTPUT">OUTPUT</h2>
+
+<p><code>strong_conn</code> prints on the standard output the size of all the
+strongly connected components of the directed graph given as input,
+one per line:</p>
+
+<pre><code> size_1
+ size_2
+ size_3
+ .....
+</code></pre>
+
+<p>where <code>size_1</code> is the size of the first component, <code>size_2</code> is the
+size of the second component, and so on. Notice that the sizes are not
+sorted. If <code>SHOW</code> is given, the program shows the list of nodes
+belonging to each strongly connected component, in the format:</p>
+
+<pre><code>size_1: node_1 node_2 node_3 ...
+size_2: node_1 node_2 node_3 ...
+</code></pre>
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The following command:</p>
+
+<pre><code> $ strong_conn web-NotreDame.net
+ 53968
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ ....
+ $
+</code></pre>
+
+<p>shows on output the size of the strongly connected component of the
+graph <code>web-NotreDame.net</code> (the NotreDame WWW data set), in no particular
+order. In this case the graph has 203609 strongly connected
+components, most of them containing only 1 isolated node. If we want
+to know who are the nodes belonging to each connected component, we
+run:</p>
+
+<pre><code> $ strong_conn web-NotreDame.net SHOW
+ 53968: 0 1 3 4 5 6 7 8.....
+ ..... 325727 325728
+ 1: 351
+ 1: 350
+ 1: 2209
+ 1: 2208
+ 1: 2206
+ 1: 10609
+ ....
+ $
+</code></pre>
+
+<p>It is better to save the output of <code>strong_conn</code> into a file, e.g. by
+using:</p>
+
+<pre><code> $ strong_conn web-NotreDame.net SHOW &gt; web-NotreDame.net_scc
+</code></pre>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="components.1.html">components<span class="s">(1)</span></a>, <a class="man-ref" href="node_components.1.html">node_components<span class="s">(1)</span></a>, <a class="man-ref" href="largest_component.1.html">largest_component<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 6, Cambridge University Press
+(2017)</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Appendix 8, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>strong_conn(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/strong_conn.md b/doc/strong_conn.md
new file mode 100644
index 0000000..fd2abb7
--- /dev/null
+++ b/doc/strong_conn.md
@@ -0,0 +1,104 @@
+strong_conn(1) -- Find the strongly connected components of a directed graph
+======
+
+## SYNOPSIS
+
+`strong_conn` <graph_in> [SHOW]
+
+## DESCRIPTION
+
+`strong_conn` finds the strongly connected components of the directed
+graph given as input using the Kosaraju-Sharir algorithm, and prints
+the size of each of them. If the optional second parameter `SHOW` is
+provided, the program dumps on output also the list of nodes belonging
+to each component.
+
+## PARAMETERS
+
+* <graph_in>:
+ input graph (edge list) if equal to `-` (dash), read the edge list
+ from STDIN.
+
+
+* SHOW:
+ If the (optional) second parameter is equal to `SHOW`, the program
+ will dump on output the list of all the nodes belonging to each
+ strongly connected component.
+
+## OUTPUT
+
+`strong_conn` prints on the standard output the size of all the
+strongly connected components of the directed graph given as input,
+one per line:
+
+ size_1
+ size_2
+ size_3
+ .....
+
+where `size_1` is the size of the first component, `size_2` is the
+size of the second component, and so on. Notice that the sizes are not
+sorted. If `SHOW` is given, the program shows the list of nodes
+belonging to each strongly connected component, in the format:
+
+ size_1: node_1 node_2 node_3 ...
+ size_2: node_1 node_2 node_3 ...
+
+## EXAMPLES
+
+The following command:
+
+ $ strong_conn web-NotreDame.net
+ 53968
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ ....
+ $
+
+shows on output the size of the strongly connected component of the
+graph `web-NotreDame.net` (the NotreDame WWW data set), in no particular
+order. In this case the graph has 203609 strongly connected
+components, most of them containing only 1 isolated node. If we want
+to know who are the nodes belonging to each connected component, we
+run:
+
+ $ strong_conn web-NotreDame.net SHOW
+ 53968: 0 1 3 4 5 6 7 8.....
+ ..... 325727 325728
+ 1: 351
+ 1: 350
+ 1: 2209
+ 1: 2208
+ 1: 2206
+ 1: 10609
+ ....
+ $
+
+It is better to save the output of `strong_conn` into a file, e.g. by
+using:
+
+ $ strong_conn web-NotreDame.net SHOW > web-NotreDame.net_scc
+
+## SEE ALSO
+
+components(1), node\_components(1), largest_component(1)
+
+
+## REFERENCES
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 6, Cambridge University Press
+ (2017)
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Appendix 8, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.
diff --git a/doc/ws.1 b/doc/ws.1
new file mode 100644
index 0000000..7377435
--- /dev/null
+++ b/doc/ws.1
@@ -0,0 +1,90 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "WS" "1" "September 2017" "www.complex-networks.net" "www.complex-networks.net"
+.
+.SH "NAME"
+\fBws\fR \- Create a small\-world graph using the Watts\-Strogatz model
+.
+.SH "SYNOPSIS"
+\fBws\fR \fIN\fR \fIm\fR \fIp\fR [SHOW]
+.
+.SH "DESCRIPTION"
+\fBws\fR creates a small\-world undirected graph with \'N\' nodes using the Watts\-Strogatz small\-world network model\. The nodes are initially placed around a circle and each node is connected to its \'m\' closest neighbours on either side\. Then, each edge is rewired (independently) with probability \'p\'\. The program prints on output the edge\-list of the resulting graph\.
+.
+.SH "PARAMETERS"
+.
+.TP
+\fIN\fR
+Number of nodes in the final graph\.
+.
+.TP
+\fIm\fR
+Number of neighbours on the circle graph to which a node is connected on either side (i\.e\., each node will initially have \'2m\' edges)\.
+.
+.TP
+\fIp\fR
+Edge rewiring probability\.
+.
+.TP
+SHOW
+If the fourth (optional) parameter is equal to \fBSHOW\fR, the program will print on STDERR the number of edges rewired while constructing the graph\.
+.
+.SH "EXAMPLES"
+The command:
+.
+.IP "" 4
+.
+.nf
+
+ $ ws 100 3 0\.1
+ 0 95
+ 0 2
+ 0 3
+ 1 2
+ 1 24
+ 1 4
+ 2 3
+ \.\.\.\.
+ 99 0
+ 99 56
+ 99 2
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+creates a Watts\-Strogatz small\-world network with \'N=100\' nodes and \'K=m*N=300\' edges, where each edge is independently rewired with probability \'p=0\.1\'\. The output of \fBws\fR is the edge\-list of the resulting graph\. Notice that in this case the first edge od node \fB0\fR has been rewired and connected to node \fB95\fR\. In order to be useful, such edge\-list should be saved into a file\. The following command:
+.
+.IP "" 4
+.
+.nf
+
+ $ ws 100 300 0\.1 SHOW > ws_100_3_0\.1\.net
+ Rewired edges: 32
+ $
+.
+.fi
+.
+.IP "" 0
+.
+.P
+will save the resulting graph in the file \fBws_100_3_0\.1\.net\fR\. Notice the usage of the symbol ">" to redirect the output of the program to a file\. The line printed on output reports the number of rewired edges, since \fBSHOW\fR was specified as a fourth parameter\.
+.
+.SH "SEE ALSO"
+er_A(1), er_B(1)
+.
+.SH "REFERENCES"
+.
+.IP "\(bu" 4
+D\. J\. Watts and S\. H\. Strogatz\. "Collective dynamics of \'small\-world\' networks"\. Nature 393 (1998), 440–442\.
+.
+.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\.
diff --git a/doc/ws.1.html b/doc/ws.1.html
new file mode 100644
index 0000000..c3ff511
--- /dev/null
+++ b/doc/ws.1.html
@@ -0,0 +1,174 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
+ <title>ws(1) - Create a small-world graph using the Watts-Strogatz model</title>
+ <style type='text/css' media='all'>
+ /* style: man */
+ body#manpage {margin:0}
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
+ .mp h2 {margin:10px 0 0 0}
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
+ .mp h3 {margin:0 0 0 4ex}
+ .mp dt {margin:0;clear:left}
+ .mp dt.flush {float:left;width:8ex}
+ .mp dd {margin:0 0 0 9ex}
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
+ .mp pre {margin-bottom:20px}
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
+ .mp img {display:block;margin:auto}
+ .mp h1.man-title {display:none}
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
+ .mp h2 {font-size:16px;line-height:1.25}
+ .mp h1 {font-size:20px;line-height:2}
+ .mp {text-align:justify;background:#fff}
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
+ .mp u {text-decoration:underline}
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
+ .mp b.man-ref {font-weight:normal;color:#434241}
+ .mp pre {padding:0 4ex}
+ .mp pre code {font-weight:normal;color:#434241}
+ .mp h2+pre,h3+pre {padding-left:0}
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
+ ol.man-decor {width:100%}
+ ol.man-decor li.tl {text-align:left}
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
+ ol.man-decor li.tr {text-align:right;float:right}
+ </style>
+ <style type='text/css' media='all'>
+ /* style: toc */
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
+ .man-navigation a:hover {color:#111;text-decoration:underline}
+ </style>
+</head>
+<!--
+ The following styles are deprecated and will be removed at some point:
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
+
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
+ .man-navigation should be used instead.
+-->
+<body id='manpage'>
+ <div class='mp' id='man'>
+
+ <div class='man-navigation' style='display:none'>
+ <a href="#NAME">NAME</a>
+ <a href="#SYNOPSIS">SYNOPSIS</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#PARAMETERS">PARAMETERS</a>
+ <a href="#EXAMPLES">EXAMPLES</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#REFERENCES">REFERENCES</a>
+ <a href="#AUTHORS">AUTHORS</a>
+ </div>
+
+ <ol class='man-decor man-head man head'>
+ <li class='tl'>ws(1)</li>
+ <li class='tc'>www.complex-networks.net</li>
+ <li class='tr'>ws(1)</li>
+ </ol>
+
+ <h2 id="NAME">NAME</h2>
+<p class="man-name">
+ <code>ws</code> - <span class="man-whatis">Create a small-world graph using the Watts-Strogatz model</span>
+</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<p><code>ws</code> <var>N</var> <var>m</var> <em>p</em> [SHOW]</p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p><code>ws</code> creates a small-world undirected graph with 'N' nodes using the
+Watts-Strogatz small-world network model. The nodes are initially
+placed around a circle and each node is connected to its 'm' closest
+neighbours on either side. Then, each edge is rewired (independently)
+with probability 'p'. The program prints on output the edge-list of
+the resulting graph.</p>
+
+<h2 id="PARAMETERS">PARAMETERS</h2>
+
+<dl>
+<dt class="flush"><var>N</var></dt><dd><p> Number of nodes in the final graph.</p></dd>
+<dt class="flush"><var>m</var></dt><dd><p> Number of neighbours on the circle graph to which a node is
+ connected on either side (i.e., each node will initially have
+ '2m' edges).</p></dd>
+<dt class="flush"><em>p</em></dt><dd><p> Edge rewiring probability.</p></dd>
+<dt class="flush">SHOW</dt><dd><p> If the fourth (optional) parameter is equal to <code>SHOW</code>, the program
+ will print on STDERR the number of edges rewired while constructing
+ the graph.</p></dd>
+</dl>
+
+
+<h2 id="EXAMPLES">EXAMPLES</h2>
+
+<p>The command:</p>
+
+<pre><code> $ ws 100 3 0.1
+ 0 95
+ 0 2
+ 0 3
+ 1 2
+ 1 24
+ 1 4
+ 2 3
+ ....
+ 99 0
+ 99 56
+ 99 2
+ $
+</code></pre>
+
+<p>creates a Watts-Strogatz small-world network with 'N=100' nodes and
+'K=m*N=300' edges, where each edge is independently rewired with
+probability 'p=0.1'. The output of <code>ws</code> is the edge-list of the
+resulting graph. Notice that in this case the first edge od node <code>0</code>
+has been rewired and connected to node <code>95</code>. In order to be useful,
+such edge-list should be saved into a file. The following command:</p>
+
+<pre><code> $ ws 100 300 0.1 SHOW &gt; ws_100_3_0.1.net
+ Rewired edges: 32
+ $
+</code></pre>
+
+<p>will save the resulting graph in the file <code>ws_100_3_0.1.net</code>. Notice
+the usage of the symbol ">" to redirect the output of the program to
+a file. The line printed on output reports the number of rewired
+edges, since <code>SHOW</code> was specified as a fourth parameter.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p><a class="man-ref" href="er_A.1.html">er_A<span class="s">(1)</span></a>, <a class="man-ref" href="er_B.1.html">er_B<span class="s">(1)</span></a></p>
+
+<h2 id="REFERENCES">REFERENCES</h2>
+
+<ul>
+<li><p>D. J. Watts and S. H. Strogatz. "Collective dynamics of
+'small-world' networks". Nature 393 (1998), 440–442.</p></li>
+<li><p>V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+Methods and Applications", Chapter 4, Cambridge University Press
+(2017)</p></li>
+</ul>
+
+
+<h2 id="AUTHORS">AUTHORS</h2>
+
+<p>(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 <code>&lt;v.nicosia@qmul.ac.uk&gt;</code>.</p>
+
+
+ <ol class='man-decor man-foot man foot'>
+ <li class='tl'>www.complex-networks.net</li>
+ <li class='tc'>September 2017</li>
+ <li class='tr'>ws(1)</li>
+ </ol>
+
+ </div>
+</body>
+</html>
diff --git a/doc/ws.md b/doc/ws.md
new file mode 100644
index 0000000..242a6c9
--- /dev/null
+++ b/doc/ws.md
@@ -0,0 +1,85 @@
+ws(1) -- Create a small-world graph using the Watts-Strogatz model
+======
+
+## SYNOPSIS
+
+`ws` <N> <m> _p_ [SHOW]
+
+## DESCRIPTION
+
+`ws` creates a small-world undirected graph with 'N' nodes using the
+Watts-Strogatz small-world network model. The nodes are initially
+placed around a circle and each node is connected to its 'm' closest
+neighbours on either side. Then, each edge is rewired (independently)
+with probability 'p'. The program prints on output the edge-list of
+the resulting graph.
+
+## PARAMETERS
+
+* <N>:
+ Number of nodes in the final graph.
+
+* <m>:
+ Number of neighbours on the circle graph to which a node is
+ connected on either side (i.e., each node will initially have
+ '2m' edges).
+
+* _p_:
+ Edge rewiring probability.
+
+* SHOW:
+ If the fourth (optional) parameter is equal to `SHOW`, the program
+ will print on STDERR the number of edges rewired while constructing
+ the graph.
+
+## EXAMPLES
+
+The command:
+
+ $ ws 100 3 0.1
+ 0 95
+ 0 2
+ 0 3
+ 1 2
+ 1 24
+ 1 4
+ 2 3
+ ....
+ 99 0
+ 99 56
+ 99 2
+ $
+
+creates a Watts-Strogatz small-world network with 'N=100' nodes and
+'K=m*N=300' edges, where each edge is independently rewired with
+probability 'p=0.1'. The output of `ws` is the edge-list of the
+resulting graph. Notice that in this case the first edge od node `0`
+has been rewired and connected to node `95`. In order to be useful,
+such edge-list should be saved into a file. The following command:
+
+ $ ws 100 300 0.1 SHOW > ws_100_3_0.1.net
+ Rewired edges: 32
+ $
+
+will save the resulting graph in the file `ws_100_3_0.1.net`. Notice
+the usage of the symbol "\>" to redirect the output of the program to
+a file. The line printed on output reports the number of rewired
+edges, since `SHOW` was specified as a fourth parameter.
+
+## SEE ALSO
+
+er\_A(1), er\_B(1)
+
+## REFERENCES
+
+* D\. J. Watts and S. H. Strogatz. "Collective dynamics of
+ 'small-world' networks". Nature 393 (1998), 440–442.
+
+* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
+ Methods and Applications", Chapter 4, Cambridge University Press
+ (2017)
+
+
+## AUTHORS
+
+(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.