summaryrefslogtreecommitdiff
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
First commit on github -- NetBunch 1.0
-rw-r--r--COPYING675
-rw-r--r--INSTALL74
-rw-r--r--Makefile.am2
-rw-r--r--Makefile.in766
-rw-r--r--README51
-rw-r--r--aclocal.m41152
-rwxr-xr-xcompile347
-rw-r--r--config.h.in25
-rwxr-xr-xconfigure4993
-rw-r--r--configure.ac20
-rwxr-xr-xdepcomp791
-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
-rw-r--r--examples/AS-20010316.net_degs10515
-rw-r--r--examples/Makefile.am4
-rw-r--r--examples/Makefile.in476
-rw-r--r--examples/er_1000_2000.net2000
-rw-r--r--examples/er_1000_5000.net5000
-rw-r--r--examples/pl_-3.0_3_500_1000010000
-rwxr-xr-xinstall-sh508
-rwxr-xr-xmissing215
-rw-r--r--src/Makefile.am5
-rw-r--r--src/Makefile.in580
-rw-r--r--src/TODO24
-rw-r--r--src/ba/Makefile.am3
-rw-r--r--src/ba/Makefile.in564
-rw-r--r--src/ba/ba.c185
-rw-r--r--src/bb_fitness/Makefile.am5
-rw-r--r--src/bb_fitness/Makefile.in584
-rw-r--r--src/bb_fitness/bb_fitness.c241
-rw-r--r--src/bbv/Makefile.am4
-rw-r--r--src/bbv/Makefile.in578
-rw-r--r--src/bbv/bbv.c335
-rw-r--r--src/betweenness/Makefile.am7
-rw-r--r--src/betweenness/Makefile.in590
-rw-r--r--src/betweenness/README8
-rw-r--r--src/betweenness/bet_dependency.c224
-rw-r--r--src/betweenness/betweenness.c316
-rw-r--r--src/clust/Makefile.am6
-rw-r--r--src/clust/Makefile.in588
-rw-r--r--src/clust/clust.c162
-rw-r--r--src/clust/clust_w.c161
-rw-r--r--src/cnm/Makefile.am7
-rw-r--r--src/cnm/Makefile.in591
-rw-r--r--src/cnm/bst_pq.c808
-rw-r--r--src/cnm/bst_pq.h159
-rw-r--r--src/cnm/cnm.c480
-rw-r--r--src/cnm/cnm_bst_pq.c155
-rw-r--r--src/cnm/cnm_bst_pq.h105
-rw-r--r--src/common.mk1
-rw-r--r--src/components/Makefile.am10
-rw-r--r--src/components/Makefile.in614
-rw-r--r--src/components/components.c207
-rw-r--r--src/components/largest_component.c191
-rw-r--r--src/components/node_components.c442
-rw-r--r--src/components/strong_conn.c277
-rw-r--r--src/conf/Makefile.am10
-rw-r--r--src/conf/Makefile.in605
-rw-r--r--src/conf/conf_model_deg.c259
-rw-r--r--src/conf/conf_model_deg_nocheck.c182
-rw-r--r--src/deg_seq/Makefile.am6
-rw-r--r--src/deg_seq/Makefile.in588
-rw-r--r--src/deg_seq/deg_seq.c115
-rw-r--r--src/deg_seq/deg_seq_w.c123
-rw-r--r--src/dijkstra/Makefile.am7
-rw-r--r--src/dijkstra/Makefile.in586
-rw-r--r--src/dijkstra/dijkstra.c242
-rw-r--r--src/dijkstra/node_w_funs.c111
-rw-r--r--src/dijkstra/node_w_funs.h66
-rw-r--r--src/dms/Makefile.am4
-rw-r--r--src/dms/Makefile.in582
-rw-r--r--src/dms/dms.c211
-rw-r--r--src/er/Makefile.am9
-rw-r--r--src/er/Makefile.in600
-rw-r--r--src/er/er_A.c152
-rw-r--r--src/er/er_B.c126
-rw-r--r--src/f3m/Makefile.am5
-rw-r--r--src/f3m/Makefile.in578
-rw-r--r--src/f3m/f3m.c657
-rw-r--r--src/fitmle/Makefile.am5
-rw-r--r--src/fitmle/Makefile.in578
-rw-r--r--src/fitmle/fitmle.c479
-rw-r--r--src/gn/Makefile.am5
-rw-r--r--src/gn/Makefile.in578
-rw-r--r--src/gn/gn.c495
-rw-r--r--src/graph_info/Makefile.am4
-rw-r--r--src/graph_info/Makefile.in578
-rw-r--r--src/graph_info/graph_info.c130
-rw-r--r--src/hidden/Makefile.am7
-rw-r--r--src/hidden/Makefile.in585
-rw-r--r--src/hidden/hv_net.c337
-rw-r--r--src/include/cum_distr.h60
-rw-r--r--src/include/dset.h65
-rw-r--r--src/include/gen_heap.h84
-rw-r--r--src/include/gen_pqueue.h108
-rw-r--r--src/include/gen_stack.h54
-rw-r--r--src/include/iltree.h93
-rw-r--r--src/include/iltree_double.h62
-rw-r--r--src/include/utils.h138
-rw-r--r--src/johnson/Makefile.am6
-rw-r--r--src/johnson/Makefile.in582
-rw-r--r--src/johnson/johnson_cycles.c328
-rw-r--r--src/johnson/stack.c96
-rw-r--r--src/johnson/stack.h59
-rw-r--r--src/knn/Makefile.am11
-rw-r--r--src/knn/Makefile.in600
-rw-r--r--src/knn/knn.c349
-rw-r--r--src/knn/knn_w.c355
-rw-r--r--src/knn/knntree.c95
-rw-r--r--src/knn/knntree.h54
-rw-r--r--src/kruskal/Makefile.am6
-rw-r--r--src/kruskal/Makefile.in590
-rw-r--r--src/kruskal/edge_w_funs.c73
-rw-r--r--src/kruskal/edge_w_funs.h54
-rw-r--r--src/kruskal/kruskal.c215
-rw-r--r--src/label_prop/Makefile.am5
-rw-r--r--src/label_prop/Makefile.in578
-rw-r--r--src/label_prop/label_prop.c415
-rw-r--r--src/modularity/Makefile.am5
-rw-r--r--src/modularity/Makefile.in578
-rw-r--r--src/modularity/modularity.c220
-rw-r--r--src/pm/Makefile.am5
-rw-r--r--src/pm/Makefile.in578
-rw-r--r--src/pm/README1
-rw-r--r--src/pm/pm.c231
-rw-r--r--src/power_law/Makefile.am4
-rw-r--r--src/power_law/Makefile.in578
-rw-r--r--src/power_law/power_law.c146
-rw-r--r--src/shortest/Makefile.am6
-rw-r--r--src/shortest/Makefile.in589
-rw-r--r--src/shortest/shortest.c259
-rw-r--r--src/shortest/shortest_avg_max_hist.c223
-rw-r--r--src/utils/cum_distr.c134
-rw-r--r--src/utils/dset.c128
-rw-r--r--src/utils/gen_heap.c302
-rw-r--r--src/utils/gen_pqueue.c359
-rw-r--r--src/utils/gen_stack.c87
-rw-r--r--src/utils/iltree.c291
-rw-r--r--src/utils/iltree_double.c102
-rw-r--r--src/utils/utils.c785
-rw-r--r--src/ws/Makefile.am5
-rw-r--r--src/ws/Makefile.in578
-rw-r--r--src/ws/ws.c204
251 files changed, 82012 insertions, 0 deletions
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..2a99aee
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,675 @@
+### GNU GENERAL PUBLIC LICENSE
+
+Version 3, 29 June 2007
+
+Copyright (C) 2007 Free Software Foundation, Inc.
+<http://fsf.org/>
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+### Preamble
+
+The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom
+to share and change all versions of a program--to make sure it remains
+free software for all its users. We, the Free Software Foundation, use
+the GNU General Public License for most of our software; it applies
+also to any other work released this way by its authors. You can apply
+it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you
+have certain responsibilities if you distribute copies of the
+software, or if you modify it: responsibilities to respect the freedom
+of others.
+
+For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the
+manufacturer can do so. This is fundamentally incompatible with the
+aim of protecting users' freedom to change the software. The
+systematic pattern of such abuse occurs in the area of products for
+individuals to use, which is precisely where it is most unacceptable.
+Therefore, we have designed this version of the GPL to prohibit the
+practice for those products. If such problems arise substantially in
+other domains, we stand ready to extend this provision to those
+domains in future versions of the GPL, as needed to protect the
+freedom of users.
+
+Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish
+to avoid the special danger that patents applied to a free program
+could make it effectively proprietary. To prevent this, the GPL
+assures that patents cannot be used to render the program non-free.
+
+The precise terms and conditions for copying, distribution and
+modification follow.
+
+### TERMS AND CONDITIONS
+
+#### 0. Definitions.
+
+"This License" refers to version 3 of the GNU General Public License.
+
+"Copyright" also means copyright-like laws that apply to other kinds
+of works, such as semiconductor masks.
+
+"The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of
+an exact copy. The resulting work is called a "modified version" of
+the earlier work or a work "based on" the earlier work.
+
+A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user
+through a computer network, with no transfer of a copy, is not
+conveying.
+
+An interactive user interface displays "Appropriate Legal Notices" to
+the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+#### 1. Source Code.
+
+The "source code" for a work means the preferred form of the work for
+making modifications to it. "Object code" means any non-source form of
+a work.
+
+A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can
+regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same
+work.
+
+#### 2. Basic Permissions.
+
+All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+You may make, run and propagate covered works that you do not convey,
+without conditions so long as your license otherwise remains in force.
+You may convey covered works to others for the sole purpose of having
+them make modifications exclusively for you, or provide you with
+facilities for running those works, provided that you comply with the
+terms of this License in conveying all material for which you do not
+control copyright. Those thus making or running the covered works for
+you must do so exclusively on your behalf, under your direction and
+control, on terms that prohibit them from making any copies of your
+copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the
+conditions stated below. Sublicensing is not allowed; section 10 makes
+it unnecessary.
+
+#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such
+circumvention is effected by exercising rights under this License with
+respect to the covered work, and you disclaim any intention to limit
+operation or modification of the work as a means of enforcing, against
+the work's users, your or third parties' legal rights to forbid
+circumvention of technological measures.
+
+#### 4. Conveying Verbatim Copies.
+
+You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+#### 5. Conveying Modified Source Versions.
+
+You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these
+conditions:
+
+- a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+- b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under
+ section 7. This requirement modifies the requirement in section 4
+ to "keep intact all notices".
+- c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+- d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+#### 6. Conveying Non-Source Forms.
+
+You may convey a covered work in object code form under the terms of
+sections 4 and 5, provided that you also convey the machine-readable
+Corresponding Source under the terms of this License, in one of these
+ways:
+
+- a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+- b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the Corresponding
+ Source from a network server at no charge.
+- c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+- d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+- e) Convey the object code using peer-to-peer transmission,
+ provided you inform other peers where the object code and
+ Corresponding Source of the work are being offered to the general
+ public at no charge under subsection 6d.
+
+A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal,
+family, or household purposes, or (2) anything designed or sold for
+incorporation into a dwelling. In determining whether a product is a
+consumer product, doubtful cases shall be resolved in favor of
+coverage. For a particular product received by a particular user,
+"normally used" refers to a typical or common use of that class of
+product, regardless of the status of the particular user or of the way
+in which the particular user actually uses, or expects or is expected
+to use, the product. A product is a consumer product regardless of
+whether the product has substantial commercial, industrial or
+non-consumer uses, unless such uses represent the only significant
+mode of use of the product.
+
+"Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to
+install and execute modified versions of a covered work in that User
+Product from a modified version of its Corresponding Source. The
+information must suffice to ensure that the continued functioning of
+the modified object code is in no case prevented or interfered with
+solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or
+updates for a work that has been modified or installed by the
+recipient, or for the User Product in which it has been modified or
+installed. Access to a network may be denied when the modification
+itself materially and adversely affects the operation of the network
+or violates the rules and protocols for communication across the
+network.
+
+Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+#### 7. Additional Terms.
+
+"Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders
+of that material) supplement the terms of this License with terms:
+
+- a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+- b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+- c) Prohibiting misrepresentation of the origin of that material,
+ or requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+- d) Limiting the use for publicity purposes of names of licensors
+ or authors of the material; or
+- e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+- f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions
+ of it) with contractual assumptions of liability to the recipient,
+ for any liability that these contractual assumptions directly
+ impose on those licensors and authors.
+
+All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions; the
+above requirements apply either way.
+
+#### 8. Termination.
+
+You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+#### 9. Acceptance Not Required for Having Copies.
+
+You are not required to accept this License in order to receive or run
+a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+#### 10. Automatic Licensing of Downstream Recipients.
+
+Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+#### 11. Patents.
+
+A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+A contributor's "essential patent claims" are all patent claims owned
+or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+A patent license is "discriminatory" if it does not include within the
+scope of its coverage, prohibits the exercise of, or is conditioned on
+the non-exercise of one or more of the rights that are specifically
+granted under this License. You may not convey a covered work if you
+are a party to an arrangement with a third party that is in the
+business of distributing software, under which you make payment to the
+third party based on the extent of your activity of conveying the
+work, and under which the third party grants, to any of the parties
+who would receive the covered work from you, a discriminatory patent
+license (a) in connection with copies of the covered work conveyed by
+you (or copies made from those copies), or (b) primarily for and in
+connection with specific products or compilations that contain the
+covered work, unless you entered into that arrangement, or that patent
+license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+#### 12. No Surrender of Others' Freedom.
+
+If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under
+this License and any other pertinent obligations, then as a
+consequence you may not convey it at all. For example, if you agree to
+terms that obligate you to collect a royalty for further conveying
+from those to whom you convey the Program, the only way you could
+satisfy both those terms and this License would be to refrain entirely
+from conveying the Program.
+
+#### 13. Use with the GNU Affero General Public License.
+
+Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+#### 14. Revised Versions of this License.
+
+The Free Software Foundation may publish revised and/or new versions
+of the GNU General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in
+detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies that a certain numbered version of the GNU General Public
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that numbered version or
+of any later version published by the Free Software Foundation. If the
+Program does not specify a version number of the GNU General Public
+License, you may choose any version ever published by the Free
+Software Foundation.
+
+If the Program specifies that a proxy can decide which future versions
+of the GNU General Public License can be used, that proxy's public
+statement of acceptance of a version permanently authorizes you to
+choose that version for the Program.
+
+Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+#### 15. Disclaimer of Warranty.
+
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
+WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
+DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
+CORRECTION.
+
+#### 16. Limitation of Liability.
+
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
+CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
+NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
+LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
+TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
+PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+#### 17. Interpretation of Sections 15 and 16.
+
+If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+END OF TERMS AND CONDITIONS
+
+### How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+
+To do so, attach the following notices to the program. It is safest to
+attach them to the start of each source file to most effectively state
+the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper
+mail.
+
+If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands \`show w' and \`show c' should show the
+appropriate parts of the General Public License. Of course, your
+program's commands might be different; for a GUI interface, you would
+use an "about box".
+
+You should also get your employer (if you work as a programmer) or
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. For more information on this, and how to apply and follow
+the GNU GPL, see <http://www.gnu.org/licenses/>.
+
+The GNU General Public License does not permit incorporating your
+program into proprietary programs. If your program is a subroutine
+library, you may consider it more useful to permit linking proprietary
+applications with the library. If this is what you want to do, use the
+GNU Lesser General Public License instead of this License. But first,
+please read <http://www.gnu.org/philosophy/why-not-lgpl.html>. \ No newline at end of file
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..e14d653
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,74 @@
+===== DOWNLOAD =====
+
+NetBunch can be downloaded from the official website of the book:
+
+ http://www.complex-networks.net
+
+NetBunch binaries are available for Windows (64bit) and Mac OS. Source
+files are available from the same website, and can be used to compile
+NetBunch on Linux and unix-like operating systems (but also on Windows
+and Mac OS, if you like).
+
+If you use a program included in NetBunch, please add a citation to
+the textbook:
+
+ "Complex Networks: Principles, Methods and Application"
+ V. Latora, V. Nicosia, G. Russo, Cambridge University
+ Press (2017), ISBN: 9781107103184
+
+and to the relevant References indicated in the corresponding source
+files.
+
+
+===== INSTALLATION =====
+
+
+=== Binaries (Windows / Mac OS) ===
+
+To use the binary packages for Windows and/or Mac OS, just download
+the correct version from http://www.complex-networks.net and unzip the
+archive in a directory of your system. The zip file includes:
+
+- all the binaries (in the folder 'bin')
+- the documentation in HTML and man format (in the folder 'netbunch-doc')
+- additional files referred in the manpages (in the folder 'netbunch-examples')
+
+All the programs can be used from the command line, i.e., 'cmd',
+'command', 'PowerShell' (under Windows), or from iTerm or other
+virtual terminal emulators (under Mac OS).
+
+If you unpack the zip archive in NETBUNCH_FOLDER, you might want to add
+NETBUNCH_FOLDER/bin to your PATH.
+
+
+=== Installing from sources (Linux / unix / Windows / Mac OS) ===
+
+All the programs in NetBunch are written in ANSI C99, and require only
+an ANSI C99 compiler (i.e., there is no additional dependency).
+NetBunch has been compiled and tested with 'gcc', 'clang' (LLVM),
+'tcc' (tiny C compiler) under Linux, with 'gcc' and 'clang' under Mac
+OS, and with MSYS2 (64-bit compiler based on gcc, see
+http://www.msys2.org/) under Windows.
+
+Due to the absence of dependencies, it should be possible to compile
+NetBunch with any generic ANSI C99 compiler.
+
+To install NetBunch from sources:
+
+- Download the source package from http://www.complex-networks.net
+
+- unpack the tar.gz (or zip) archive in a folder
+
+- change to that folder and use the standard:
+
+ $ ./configure
+ $ make
+ $ make install
+
+
+N.B.: The documentation of all the programs in NetBunch is written in
+Markdown. The build system uses 'ronn' (a ruby utility for document
+generation) to convert the markdown files into manpages and HTML
+files. Compiled manpages and html files are distributed along with the
+source files, but if you want to rebuild the manpages you must have
+'ronn' (and all its dependencies) installed.
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..55fe312
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,2 @@
+include src/common.mk
+SUBDIRS= src doc examples
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..0a4647c
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,766 @@
+# 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 = .
+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 $(top_srcdir)/configure \
+ $(am__configure_deps) $(am__DIST_COMMON)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = 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 =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ cscope distdir dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(srcdir)/src/common.mk COPYING INSTALL README compile depcomp \
+ install-sh missing
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+SUBDIRS = src doc examples
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/src/common.mk $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+$(srcdir)/src/common.mk $(am__empty):
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @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
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__post_remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__post_remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__post_remove_distdir)
+
+dist-shar: distdir
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__post_remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__post_remove_distdir)
+
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ --srcdir=../.. --prefix="$$dc_install_base" \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__post_remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile config.h
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+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-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) all install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--refresh check check-am clean clean-cscope clean-generic \
+ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
+ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
+ distcheck distclean distclean-generic distclean-hdr \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# 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/README b/README
new file mode 100644
index 0000000..60c282a
--- /dev/null
+++ b/README
@@ -0,0 +1,51 @@
+===== NetBunch-1.0 =====
+
+This is NetBunch, the collection of software for network analysis
+accompanying the book:
+
+ "Complex Networks: Principles, Methods and Application"
+ V. Latora, V. Nicosia, G. Russo, Cambridge University
+ Press (2017), ISBN: 9781107103184
+ http://www.cambridge.org/gb/academic/subjects/physics/statistical-physics/complex-networks-principles-methods-and-applications?format=HB
+
+NetBunch includes all the programs implementing the algorithms
+described in the Appendices of the book, and several more. If you use
+a program included in NetBunch, please add a citation to the textbook
+above and to the relevant References indicated in the corresponding
+source files.
+
+See 'INSTALL' for information about downloading and installing
+NetBunch.
+
+NetBunch is written and maintained by Vincenzo 'KatolaZ' Nicosia
+(v.nicosia@qmul.ac.uk) (c) 2009-2017.
+
+The programs included in NetBunch can be used, modified, and redistributed
+under the terms of the GNU General Public License, either version 3 of the
+License or, at your option, any later version.
+
+NetBunch is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+See the file 'COPYING' for additional details.
+
+
+===== DOCUMENTATION =====
+
+The documentation of all the programs included in NetBunch is
+available at the URL:
+
+ http://www.complex-networks.net
+
+Moreover, all the manpages are available in HTML format in the folder
+'netbunch-doc' of the binary distributions.
+
+If you compile NetBunch from sources, the HTML files will be put under
+$(prefix)/netbunch-doc (default to /usr/local/netbunch-doc), while the
+manpages will be installed under $(prefix)/share/man/man1 (default to
+/usr/local/share/man/man1).
+
+All the documentation in NetBunch can be used and distributed
+according to the terms the GNU Free Documentation License, version 1.3. \ No newline at end of file
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..f3018f6
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,1152 @@
+# generated automatically by aclocal 1.15 -*- Autoconf -*-
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+
+# This file 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.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.15'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.15], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.15])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each '.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+#
+# This file 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 macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.65])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
+])
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+ alias in your environment])
+ fi
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+ [--enable-silent-rules],
+ [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+ [--disable-silent-rules],
+ [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+ [am_cv_make_support_nested_variables],
+ [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor 'install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in "make install-strip", and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+#
+# This file 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.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+#
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
+
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
+ rm -rf conftest.dir
+
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
diff --git a/compile b/compile
new file mode 100755
index 0000000..a85b723
--- /dev/null
+++ b/compile
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" "" $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+ file=$1
+ case $file in
+ / | /[!/]*) # absolute file, and not a UNC file
+ if test -z "$file_conv"; then
+ # lazily determine how to convert abs files
+ case `uname -s` in
+ MINGW*)
+ file_conv=mingw
+ ;;
+ CYGWIN*)
+ file_conv=cygwin
+ ;;
+ *)
+ file_conv=wine
+ ;;
+ esac
+ fi
+ case $file_conv/,$2, in
+ *,$file_conv,*)
+ ;;
+ mingw/*)
+ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+ ;;
+ cygwin/*)
+ file=`cygpath -m "$file" || echo "$file"`
+ ;;
+ wine/*)
+ file=`winepath -w "$file" || echo "$file"`
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+ func_file_conv "$1"
+ if test -z "$lib_path"; then
+ lib_path=$file
+ else
+ lib_path="$lib_path;$file"
+ fi
+ linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+ lib=$1
+ found=no
+ save_IFS=$IFS
+ IFS=';'
+ for dir in $lib_path $LIB
+ do
+ IFS=$save_IFS
+ if $shared && test -f "$dir/$lib.dll.lib"; then
+ found=yes
+ lib=$dir/$lib.dll.lib
+ break
+ fi
+ if test -f "$dir/$lib.lib"; then
+ found=yes
+ lib=$dir/$lib.lib
+ break
+ fi
+ if test -f "$dir/lib$lib.a"; then
+ found=yes
+ lib=$dir/lib$lib.a
+ break
+ fi
+ done
+ IFS=$save_IFS
+
+ if test "$found" != yes; then
+ lib=$lib.lib
+ fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+ # Assume a capable shell
+ lib_path=
+ shared=:
+ linker_opts=
+ for arg
+ do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ eat=1
+ case $2 in
+ *.o | *.[oO][bB][jJ])
+ func_file_conv "$2"
+ set x "$@" -Fo"$file"
+ shift
+ ;;
+ *)
+ func_file_conv "$2"
+ set x "$@" -Fe"$file"
+ shift
+ ;;
+ esac
+ ;;
+ -I)
+ eat=1
+ func_file_conv "$2" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -I*)
+ func_file_conv "${1#-I}" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -l)
+ eat=1
+ func_cl_dashl "$2"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -l*)
+ func_cl_dashl "${1#-l}"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -L)
+ eat=1
+ func_cl_dashL "$2"
+ ;;
+ -L*)
+ func_cl_dashL "${1#-L}"
+ ;;
+ -static)
+ shared=false
+ ;;
+ -Wl,*)
+ arg=${1#-Wl,}
+ save_ifs="$IFS"; IFS=','
+ for flag in $arg; do
+ IFS="$save_ifs"
+ linker_opts="$linker_opts $flag"
+ done
+ IFS="$save_ifs"
+ ;;
+ -Xlinker)
+ eat=1
+ linker_opts="$linker_opts $2"
+ ;;
+ -*)
+ set x "$@" "$1"
+ shift
+ ;;
+ *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+ func_file_conv "$1"
+ set x "$@" -Tp"$file"
+ shift
+ ;;
+ *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+ func_file_conv "$1" mingw
+ set x "$@" "$file"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+ done
+ if test -n "$linker_opts"; then
+ linker_opts="-link$linker_opts"
+ fi
+ exec "$@" $linker_opts
+ exit 1
+}
+
+eat=
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+ func_cl_wrapper "$@" # Doesn't return...
+ ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ # So we strip '-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no '-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # '.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..dd3b02c
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,25 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Version number of package */
+#undef VERSION
diff --git a/configure b/configure
new file mode 100755
index 0000000..58d2b4b
--- /dev/null
+++ b/configure
@@ -0,0 +1,4993 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for netbunch 1.0.
+#
+# Report bugs to <v.nicosia@qmul.ac.uk>.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: v.nicosia@qmul.ac.uk about your system, including any
+$0: error possibly output before this message. Then install
+$0: a modern shell, or manually run the script under such a
+$0: shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='netbunch'
+PACKAGE_TARNAME='netbunch'
+PACKAGE_VERSION='1.0'
+PACKAGE_STRING='netbunch 1.0'
+PACKAGE_BUGREPORT='v.nicosia@qmul.ac.uk'
+PACKAGE_URL=''
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+HAVE_RONN_FALSE
+HAVE_RONN_TRUE
+RONN
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+runstatedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_dependency_tracking
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir runstatedir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures netbunch 1.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/netbunch]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of netbunch 1.0:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-silent-rules less verbose build output (undo: "make V=1")
+ --disable-silent-rules verbose build output (undo: "make V=0")
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <v.nicosia@qmul.ac.uk>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+netbunch configure 1.0
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by netbunch $as_me 1.0, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+am__api_version='1.15'
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='netbunch'
+ VERSION='1.0'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+ fi
+fi
+
+: ${CFLAGS=""}
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+ac_config_files="$ac_config_files Makefile src/Makefile src/ba/Makefile src/er/Makefile src/graph_info/Makefile src/dms/Makefile src/bb_fitness/Makefile src/bbv/Makefile src/conf/Makefile src/deg_seq/Makefile src/power_law/Makefile src/shortest/Makefile src/components/Makefile src/kruskal/Makefile src/clust/Makefile src/fitmle/Makefile src/dijkstra/Makefile src/f3m/Makefile src/betweenness/Makefile src/label_prop/Makefile src/cnm/Makefile src/johnson/Makefile src/gn/Makefile src/modularity/Makefile src/pm/Makefile src/knn/Makefile src/hidden/Makefile src/ws/Makefile doc/Makefile examples/Makefile"
+
+for ac_prog in ronn
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RONN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RONN"; then
+ ac_cv_prog_RONN="$RONN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RONN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RONN=$ac_cv_prog_RONN
+if test -n "$RONN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RONN" >&5
+$as_echo "$RONN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$RONN" && break
+done
+
+if test -z "$RONN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ronn not found -- continuing without document rebuild support" >&5
+$as_echo "$as_me: WARNING: ronn not found -- continuing without document rebuild support" >&2;}
+fi
+ if test -n "$RONN"; then
+ HAVE_RONN_TRUE=
+ HAVE_RONN_FALSE='#'
+else
+ HAVE_RONN_TRUE='#'
+ HAVE_RONN_FALSE=
+fi
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_RONN_TRUE}" && test -z "${HAVE_RONN_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_RONN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by netbunch $as_me 1.0, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <v.nicosia@qmul.ac.uk>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+netbunch config.status 1.0
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "src/ba/Makefile") CONFIG_FILES="$CONFIG_FILES src/ba/Makefile" ;;
+ "src/er/Makefile") CONFIG_FILES="$CONFIG_FILES src/er/Makefile" ;;
+ "src/graph_info/Makefile") CONFIG_FILES="$CONFIG_FILES src/graph_info/Makefile" ;;
+ "src/dms/Makefile") CONFIG_FILES="$CONFIG_FILES src/dms/Makefile" ;;
+ "src/bb_fitness/Makefile") CONFIG_FILES="$CONFIG_FILES src/bb_fitness/Makefile" ;;
+ "src/bbv/Makefile") CONFIG_FILES="$CONFIG_FILES src/bbv/Makefile" ;;
+ "src/conf/Makefile") CONFIG_FILES="$CONFIG_FILES src/conf/Makefile" ;;
+ "src/deg_seq/Makefile") CONFIG_FILES="$CONFIG_FILES src/deg_seq/Makefile" ;;
+ "src/power_law/Makefile") CONFIG_FILES="$CONFIG_FILES src/power_law/Makefile" ;;
+ "src/shortest/Makefile") CONFIG_FILES="$CONFIG_FILES src/shortest/Makefile" ;;
+ "src/components/Makefile") CONFIG_FILES="$CONFIG_FILES src/components/Makefile" ;;
+ "src/kruskal/Makefile") CONFIG_FILES="$CONFIG_FILES src/kruskal/Makefile" ;;
+ "src/clust/Makefile") CONFIG_FILES="$CONFIG_FILES src/clust/Makefile" ;;
+ "src/fitmle/Makefile") CONFIG_FILES="$CONFIG_FILES src/fitmle/Makefile" ;;
+ "src/dijkstra/Makefile") CONFIG_FILES="$CONFIG_FILES src/dijkstra/Makefile" ;;
+ "src/f3m/Makefile") CONFIG_FILES="$CONFIG_FILES src/f3m/Makefile" ;;
+ "src/betweenness/Makefile") CONFIG_FILES="$CONFIG_FILES src/betweenness/Makefile" ;;
+ "src/label_prop/Makefile") CONFIG_FILES="$CONFIG_FILES src/label_prop/Makefile" ;;
+ "src/cnm/Makefile") CONFIG_FILES="$CONFIG_FILES src/cnm/Makefile" ;;
+ "src/johnson/Makefile") CONFIG_FILES="$CONFIG_FILES src/johnson/Makefile" ;;
+ "src/gn/Makefile") CONFIG_FILES="$CONFIG_FILES src/gn/Makefile" ;;
+ "src/modularity/Makefile") CONFIG_FILES="$CONFIG_FILES src/modularity/Makefile" ;;
+ "src/pm/Makefile") CONFIG_FILES="$CONFIG_FILES src/pm/Makefile" ;;
+ "src/knn/Makefile") CONFIG_FILES="$CONFIG_FILES src/knn/Makefile" ;;
+ "src/hidden/Makefile") CONFIG_FILES="$CONFIG_FILES src/hidden/Makefile" ;;
+ "src/ws/Makefile") CONFIG_FILES="$CONFIG_FILES src/ws/Makefile" ;;
+ "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+ "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..e61262b
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,20 @@
+AC_INIT([netbunch], [1.0], [v.nicosia@qmul.ac.uk])
+AM_INIT_AUTOMAKE([foreign -Wall -Werror subdir-objects])
+: ${CFLAGS=""}
+AC_PROG_CC
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES([Makefile src/Makefile src/ba/Makefile src/er/Makefile src/graph_info/Makefile \
+ src/dms/Makefile src/bb_fitness/Makefile src/bbv/Makefile src/conf/Makefile \
+ src/deg_seq/Makefile src/power_law/Makefile src/shortest/Makefile\
+ src/components/Makefile src/kruskal/Makefile src/clust/Makefile \
+ src/fitmle/Makefile src/dijkstra/Makefile src/f3m/Makefile \
+ src/betweenness/Makefile src/label_prop/Makefile src/cnm/Makefile \
+ src/johnson/Makefile src/gn/Makefile src/modularity/Makefile \
+ src/pm/Makefile src/knn/Makefile src/hidden/Makefile \
+ src/ws/Makefile doc/Makefile examples/Makefile])
+AC_CHECK_PROGS([RONN], [ronn])
+if test -z "$RONN"; then
+ AC_MSG_WARN([ronn not found -- continuing without document rebuild support])
+fi
+AM_CONDITIONAL([HAVE_RONN], [test -n "$RONN"])
+AC_OUTPUT
diff --git a/depcomp b/depcomp
new file mode 100755
index 0000000..fc98710
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,791 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2013-05-30.07; # UTC
+
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by 'PROGRAMS ARGS'.
+ object Object file output by 'PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputting dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'. Note that this directory component will
+# be either empty or ending with a '/' character. This is deliberate.
+set_dir_from ()
+{
+ case $1 in
+ */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+ *) dir=;;
+ esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+ base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+ echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+ # If the compiler actually managed to produce a dependency file,
+ # post-process it.
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form 'foo.o: dependency.h'.
+ # Do two passes, one to just change these to
+ # $object: dependency.h
+ # and one to simply output
+ # dependency.h:
+ # which is needed to avoid the deleted-header problem.
+ { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+ sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+ } > "$depfile"
+ rm -f "$tmpdepfile"
+ else
+ make_dummy_depfile
+ fi
+}
+
+# A tabulation character.
+tab=' '
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+ # This is just like msvc7 but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+ # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+ gccflag=-qmakedep=gcc,-MF
+ depmode=gcc
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say). Also, it might not be
+## supported by the other compilers which use the 'gcc' depmode.
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The second -e expression handles DOS-style file names with drive
+ # letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the "deleted header file" problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+## Some versions of gcc put a space before the ':'. On the theory
+## that the space means something, we add a space to the output as
+## well. hp depmode also adds that space, but also prefixes the VPATH
+## to the object. Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like '#:fec' to the end of the
+ # dependency line.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+ | tr "$nl" ' ' >> "$depfile"
+ echo >> "$depfile"
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+xlc)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts '$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ set_dir_from "$object"
+ set_base_from "$object"
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ aix_post_process_depfile
+ ;;
+
+tcc)
+ # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+ # FIXME: That version still under development at the moment of writing.
+ # Make that this statement remains true also for stable, released
+ # versions.
+ # It will wrap lines (doesn't matter whether long or short) with a
+ # trailing '\', as in:
+ #
+ # foo.o : \
+ # foo.c \
+ # foo.h \
+ #
+ # It will put a trailing '\' even on the last line, and will use leading
+ # spaces rather than leading tabs (at least since its commit 0394caf7
+ # "Emit spaces for -MD").
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+ # We have to change lines of the first kind to '$object: \'.
+ sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+ # And for each line of the second kind, we have to emit a 'dep.h:'
+ # dummy dependency, to avoid the deleted-header problem.
+ sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file. A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+ # Portland's C compiler understands '-MD'.
+ # Will always output deps to 'file.d' where file is the root name of the
+ # source file under compilation, even if file resides in a subdirectory.
+ # The object file name does not affect the name of the '.d' file.
+ # pgcc 10.2 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using '\' :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+ set_dir_from "$object"
+ # Use the source, not the object, to determine the base name, since
+ # that's sadly what pgcc will do too.
+ set_base_from "$source"
+ tmpdepfile=$base.d
+
+ # For projects that build the same source file twice into different object
+ # files, the pgcc approach of using the *source* file root name can cause
+ # problems in parallel builds. Use a locking strategy to avoid stomping on
+ # the same $tmpdepfile.
+ lockdir=$base.d-lock
+ trap "
+ echo '$0: caught signal, cleaning up...' >&2
+ rmdir '$lockdir'
+ exit 1
+ " 1 2 13 15
+ numtries=100
+ i=$numtries
+ while test $i -gt 0; do
+ # mkdir is a portable test-and-set.
+ if mkdir "$lockdir" 2>/dev/null; then
+ # This process acquired the lock.
+ "$@" -MD
+ stat=$?
+ # Release the lock.
+ rmdir "$lockdir"
+ break
+ else
+ # If the lock is being held by a different process, wait
+ # until the winning process is done or we timeout.
+ while test -d "$lockdir" && test $i -gt 0; do
+ sleep 1
+ i=`expr $i - 1`
+ done
+ fi
+ i=`expr $i - 1`
+ done
+ trap - 1 2 13 15
+ if test $i -le 0; then
+ echo "$0: failed to acquire lock after $numtries attempts" >&2
+ echo "$0: check lockdir '$lockdir'" >&2
+ exit 1
+ fi
+
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ set_dir_from "$object"
+ set_base_from "$object"
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add 'dependent.h:' lines.
+ sed -ne '2,${
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in 'foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ set_dir_from "$object"
+ set_base_from "$object"
+
+ if test "$libtool" = yes; then
+ # Libtool generates 2 separate objects for the 2 libraries. These
+ # two compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir$base.o.d # libtool 1.5
+ tmpdepfile2=$dir.libs/$base.o.d # Likewise.
+ tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ # Same post-processing that is required for AIX mode.
+ aix_post_process_depfile
+ ;;
+
+msvc7)
+ if test "$libtool" = yes; then
+ showIncludes=-Wc,-showIncludes
+ else
+ showIncludes=-showIncludes
+ fi
+ "$@" $showIncludes > "$tmpdepfile"
+ stat=$?
+ grep -v '^Note: including file: ' "$tmpdepfile"
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The first sed program below extracts the file names and escapes
+ # backslashes for cygpath. The second sed program outputs the file
+ # name when reading, but also accumulates all include files in the
+ # hold buffer in order to output them again at the end. This only
+ # works with sed implementations that can handle large buffers.
+ sed < "$tmpdepfile" -n '
+/^Note: including file: *\(.*\)/ {
+ s//\1/
+ s/\\/\\\\/g
+ p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+ s/.*/'"$tab"'/
+ G
+ p
+}' >> "$depfile"
+ echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+ rm -f "$tmpdepfile"
+ ;;
+
+msvc7msys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for ':'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
+ "$@" $dashmflag |
+ sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this sed invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no eat=no
+ for arg
+ do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ if test $eat = yes; then
+ eat=no
+ continue
+ fi
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -arch)
+ eat=yes ;;
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ # makedepend may prepend the VPATH from the source file name to the object.
+ # No need to regex-escape $object, excess matching of '.' is harmless.
+ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process the last invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed '1,2d' "$tmpdepfile" \
+ | tr ' ' "$nl" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E \
+ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ | sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E 2>/dev/null |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+ echo "$tab" >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvcmsys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
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>`.
diff --git a/examples/AS-20010316.net_degs b/examples/AS-20010316.net_degs
new file mode 100644
index 0000000..aa1e5a0
--- /dev/null
+++ b/examples/AS-20010316.net_degs
@@ -0,0 +1,10515 @@
+557
+2277
+64
+8
+17
+27
+75
+40
+245
+322
+315
+110
+1231
+436
+899
+399
+317
+64
+152
+72
+138
+118
+859
+128
+55
+117
+265
+567
+7
+5
+20
+71
+67
+3
+8
+174
+2
+19
+2
+2
+67
+22
+7
+1
+2
+2
+2
+50
+62
+7
+78
+21
+76
+91
+5
+23
+50
+41
+49
+5
+7
+6
+23
+4
+2
+33
+18
+8
+17
+5
+18
+10
+163
+3
+32
+72
+3
+14
+13
+75
+65
+29
+33
+14
+48
+38
+55
+28
+15
+39
+99
+35
+26
+2
+23
+10
+28
+16
+72
+13
+30
+15
+41
+12
+18
+14
+2
+4
+2
+30
+2
+2
+127
+2
+3
+2
+2
+14
+3
+9
+2
+5
+2
+5
+18
+3
+8
+10
+3
+3
+2
+10
+28
+2
+2
+2
+2
+2
+3
+2
+8
+2
+2
+2
+2
+3
+5
+2
+2
+2
+16
+4
+1
+7
+2
+1
+10
+3
+4
+1
+12
+37
+4
+5
+19
+2
+8
+18
+9
+9
+18
+6
+13
+14
+1
+11
+24
+6
+9
+19
+6
+2
+3
+6
+7
+2
+4
+2
+2
+12
+3
+2
+6
+3
+3
+11
+4
+6
+32
+3
+1
+1
+4
+4
+4
+6
+4
+3
+5
+9
+14
+3
+1
+9
+4
+8
+16
+5
+2
+3
+1
+3
+3
+2
+2
+2
+5
+1
+5
+5
+1
+19
+7
+1
+3
+32
+6
+2
+5
+1
+7
+3
+4
+5
+7
+3
+8
+2
+1
+1
+3
+3
+9
+2
+6
+4
+3
+1
+20
+2
+2
+3
+4
+13
+1
+3
+2
+2
+3
+3
+2
+11
+3
+10
+4
+2
+1
+2
+1
+2
+1
+3
+2
+2
+2
+2
+2
+9
+2
+5
+4
+3
+4
+2
+3
+2
+5
+10
+3
+2
+2
+6
+2
+1
+1
+3
+3
+2
+1
+4
+5
+2
+18
+12
+2
+2
+4
+2
+3
+3
+2
+2
+2
+2
+2
+2
+1
+2
+4
+3
+3
+2
+2
+3
+1
+3
+10
+2
+1
+4
+24
+6
+2
+2
+1
+3
+1
+1
+2
+2
+2
+1
+1
+6
+2
+2
+2
+5
+3
+9
+1
+12
+32
+5
+2
+2
+1
+2
+3
+2
+2
+2
+3
+2
+2
+1
+1
+2
+3
+2
+2
+2
+2
+2
+2
+2
+2
+2
+3
+1
+5
+4
+7
+2
+2
+1
+15
+9
+15
+3
+2
+2
+2
+2
+7
+2
+9
+1
+2
+2
+2
+3
+1
+2
+2
+5
+3
+2
+1
+2
+2
+2
+6
+1
+2
+2
+1
+2
+2
+6
+2
+2
+2
+2
+4
+1
+2
+2
+3
+2
+2
+2
+2
+10
+1
+3
+3
+3
+5
+5
+1
+2
+2
+2
+2
+2
+3
+2
+3
+1
+5
+4
+1
+2
+2
+4
+2
+2
+2
+2
+2
+3
+3
+1
+4
+4
+3
+1
+4
+2
+3
+3
+4
+2
+1
+2
+3
+2
+40
+2
+2
+2
+5
+2
+3
+2
+2
+3
+2
+2
+2
+1
+2
+2
+2
+2
+2
+4
+2
+1
+4
+6
+2
+2
+2
+2
+2
+2
+3
+6
+2
+2
+3
+2
+3
+2
+2
+3
+2
+2
+5
+2
+6
+1
+1
+1
+2
+4
+2
+2
+3
+2
+2
+2
+3
+11
+2
+2
+1
+2
+2
+7
+3
+1
+2
+1
+2
+3
+1
+9
+12
+45
+1
+18
+4
+60
+1
+9
+2
+8
+1
+13
+3
+43
+9
+2
+13
+3
+1
+2
+96
+2
+13
+4
+4
+1
+4
+2
+4
+18
+1
+15
+3
+2
+14
+1
+2
+58
+2
+18
+2
+2
+2
+10
+3
+1
+5
+1
+2
+1
+2
+1
+2
+1
+2
+1
+1
+5
+8
+1
+1
+2
+1
+6
+5
+1
+111
+4
+34
+90
+55
+5
+1
+19
+3
+2
+4
+2
+3
+1
+8
+5
+2
+2
+2
+1
+2
+2
+3
+3
+88
+1
+52
+1
+1
+5
+1
+2
+4
+2
+1
+5
+1
+2
+1
+2
+2
+2
+1
+1
+1
+27
+4
+8
+4
+306
+2
+1
+2
+3
+3
+1
+2
+2
+5
+19
+25
+1
+1
+1
+5
+2
+4
+2
+2
+2
+6
+1
+2
+1
+5
+3
+2
+3
+8
+3
+2
+2
+2
+8
+3
+1
+1
+9
+14
+13
+36
+16
+18
+16
+21
+2
+5
+2
+2
+1
+4
+109
+2
+3
+111
+2
+2
+2
+7
+5
+24
+22
+1
+1
+1
+3
+3
+2
+2
+2
+2
+2
+2
+2
+1
+2
+7
+1
+2
+2
+2
+83
+1
+1
+41
+6
+2
+2
+9
+3
+5
+4
+1
+2
+2
+17
+1
+2
+4
+2
+2
+2
+2
+2
+2
+2
+2
+1
+1
+1
+2
+2
+2
+3
+1
+3
+2
+2
+1
+1
+2
+2
+1
+1
+2
+2
+2
+2
+3
+1
+2
+3
+3
+1
+1
+2
+5
+4
+2
+2
+4
+71
+1
+2
+2
+2
+1
+2
+2
+2
+2
+2
+2
+2
+2
+1
+13
+3
+2
+2
+2
+2
+3
+3
+2
+1
+2
+2
+3
+1
+1
+4
+54
+2
+2
+30
+2
+2
+2
+2
+2
+2
+1
+1
+2
+1
+2
+2
+3
+2
+3
+1
+11
+2
+6
+2
+1
+1
+2
+1
+1
+1
+2
+4
+2
+2
+5
+4
+3
+2
+1
+2
+2
+2
+2
+89
+3
+76
+1
+1
+5
+2
+2
+2
+5
+2
+5
+2
+11
+1
+3
+8
+11
+2
+1
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+3
+11
+12
+2
+4
+1
+2
+13
+16
+5
+142
+10
+3
+5
+2
+5
+2
+4
+3
+6
+4
+2
+1
+12
+4
+5
+2
+2
+2
+2
+3
+4
+3
+3
+2
+2
+2
+2
+6
+1
+6
+2
+1
+9
+2
+2
+1
+2
+2
+2
+2
+2
+4
+2
+2
+2
+2
+3
+2
+2
+2
+2
+2
+2
+2
+3
+2
+2
+2
+2
+2
+2
+2
+3
+2
+1
+2
+3
+2
+1
+1
+2
+2
+1
+1
+2
+2
+2
+2
+2
+3
+1
+2
+2
+2
+3
+2
+2
+2
+2
+2
+2
+1
+1
+2
+2
+2
+2
+2
+3
+2
+2
+1
+2
+2
+2
+2
+1
+2
+2
+2
+1
+2
+1
+3
+2
+2
+1
+3
+1
+2
+2
+2
+2
+2
+2
+3
+2
+2
+1
+9
+15
+1
+3
+2
+2
+2
+2
+2
+2
+3
+2
+1
+3
+2
+2
+2
+2
+1
+1
+3
+3
+2
+1
+4
+2
+3
+2
+2
+1
+2
+2
+5
+2
+1
+2
+3
+2
+2
+2
+3
+3
+1
+3
+2
+2
+3
+4
+2
+3
+2
+1
+4
+2
+3
+3
+3
+2
+2
+4
+3
+2
+2
+2
+4
+3
+3
+7
+5
+6
+2
+6
+9
+19
+5
+3
+2
+1
+3
+1
+1
+3
+2
+5
+2
+2
+2
+2
+19
+1
+8
+5
+4
+5
+5
+2
+1
+1
+13
+3
+2
+5
+2
+2
+5
+1
+4
+2
+1
+1
+7
+2
+2
+2
+3
+1
+2
+1
+1
+2
+6
+3
+2
+2
+4
+1
+1
+2
+2
+2
+2
+4
+3
+15
+2
+2
+4
+2
+4
+2
+3
+16
+2
+2
+5
+2
+2
+2
+3
+4
+2
+3
+2
+3
+3
+3
+2
+2
+3
+2
+3
+3
+1
+2
+2
+2
+22
+2
+5
+2
+2
+1
+1
+2
+3
+149
+2
+3
+2
+2
+2
+4
+2
+2
+3
+3
+2
+3
+2
+2
+1
+5
+2
+2
+3
+3
+2
+2
+3
+1
+2
+5
+2
+2
+3
+4
+2
+1
+2
+2
+4
+3
+2
+1
+1
+2
+2
+4
+5
+3
+2
+2
+2
+3
+2
+2
+2
+2
+1
+1
+2
+2
+2
+2
+2
+2
+2
+1
+1
+1
+1
+4
+4
+2
+2
+3
+2
+2
+3
+1
+2
+1
+2
+2
+2
+2
+2
+3
+3
+2
+2
+3
+4
+1
+2
+1
+2
+2
+3
+2
+3
+2
+2
+5
+3
+2
+2
+3
+2
+6
+1
+2
+2
+3
+2
+2
+1
+1
+3
+2
+3
+3
+4
+1
+3
+18
+12
+2
+3
+16
+40
+1
+5
+1
+2
+1
+2
+3
+1
+31
+1
+3
+2
+2
+2
+1
+11
+1
+1
+1
+1
+1
+2
+1
+1
+2
+2
+5
+39
+2
+26
+1
+10
+43
+40
+11
+1
+1
+2
+2
+2
+6
+2
+74
+105
+240
+37
+153
+8
+32
+76
+3
+28
+18
+21
+6
+3
+7
+10
+4
+24
+1
+3
+12
+10
+45
+18
+14
+15
+27
+16
+4
+8
+2
+1
+3
+13
+3
+104
+8
+14
+1
+2
+4
+3
+6
+14
+5
+2
+3
+6
+1
+6
+6
+77
+2
+2
+4
+10
+2
+42
+75
+3
+3
+2
+2
+2
+2
+2
+3
+2
+1
+15
+1
+1
+37
+8
+16
+26
+41
+6
+13
+16
+1
+38
+2
+2
+6
+1
+2
+3
+3
+5
+9
+39
+4
+5
+2
+16
+22
+1
+2
+1
+2
+13
+21
+14
+1
+5
+6
+14
+2
+19
+1
+1
+2
+1
+1
+1
+1
+2
+3
+1
+1
+1
+5
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+21
+2
+2
+2
+13
+2
+4
+6
+1
+2
+1
+2
+3
+4
+4
+3
+2
+1
+2
+3
+16
+21
+2
+2
+2
+3
+2
+3
+2
+2
+5
+1
+2
+2
+2
+9
+13
+1
+1
+1
+2
+1
+1
+2
+1
+3
+2
+6
+2
+3
+1
+1
+1
+3
+2
+1
+15
+3
+8
+5
+9
+4
+3
+3
+4
+2
+2
+3
+4
+2
+2
+3
+1
+3
+5
+1
+2
+1
+1
+2
+2
+2
+1
+2
+3
+2
+1
+2
+2
+2
+2
+2
+2
+2
+2
+1
+2
+1
+2
+2
+2
+5
+1
+1
+1
+2
+3
+1
+2
+1
+2
+1
+1
+3
+2
+7
+2
+2
+17
+12
+7
+2
+2
+3
+2
+1
+1
+3
+5
+3
+17
+2
+4
+4
+2
+2
+2
+2
+2
+4
+2
+3
+4
+2
+2
+2
+1
+3
+2
+2
+3
+1
+2
+2
+272
+2
+2
+3
+5
+2
+2
+5
+1
+2
+4
+4
+8
+1
+3
+3
+1
+1
+2
+2
+2
+2
+8
+3
+2
+1
+1
+1
+3
+1
+1
+2
+2
+2
+1
+2
+2
+4
+2
+2
+2
+2
+2
+3
+2
+2
+3
+1
+2
+2
+5
+2
+2
+2
+2
+1
+3
+2
+3
+2
+2
+1
+1
+2
+3
+4
+2
+3
+2
+2
+2
+1
+3
+1
+1
+5
+3
+2
+5
+3
+2
+1
+3
+4
+2
+3
+3
+2
+25
+1
+1
+1
+8
+17
+5
+5
+9
+3
+5
+3
+7
+3
+3
+1
+2
+1
+1
+7
+1
+2
+32
+2
+27
+3
+3
+15
+8
+20
+43
+10
+17
+4
+18
+2
+2
+5
+5
+2
+2
+2
+2
+2
+3
+2
+3
+2
+2
+2
+2
+2
+1
+1
+2
+2
+2
+2
+2
+2
+1
+2
+1
+1
+3
+2
+2
+2
+1
+2
+2
+1
+3
+2
+2
+2
+2
+4
+2
+2
+3
+3
+2
+2
+2
+2
+3
+2
+2
+2
+2
+2
+2
+1
+2
+2
+1
+5
+1
+2
+2
+2
+2
+2
+1
+3
+2
+3
+2
+3
+2
+2
+2
+1
+1
+2
+3
+3
+2
+3
+2
+2
+2
+1
+3
+2
+1
+2
+4
+2
+2
+5
+5
+2
+2
+1
+58
+11
+2
+2
+2
+2
+1
+4
+1
+2
+2
+2
+5
+5
+2
+1
+2
+2
+2
+2
+2
+1
+3
+3
+3
+2
+1
+2
+2
+1
+2
+1
+1
+2
+1
+2
+2
+1
+2
+2
+3
+2
+3
+1
+1
+2
+2
+1
+2
+3
+2
+2
+2
+1
+2
+1
+2
+2
+2
+1
+3
+1
+2
+2
+3
+2
+2
+6
+1
+2
+2
+2
+1
+2
+1
+3
+7
+3
+1
+2
+2
+2
+5
+1
+2
+2
+2
+2
+1
+1
+1
+2
+2
+2
+1
+1
+2
+2
+3
+2
+2
+1
+2
+1
+2
+3
+1
+2
+3
+1
+2
+3
+2
+1
+2
+2
+4
+4
+2
+2
+2
+3
+2
+4
+2
+2
+1
+2
+2
+1
+2
+4
+1
+2
+1
+1
+2
+1
+1
+1
+2
+2
+2
+5
+2
+2
+3
+3
+3
+2
+2
+1
+2
+2
+1
+2
+2
+1
+1
+1
+3
+1
+2
+2
+2
+16
+1
+2
+2
+2
+2
+1
+1
+2
+2
+1
+1
+2
+2
+2
+2
+2
+2
+3
+2
+1
+1
+1
+1
+2
+2
+3
+2
+2
+2
+2
+2
+3
+2
+2
+2
+4
+1
+2
+3
+2
+1
+2
+2
+2
+2
+3
+1
+2
+2
+2
+2
+1
+2
+2
+1
+1
+2
+1
+2
+2
+2
+1
+5
+2
+2
+2
+1
+4
+2
+2
+3
+2
+2
+3
+2
+2
+1
+2
+2
+1
+1
+5
+2
+3
+2
+2
+1
+1
+1
+2
+1
+3
+2
+4
+1
+2
+1
+1
+2
+2
+1
+1
+2
+3
+2
+2
+3
+1
+3
+2
+1
+2
+2
+6
+1
+2
+2
+2
+2
+2
+1
+2
+1
+1
+2
+1
+2
+1
+1
+2
+6
+2
+2
+2
+4
+2
+2
+1
+2
+1
+2
+3
+2
+1
+2
+2
+3
+3
+1
+3
+2
+2
+2
+3
+1
+1
+2
+3
+2
+2
+1
+1
+2
+3
+1
+2
+2
+2
+1
+2
+2
+2
+1
+1
+2
+2
+2
+1
+2
+2
+3
+1
+1
+2
+1
+2
+2
+1
+2
+1
+1
+1
+2
+2
+1
+2
+2
+2
+2
+4
+2
+2
+2
+2
+9
+2
+2
+2
+2
+3
+3
+2
+1
+2
+4
+2
+2
+2
+2
+8
+3
+2
+2
+3
+2
+2
+2
+3
+4
+2
+2
+2
+2
+4
+3
+2
+3
+2
+11
+2
+4
+2
+1
+2
+2
+5
+10
+9
+6
+3
+2
+2
+4
+2
+2
+3
+3
+2
+4
+2
+2
+4
+1
+4
+6
+2
+2
+3
+10
+2
+17
+3
+2
+5
+1
+9
+3
+2
+3
+3
+2
+3
+3
+2
+2
+12
+23
+3
+2
+5
+3
+2
+2
+3
+3
+5
+13
+13
+2
+2
+3
+3
+2
+3
+5
+2
+2
+1
+1
+4
+4
+3
+3
+2
+4
+1
+4
+2
+3
+2
+2
+2
+2
+1
+2
+2
+2
+1
+2
+11
+3
+4
+3
+4
+4
+2
+2
+2
+5
+8
+2
+3
+2
+3
+1
+2
+2
+2
+3
+2
+2
+2
+2
+2
+2
+2
+5
+1
+3
+2
+1
+3
+3
+2
+3
+22
+3
+1
+2
+2
+2
+2
+1
+2
+2
+4
+2
+2
+2
+2
+2
+2
+2
+2
+2
+1
+3
+2
+2
+2
+1
+2
+1
+3
+3
+3
+3
+3
+1
+1
+4
+2
+2
+1
+13
+3
+6
+1
+2
+2
+1
+14
+1
+1
+2
+3
+2
+2
+2
+3
+2
+8
+3
+1
+2
+4
+2
+3
+2
+1
+2
+5
+2
+2
+2
+3
+2
+2
+1
+2
+1
+1
+3
+1
+2
+1
+2
+3
+3
+1
+1
+8
+24
+1
+17
+4
+2
+2
+2
+23
+3
+1
+3
+1
+1
+2
+2
+1
+1
+2
+2
+4
+2
+13
+2
+2
+1
+1
+1
+3
+2
+2
+2
+1
+2
+4
+3
+2
+2
+2
+1
+8
+3
+2
+3
+1
+3
+1
+2
+14
+2
+2
+1
+23
+1
+1
+3
+2
+4
+1
+2
+1
+2
+10
+2
+2
+2
+3
+3
+10
+2
+2
+2
+3
+1
+2
+2
+35
+1
+2
+2
+3
+1
+2
+2
+2
+1
+3
+2
+2
+2
+1
+2
+3
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+1
+2
+2
+2
+1
+2
+2
+8
+4
+8
+1
+2
+2
+3
+1
+1
+3
+2
+2
+1
+2
+2
+1
+2
+2
+1
+2
+2
+1
+4
+1
+2
+4
+2
+2
+12
+2
+3
+1
+2
+2
+1
+2
+3
+2
+2
+1
+4
+3
+1
+1
+2
+3
+5
+1
+2
+2
+3
+3
+1
+2
+2
+5
+8
+3
+2
+3
+2
+2
+2
+2
+4
+2
+2
+4
+2
+2
+2
+2
+2
+3
+2
+1
+2
+2
+3
+3
+2
+1
+15
+36
+2
+4
+2
+3
+5
+2
+3
+2
+1
+2
+4
+2
+3
+1
+1
+2
+2
+1
+3
+1
+2
+3
+8
+1
+2
+2
+2
+2
+2
+2
+5
+11
+2
+2
+2
+1
+1
+1
+4
+1
+1
+2
+1
+3
+6
+7
+1
+6
+2
+3
+6
+9
+9
+2
+4
+2
+1
+2
+2
+2
+2
+2
+2
+1
+2
+3
+2
+5
+2
+2
+1
+2
+3
+1
+3
+3
+2
+2
+5
+2
+2
+2
+2
+2
+3
+2
+2
+2
+1
+1
+1
+2
+2
+6
+3
+1
+2
+1
+4
+2
+5
+2
+2
+2
+3
+1
+4
+3
+1
+2
+3
+2
+3
+2
+3
+2
+2
+2
+2
+2
+2
+3
+1
+2
+2
+1
+2
+2
+6
+2
+3
+3
+1
+3
+1
+2
+1
+2
+7
+1
+2
+2
+1
+1
+5
+2
+3
+2
+2
+2
+4
+5
+1
+1
+3
+2
+2
+3
+2
+1
+2
+3
+2
+2
+2
+2
+2
+1
+1
+1
+1
+2
+1
+2
+4
+1
+1
+2
+2
+3
+3
+2
+2
+1
+3
+2
+4
+15
+4
+2
+6
+1
+4
+37
+3
+3
+3
+9
+4
+5
+2
+1
+6
+2
+5
+2
+4
+4
+3
+1
+2
+2
+4
+3
+4
+3
+2
+2
+4
+2
+1
+2
+4
+3
+2
+2
+2
+1
+2
+2
+1
+2
+3
+2
+2
+2
+2
+1
+1
+3
+2
+2
+2
+1
+2
+2
+1
+2
+2
+4
+4
+1
+1
+1
+2
+4
+2
+4
+2
+2
+2
+2
+2
+2
+2
+2
+1
+2
+3
+2
+3
+2
+2
+1
+2
+1
+3
+2
+2
+3
+2
+2
+3
+2
+2
+1
+1
+2
+2
+3
+2
+1
+2
+2
+2
+2
+2
+1
+3
+2
+1
+2
+3
+1
+1
+2
+2
+2
+2
+1
+3
+2
+1
+5
+3
+2
+3
+3
+1
+2
+2
+2
+2
+2
+1
+2
+1
+1
+5
+2
+2
+2
+2
+2
+2
+1
+1
+1
+1
+1
+2
+2
+2
+2
+2
+3
+4
+3
+2
+2
+2
+2
+2
+2
+2
+2
+4
+2
+2
+3
+2
+1
+2
+2
+2
+3
+2
+1
+2
+2
+4
+3
+2
+2
+2
+1
+2
+2
+2
+2
+4
+1
+2
+2
+1
+2
+3
+1
+4
+3
+3
+2
+2
+1
+2
+3
+2
+3
+3
+2
+2
+2
+2
+1
+3
+3
+2
+2
+2
+2
+2
+2
+2
+2
+1
+1
+2
+5
+2
+1
+2
+2
+3
+3
+2
+2
+1
+2
+2
+2
+2
+2
+2
+2
+2
+1
+2
+2
+2
+2
+2
+1
+2
+1
+1
+1
+1
+5
+2
+5
+2
+2
+3
+2
+2
+1
+2
+2
+3
+4
+2
+2
+3
+1
+2
+1
+2
+2
+2
+2
+2
+2
+2
+3
+2
+3
+2
+2
+2
+2
+1
+2
+3
+3
+2
+3
+2
+2
+1
+2
+1
+3
+2
+1
+2
+1
+1
+2
+3
+2
+1
+2
+2
+2
+2
+2
+1
+2
+2
+1
+1
+4
+1
+2
+1
+2
+2
+1
+2
+2
+4
+2
+2
+1
+2
+2
+2
+3
+2
+2
+1
+2
+2
+1
+2
+1
+2
+2
+2
+2
+2
+2
+2
+1
+4
+2
+1
+1
+2
+2
+2
+3
+3
+1
+2
+2
+1
+3
+2
+2
+2
+2
+3
+2
+2
+1
+1
+3
+2
+2
+4
+2
+1
+3
+1
+2
+1
+2
+2
+2
+2
+2
+1
+2
+1
+1
+2
+1
+3
+1
+5
+2
+2
+2
+4
+2
+2
+8
+1
+2
+3
+2
+2
+2
+2
+3
+2
+2
+1
+2
+2
+2
+2
+2
+2
+2
+3
+2
+1
+2
+6
+1
+2
+2
+1
+2
+1
+2
+6
+2
+2
+2
+1
+2
+2
+2
+2
+2
+1
+7
+10
+3
+3
+5
+2
+5
+2
+2
+2
+2
+2
+2
+1
+2
+1
+2
+2
+2
+2
+2
+3
+2
+2
+2
+1
+2
+2
+2
+2
+1
+2
+3
+2
+2
+2
+2
+1
+1
+1
+1
+1
+4
+2
+2
+2
+2
+2
+1
+3
+2
+1
+2
+1
+2
+2
+2
+2
+2
+5
+5
+2
+1
+3
+2
+1
+2
+2
+2
+2
+2
+2
+1
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+1
+3
+1
+21
+5
+2
+3
+9
+4
+1
+1
+92
+2
+1
+13
+3
+13
+1
+12
+17
+2
+9
+13
+2
+56
+4
+2
+5
+4
+1
+2
+6
+17
+3
+1
+2
+34
+3
+17
+2
+1
+11
+3
+1
+8
+11
+10
+14
+5
+8
+19
+2
+3
+4
+3
+3
+1
+2
+1
+2
+2
+1
+4
+31
+5
+7
+2
+1
+5
+2
+5
+2
+2
+2
+6
+3
+2
+2
+2
+20
+6
+5
+4
+2
+1
+2
+3
+3
+2
+2
+2
+2
+2
+4
+1
+3
+5
+4
+2
+1
+1
+2
+2
+27
+2
+2
+2
+2
+2
+2
+7
+2
+4
+3
+1
+3
+10
+2
+2
+3
+3
+1
+2
+2
+1
+2
+2
+2
+6
+2
+4
+4
+3
+3
+4
+1
+1
+2
+1
+8
+6
+3
+3
+1
+6
+3
+5
+2
+3
+2
+5
+3
+3
+3
+1
+3
+1
+1
+3
+1
+2
+2
+4
+4
+2
+3
+3
+2
+2
+2
+3
+3
+2
+2
+2
+2
+1
+2
+8
+2
+1
+3
+2
+3
+4
+3
+1
+4
+3
+2
+2
+5
+2
+1
+2
+2
+2
+1
+1
+2
+2
+5
+2
+1
+3
+2
+1
+2
+1
+2
+2
+2
+10
+6
+2
+4
+1
+4
+2
+2
+3
+2
+2
+2
+2
+3
+6
+3
+2
+2
+2
+1
+2
+2
+1
+1
+3
+1
+2
+2
+2
+1
+3
+5
+2
+1
+2
+2
+2
+2
+2
+1
+2
+2
+1
+2
+1
+1
+2
+1
+2
+1
+2
+1
+9
+3
+5
+3
+7
+5
+20
+9
+3
+5
+5
+2
+2
+2
+11
+9
+3
+2
+2
+2
+3
+3
+2
+3
+2
+4
+1
+16
+2
+2
+6
+16
+2
+11
+46
+1
+8
+6
+1
+2
+6
+14
+2
+2
+7
+3
+3
+3
+3
+23
+1
+2
+4
+2
+3
+2
+2
+2
+3
+2
+7
+1
+4
+2
+5
+3
+1
+1
+2
+1
+3
+2
+5
+1
+5
+1
+1
+2
+1
+2
+2
+3
+4
+3
+1
+15
+2
+4
+1
+1
+2
+128
+4
+10
+7
+2
+2
+5
+2
+2
+2
+5
+1
+4
+5
+7
+5
+1
+1
+4
+3
+2
+2
+3
+2
+1
+1
+1
+2
+1
+2
+1
+2
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+2
+1
+2
+1
+1
+4
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+2
+1
+1
+1
+1
+1
+3
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+1
+6
+2
+1
+1
+1
+6
+2
+2
+1
+1
+6
+1
+1
+2
+2
+1
+1
+2
+2
+3
+3
+2
+1
+1
+3
+1
+1
+12
+1
+1
+3
+2
+2
+1
+2
+1
+6
+2
+2
+5
+1
+4
+1
+1
+1
+1
+1
+1
+3
+1
+1
+2
+1
+2
+2
+4
+2
+2
+4
+1
+2
+3
+1
+1
+2
+2
+1
+3
+2
+1
+5
+1
+1
+1
+1
+3
+5
+4
+1
+1
+1
+1
+3
+2
+2
+4
+3
+5
+2
+1
+1
+6
+7
+2
+47
+6
+9
+3
+2
+11
+2
+2
+13
+2
+9
+2
+2
+2
+2
+2
+2
+2
+2
+3
+2
+1
+4
+1
+6
+3
+2
+1
+2
+2
+2
+2
+2
+2
+5
+2
+1
+1
+2
+1
+1
+5
+1
+1
+2
+9
+3
+2
+2
+1
+2
+5
+1
+2
+2
+2
+2
+2
+1
+3
+2
+3
+1
+4
+2
+1
+2
+2
+3
+1
+2
+2
+1
+1
+2
+2
+1
+15
+2
+11
+12
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+1
+2
+2
+2
+3
+2
+2
+41
+12
+2
+3
+1
+3
+2
+4
+11
+2
+2
+2
+2
+2
+2
+3
+2
+3
+4
+8
+3
+40
+2
+2
+20
+3
+1
+2
+1
+2
+1
+24
+7
+29
+69
+16
+5
+3
+4
+3
+2
+9
+1
+2
+4
+1
+9
+2
+10
+2
+12
+1
+1
+2
+3
+2
+3
+2
+7
+2
+7
+2
+3
+2
+2
+1
+7
+2
+2
+2
+2
+2
+2
+2
+3
+2
+2
+2
+2
+2
+2
+2
+1
+2
+2
+2
+1
+1
+2
+2
+2
+3
+5
+1
+2
+1
+2
+2
+2
+3
+3
+2
+2
+2
+2
+3
+2
+1
+2
+2
+2
+1
+2
+3
+3
+2
+2
+4
+2
+2
+1
+1
+1
+2
+2
+1
+1
+2
+2
+2
+2
+2
+1
+1
+2
+1
+3
+3
+1
+2
+2
+1
+1
+1
+1
+1
+2
+2
+4
+1
+2
+1
+2
+2
+2
+1
+2
+1
+2
+1
+2
+1
+2
+1
+3
+2
+1
+3
+2
+1
+2
+3
+2
+5
+2
+2
+2
+4
+2
+2
+2
+2
+5
+3
+1
+2
+2
+2
+1
+1
+2
+2
+2
+1
+2
+2
+1
+2
+2
+3
+2
+9
+4
+5
+4
+5
+3
+1
+3
+1
+2
+2
+8
+2
+3
+5
+2
+2
+1
+1
+2
+1
+2
+5
+3
+1
+2
+2
+2
+4
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+32
+2
+7
+11
+2
+1
+2
+2
+1
+3
+3
+2
+2
+2
+4
+2
+1
+3
+3
+3
+5
+3
+5
+1
+2
+1
+2
+2
+8
+2
+2
+2
+1
+1
+1
+1
+3
+1
+1
+2
+3
+1
+2
+2
+2
+3
+1
+1
+2
+1
+2
+2
+1
+1
+3
+2
+2
+1
+1
+3
+2
+2
+2
+2
+2
+2
+1
+1
+2
+2
+1
+1
+2
+2
+2
+1
+2
+3
+1
+1
+2
+2
+2
+2
+2
+3
+2
+2
+2
+3
+1
+2
+2
+1
+2
+3
+2
+1
+3
+3
+9
+3
+7
+2
+2
+1
+3
+1
+2
+4
+1
+2
+1
+1
+3
+1
+3
+1
+2
+2
+1
+1
+1
+1
+1
+2
+4
+2
+1
+3
+2
+4
+1
+2
+2
+1
+1
+2
+3
+3
+3
+1
+1
+2
+2
+2
+2
+2
+1
+2
+1
+2
+1
+1
+2
+2
+2
+2
+2
+2
+2
+1
+2
+1
+2
+2
+1
+1
+3
+4
+2
+1
+2
+2
+2
+2
+1
+2
+2
+2
+2
+2
+3
+2
+2
+2
+2
+1
+1
+1
+2
+1
+2
+1
+2
+2
+2
+1
+2
+2
+1
+1
+2
+1
+1
+2
+2
+3
+2
+1
+3
+2
+2
+1
+2
+2
+2
+2
+2
+2
+3
+2
+1
+2
+4
+2
+2
+2
+2
+2
+2
+2
+1
+1
+1
+2
+2
+2
+2
+2
+1
+2
+1
+2
+2
+3
+2
+1
+2
+2
+1
+2
+3
+2
+3
+1
+1
+1
+2
+1
+2
+2
+1
+2
+2
+2
+2
+1
+2
+1
+1
+1
+1
+2
+2
+2
+2
+2
+3
+2
+2
+1
+2
+2
+1
+1
+1
+2
+1
+1
+2
+2
+4
+2
+2
+1
+1
+1
+3
+2
+2
+1
+2
+2
+2
+2
+2
+2
+2
+1
+1
+1
+2
+2
+2
+1
+2
+2
+5
+2
+1
+6
+2
+1
+2
+2
+2
+2
+2
+2
+1
+2
+2
+2
+1
+2
+3
+2
+1
+1
+2
+2
+3
+12
+11
+3
+1
+2
+3
+2
+2
+3
+2
+1
+1
+1
+1
+6
+2
+18
+1
+5
+12
+2
+16
+3
+7
+14
+3
+3
+2
+1
+1
+2
+49
+3
+2
+3
+3
+3
+2
+13
+3
+3
+2
+2
+1
+2
+2
+2
+2
+1
+3
+1
+1
+2
+2
+2
+2
+1
+2
+2
+3
+1
+1
+3
+2
+2
+2
+3
+3
+1
+1
+3
+9
+2
+2
+2
+2
+2
+2
+2
+2
+3
+4
+2
+2
+4
+2
+2
+3
+2
+7
+5
+2
+2
+1
+3
+2
+3
+2
+4
+1
+2
+2
+2
+2
+2
+2
+1
+2
+1
+2
+2
+2
+2
+2
+1
+1
+2
+2
+4
+1
+2
+1
+2
+8
+2
+2
+2
+1
+7
+2
+2
+2
+2
+2
+1
+3
+2
+2
+2
+2
+1
+3
+1
+2
+2
+2
+1
+1
+2
+2
+2
+2
+1
+10
+21
+5
+2
+3
+2
+2
+6
+4
+1
+5
+2
+2
+2
+3
+2
+3
+5
+1
+1
+1
+1
+3
+3
+2
+2
+2
+1
+3
+2
+2
+2
+2
+2
+2
+2
+1
+4
+2
+1
+2
+1
+2
+2
+3
+1
+1
+2
+2
+2
+1
+3
+2
+2
+1
+2
+7
+5
+3
+2
+2
+2
+13
+9
+1
+28
+2
+4
+70
+14
+3
+4
+3
+2
+2
+2
+10
+7
+11
+6
+8
+5
+1
+11
+2
+4
+2
+3
+2
+10
+2
+6
+4
+5
+5
+4
+2
+4
+2
+7
+3
+1
+2
+8
+1
+3
+3
+2
+1
+1
+2
+3
+1
+1
+2
+1
+1
+1
+1
+2
+1
+1
+2
+2
+1
+3
+3
+1
+2
+1
+2
+3
+2
+1
+1
+1
+2
+6
+3
+1
+1
+1
+1
+1
+1
+2
+2
+1
+2
+1
+1
+1
+1
+1
+1
+2
+1
+3
+1
+1
+1
+1
+1
+1
+3
+5
+1
+1
+2
+3
+1
+1
+2
+1
+1
+2
+1
+1
+1
+2
+1
+1
+2
+3
+2
+2
+2
+4
+2
+2
+1
+2
+2
+2
+3
+2
+2
+2
+2
+2
+1
+2
+3
+2
+2
+1
+4
+2
+1
+1
+1
+1
+1
+2
+1
+2
+3
+2
+2
+2
+2
+2
+2
+2
+6
+2
+1
+2
+2
+8
+1
+2
+2
+2
+2
+1
+1
+1
+1
+1
+3
+1
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+2
+4
+2
+2
+2
+3
+2
+1
+3
+1
+1
+1
+2
+5
+22
+3
+6
+31
+3
+13
+4
+12
+34
+5
+4
+11
+2
+1
+2
+3
+4
+1
+7
+10
+2
+23
+12
+1
+6
+3
+8
+2
+6
+3
+2
+4
+1
+6
+5
+5
+4
+13
+4
+16
+4
+10
+3
+4
+3
+2
+2
+2
+8
+7
+4
+2
+8
+9
+1
+2
+1
+2
+2
+5
+8
+1
+2
+1
+1
+1
+3
+4
+3
+8
+2
+2
+3
+1
+2
+5
+7
+6
+1
+3
+2
+3
+1
+3
+1
+2
+2
+2
+2
+2
+2
+2
+2
+3
+2
+7
+1
+2
+2
+1
+2
+7
+2
+1
+2
+2
+7
+1
+2
+1
+1
+2
+2
+2
+1
+3
+2
+1
+2
+2
+1
+2
+2
+2
+2
+2
+2
+2
+1
+2
+2
+2
+1
+3
+2
+2
+2
+1
+1
+4
+2
+1
+3
+1
+2
+20
+3
+2
+1
+4
+1
+2
+3
+2
+2
+1
+2
+3
+2
+1
+3
+2
+2
+7
+2
+2
+2
+2
+1
+3
+3
+1
+2
+2
+2
+1
+2
+1
+2
+2
+2
+3
+2
+2
+2
+1
+2
+1
+1
+3
+2
+2
+1
+3
+2
+4
+3
+1
+13
+17
+3
+4
+2
+1
+2
+4
+3
+1
+2
+3
+1
+5
+3
+1
+1
+3
+1
+2
+2
+27
+2
+2
+6
+4
+1
+2
+3
+2
+2
+10
+2
+4
+2
+2
+2
+2
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+9
+2
+2
+2
+2
+6
+2
+1
+6
+18
+2
+1
+1
+2
+1
+1
+1
+1
+1
+2
+9
+2
+1
+1
+1
+1
+1
+2
+1
+2
+48
+12
+1
+2
+1
+1
+2
+1
+1
+6
+7
+2
+1
+2
+1
+1
+2
+1
+2
+3
+1
+3
+2
+2
+5
+14
+1
+1
+2
+4
+1
+2
+1
+3
+7
+1
+2
+1
+1
+1
+1
+2
+1
+1
+1
+1
+21
+2
+22
+28
+2
+3
+2
+1
+2
+1
+2
+3
+2
+2
+3
+1
+2
+1
+2
+1
+2
+1
+14
+3
+18
+1
+1
+2
+8
+6
+1
+2
+1
+1
+2
+2
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+3
+2
+2
+1
+2
+2
+1
+2
+1
+3
+1
+1
+1
+2
+5
+2
+2
+2
+14
+19
+13
+25
+13
+4
+6
+7
+7
+1
+4
+4
+21
+11
+2
+6
+2
+1
+2
+12
+4
+2
+2
+4
+3
+4
+3
+3
+3
+2
+3
+7
+4
+5
+2
+1
+4
+10
+2
+3
+3
+3
+3
+2
+2
+4
+2
+3
+2
+2
+3
+4
+2
+2
+2
+2
+2
+2
+1
+4
+2
+2
+2
+4
+3
+2
+3
+2
+1
+2
+3
+2
+2
+1
+2
+2
+3
+2
+2
+2
+1
+3
+2
+14
+1
+10
+6
+3
+3
+4
+2
+11
+3
+1
+3
+3
+1
+4
+1
+1
+3
+2
+1
+4
+1
+2
+2
+2
+3
+1
+3
+1
+2
+1
+2
+5
+4
+1
+1
+2
+28
+2
+16
+2
+1
+2
+3
+2
+27
+2
+3
+5
+4
+2
+1
+2
+1
+2
+2
+2
+3
+2
+2
+3
+2
+2
+2
+2
+1
+1
+2
+2
+2
+2
+3
+2
+1
+1
+2
+1
+2
+2
+2
+2
+1
+2
+2
+2
+1
+3
+3
+1
+2
+2
+1
+2
+3
+2
+3
+2
+2
+3
+2
+1
+2
+2
+2
+1
+2
+3
+3
+1
+3
+2
+1
+2
+2
+2
+4
+3
+1
+2
+2
+2
+2
+2
+1
+2
+2
+1
+1
+3
+5
+2
+2
+2
+2
+4
+2
+2
+3
+5
+2
+2
+1
+3
+3
+5
+3
+3
+4
+2
+1
+3
+2
+2
+1
+1
+1
+2
+1
+1
+4
+2
+2
+11
+29
+1
+11
+3
+4
+1
+3
+1
+7
+12
+2
+2
+4
+28
+1
+1
+2
+8
+1
+1
+3
+4
+3
+2
+4
+4
+1
+2
+2
+1
+7
+1
+1
+2
+5
+1
+1
+2
+2
+2
+4
+3
+1
+2
+2
+1
+3
+1
+5
+1
+1
+3
+1
+1
+30
+2
+1
+1
+2
+1
+2
+26
+1
+14
+3
+1
+1
+1
+1
+3
+6
+3
+6
+2
+3
+2
+3
+1
+2
+1
+1
+1
+2
+2
+2
+2
+1
+1
+1
+2
+1
+1
+1
+1
+2
+3
+3
+2
+3
+1
+1
+2
+4
+3
+2
+1
+2
+1
+1
+1
+1
+1
+2
+2
+3
+2
+1
+2
+1
+2
+2
+2
+2
+2
+2
+1
+6
+3
+11
+2
+1
+2
+1
+1
+2
+2
+1
+1
+1
+26
+2
+2
+2
+1
+2
+3
+3
+2
+3
+2
+3
+2
+4
+1
+1
+2
+1
+3
+1
+2
+2
+2
+1
+2
+2
+1
+2
+2
+3
+1
+1
+2
+2
+2
+2
+2
+1
+7
+2
+2
+2
+3
+1
+1
+2
+1
+2
+3
+2
+2
+2
+5
+2
+4
+1
+1
+1
+24
+10
+15
+2
+4
+2
+1
+1
+1
+2
+2
+3
+1
+1
+2
+1
+3
+3
+2
+1
+2
+3
+1
+2
+2
+2
+4
+2
+3
+3
+2
+3
+2
+2
+2
+2
+2
+6
+2
+2
+2
+4
+2
+2
+3
+3
+7
+2
+3
+2
+2
+1
+1
+1
+3
+2
+3
+2
+2
+2
+2
+3
+2
+1
+3
+3
+2
+5
+2
+7
+2
+2
+3
+7
+2
+2
+2
+2
+3
+1
+3
+1
+1
+2
+1
+2
+2
+1
+1
+2
+2
+3
+1
+2
+2
+1
+2
+1
+4
+3
+2
+2
+1
+1
+2
+1
+10
+2
+1
+1
+1
+2
+2
+1
+1
+2
+2
+2
+2
+1
+2
+1
+4
+2
+1
+2
+2
+2
+1
+2
+1
+1
+3
+2
+1
+2
+2
+1
+2
+2
+2
+2
+1
+2
+1
+4
+1
+3
+1
+2
+1
+2
+2
+1
+2
+1
+2
+2
+1
+2
+2
+2
+2
+2
+1
+10
+2
+1
+2
+2
+2
+1
+1
+4
+1
+4
+1
+1
+2
+2
+1
+1
+3
+2
+5
+3
+1
+1
+2
+1
+2
+1
+2
+2
+2
+2
+2
+1
+3
+2
+2
+2
+2
+1
+2
+2
+2
+2
+2
+2
+2
+3
+2
+1
+1
+3
+4
+2
+2
+2
+2
+4
+1
+1
+2
+2
+1
+2
+2
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+2
+2
+2
+1
+2
+2
+1
+1
+2
+1
+5
+2
+1
+2
+2
+1
+2
+2
+2
+2
+2
+5
+5
+1
+6
+50
+2
+1
+2
+2
+1
+1
+4
+3
+3
+5
+1
+10
+1
+1
+2
+1
+2
+2
+2
+2
+1
+3
+3
+3
+10
+2
+1
+1
+1
+2
+4
+1
+1
+1
+1
+3
+3
+2
+2
+2
+1
+3
+1
+1
+2
+6
+2
+2
+6
+8
+5
+3
+9
+7
+8
+6
+10
+18
+2
+2
+15
+2
+13
+3
+7
+11
+11
+2
+31
+6
+3
+1
+3
+4
+12
+3
+1
+7
+7
+4
+2
+5
+4
+3
+6
+6
+2
+3
+5
+7
+3
+1
+4
+1
+3
+5
+3
+3
+3
+13
+2
+3
+4
+2
+4
+2
+2
+6
+4
+4
+3
+2
+1
+5
+3
+1
+1
+3
+3
+4
+3
+3
+2
+2
+2
+2
+1
+2
+2
+2
+2
+1
+2
+1
+1
+2
+2
+3
+1
+2
+2
+1
+3
+2
+3
+1
+1
+16
+15
+4
+1
+1
+2
+2
+1
+2
+2
+2
+1
+6
+1
+2
+9
+1
+1
+1
+1
+1
+1
+2
+1
+1
+2
+2
+5
+1
+2
+2
+2
+1
+2
+1
+3
+1
+1
+2
+2
+1
+2
+3
+2
+2
+2
+2
+1
+2
+1
+1
+1
+1
+1
+1
+4
+1
+1
+2
+1
+2
+4
+2
+2
+1
+2
+1
+2
+1
+2
+3
+4
+4
+1
+4
+2
+1
+1
+7
+3
+3
+3
+2
+3
+1
+3
+2
+3
+2
+2
+1
+1
+2
+1
+7
+2
+2
+2
+2
+26
+2
+5
+3
+1
+1
+2
+3
+1
+1
+2
+2
+2
+2
+1
+2
+2
+2
+1
+2
+3
+2
+2
+2
+2
+2
+2
+1
+2
+2
+2
+2
+2
+1
+2
+2
+1
+3
+1
+3
+2
+2
+4
+1
+1
+1
+1
+1
+1
+1
+2
+1
+2
+1
+2
+1
+9
+1
+1
+4
+2
+2
+1
+2
+3
+6
+15
+2
+2
+2
+9
+1
+1
+2
+2
+2
+3
+2
+2
+2
+2
+1
+2
+2
+2
+4
+2
+4
+1
+2
+2
+2
+2
+1
+2
+2
+2
+2
+2
+2
+2
+1
+1
+1
+2
+1
+1
+1
+4
+2
+2
+3
+2
+1
+2
+1
+1
+2
+2
+1
+4
+7
+5
+5
+3
+8
+4
+2
+3
+3
+1
+1
+2
+1
+2
+2
+2
+1
+1
+2
+2
+2
+2
+13
+2
+2
+2
+2
+3
+2
+2
+2
+2
+2
+1
+1
+3
+2
+3
+1
+1
+2
+4
+2
+2
+2
+1
+2
+2
+2
+1
+7
+2
+2
+3
+5
+1
+2
+2
+1
+2
+3
+2
+3
+3
+2
+2
+1
+3
+4
+2
+3
+1
+2
+6
+1
+1
+1
+1
+1
+1
+1
+3
+2
+3
+1
+2
+2
+2
+3
+1
+3
+2
+1
+1
+1
+2
+1
+4
+4
+3
+2
+2
+2
+1
+2
+1
+2
+2
+1
+1
+1
+2
+2
+1
+1
+1
+2
+1
+2
+2
+2
+1
+1
+3
+1
+1
+2
+1
+2
+3
+1
+1
+1
+1
+4
+2
+2
+1
+2
+1
+1
+1
+1
+1
+2
+2
+2
+1
+9
+2
+1
+1
+1
+2
+2
+2
+1
+1
+2
+4
+1
+2
+4
+2
+1
+2
+2
+2
+2
+1
+1
+2
+2
+4
+2
+2
+4
+3
+1
+1
+1
+1
+2
+1
+1
+2
+4
+2
+4
+1
+1
+2
+1
+2
+2
+1
+2
+1
+3
+2
+1
+3
+2
+2
+2
+1
+1
+1
+3
+2
+2
+2
+4
+4
+1
+3
+1
+1
+2
+1
+2
+1
+3
+2
+2
+1
+2
+2
+2
+4
+1
+2
+2
+2
+1
+1
+4
+2
+1
+2
+2
+1
+2
+2
+1
+1
+4
+1
+1
+2
+1
+3
+1
+1
+2
+1
+1
+1
+2
+1
+2
+2
+2
+2
+2
+2
+2
+1
+2
+2
+2
+1
+2
+2
+1
+5
+3
+1
+1
+2
+3
+1
+3
+2
+1
+1
+3
+1
+1
+2
+2
+1
+4
+1
+2
+1
+2
+2
+5
+2
+2
+2
+3
+1
+2
+2
+2
+1
+2
+3
+1
+2
+1
+2
+1
+2
+1
+2
+1
+1
+2
+2
+2
+2
+2
+3
+2
+2
+1
+2
+1
+2
+2
+3
+2
+3
+1
+3
+2
+2
+1
+1
+2
+2
+1
+2
+2
+2
+1
+1
+1
+3
+8
+2
+2
+2
+2
+2
+3
+13
+2
+2
+2
+2
+2
+2
+2
+1
+1
+2
+1
+3
+3
+4
+5
+4
+3
+9
+3
+3
+4
+3
+17
+5
+5
+1
+1
+2
+2
+1
+1
+1
+2
+2
+2
+2
+2
+5
+1
+4
+2
+2
+2
+3
+2
+2
+2
+2
+2
+2
+3
+1
+3
+2
+3
+2
+1
+2
+2
+3
+2
+12
+2
+4
+2
+1
+5
+2
+1
+1
+1
+2
+1
+1
+1
+1
+2
+3
+2
+3
+1
+1
+2
+1
+3
+2
+2
+14
+2
+3
+6
+6
+3
+3
+3
+3
+3
+3
+8
+4
+3
+5
+2
+2
+4
+1
+2
+1
+1
+2
+1
+2
+2
+1
+2
+1
+1
+2
+1
+1
+2
+2
+1
+3
+3
+20
+3
+5
+2
+3
+3
+2
+2
+2
+2
+2
+2
+2
+1
+2
+2
+1
+4
+1
+2
+2
+2
+2
+2
+3
+1
+2
+1
+1
+1
+1
+2
+2
+1
+2
+1
+2
+2
+1
+2
+1
+1
+2
+2
+2
+1
+1
+2
+2
+2
+1
+2
+1
+4
+2
+1
+2
+2
+1
+1
+2
+3
+2
+2
+3
+1
+2
+2
+2
+2
+2
+2
+1
+2
+1
+1
+2
+2
+2
+1
+1
+1
+1
+1
+1
+1
+2
+2
+2
+2
+1
+2
+1
+1
+1
+2
+2
+2
+1
+1
+2
+1
+1
+2
+1
+1
+2
+3
+2
+2
+3
+2
+1
+1
+1
+1
+1
+3
+1
+2
+2
+1
+4
+2
+2
+2
+1
+3
+4
+2
+13
+2
+1
+2
+2
+3
+2
+1
+2
+1
+3
+1
+1
+2
+1
+1
+2
+2
+1
+3
+9
+3
+10
+1
+1
+4
+3
+2
+1
+2
+2
+7
+1
+4
+2
+1
+1
+1
+1
+1
+2
+1
+2
+1
+2
+2
+1
+5
+1
+2
+3
+2
+2
+2
+2
+1
+1
+3
+3
+2
+1
+2
+2
+2
+2
+3
+2
+1
+2
+3
+1
+1
+2
+1
+2
+2
+2
+2
+1
+2
+1
+1
+3
+2
+1
+2
+4
+1
+1
+3
+2
+1
+2
+1
+2
+3
+2
+2
+2
+2
+1
+1
+1
+2
+2
+2
+2
+1
+1
+1
+2
+2
+1
+3
+2
+2
+1
+2
+2
+2
+2
+1
+2
+2
+3
+2
+2
+1
+2
+2
+2
+2
+3
+3
+2
+6
+1
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+3
+1
+3
+1
+2
+3
+1
+1
+2
+1
+1
+2
+1
+2
+2
+2
+1
+2
+1
+1
+1
+1
+1
+1
+2
+1
+1
+2
+1
+2
+2
+2
+2
+3
+1
+2
+2
+2
+4
+2
+2
+2
+2
+2
+1
+2
+1
+2
+1
+2
+2
+1
+8
+4
+1
+2
+2
+1
+1
+2
+2
+1
+1
+2
+1
+2
+2
+2
+2
+1
+2
+1
+1
+1
+2
+2
+3
+2
+1
+3
+1
+2
+1
+2
+2
+1
+1
+1
+1
+1
+1
+2
+1
+1
+2
+1
+1
+1
+2
+1
+2
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+2
+2
+1
+2
+2
+1
+2
+1
+2
+2
+2
+2
+1
+2
+1
+1
+2
+2
+2
+2
+1
+3
+2
+1
+1
+1
+3
+2
+2
+1
+1
+1
+1
+2
+2
+2
+1
+1
+1
+2
+2
+2
+2
+1
+1
+2
+1
+1
+2
+2
+1
+2
+3
+2
+2
+2
+5
+1
+12
+13
+13
+8
+2
+1
+1
+1
+18
+7
+1
+1
+3
+3
+3
+3
+2
+3
+2
+1
+1
+2
+4
+1
+2
+2
+3
+3
+4
+2
+1
+2
+1
+2
+2
+1
+2
+2
+2
+1
+1
+1
+2
+3
+2
+1
+2
+1
+1
+2
+2
+2
+2
+1
+1
+9
+1
+1
+1
+4
+1
+1
+1
+2
+1
+2
+6
+2
+2
+2
+1
+1
+1
+14
+2
+1
+1
+1
+1
+2
+1
+1
+2
+2
+1
+1
+1
+1
+2
+2
+1
+2
+3
+2
+1
+13
+1
+2
+1
+1
+1
+1
+3
+4
+2
+1
+2
+4
+1
+6
+2
+1
+2
+1
+3
+3
+1
+1
+1
+1
+2
+1
+2
+1
+1
+2
+3
+1
+1
+4
+1
+3
+1
+4
+2
+3
+2
+1
+4
+2
+8
+1
+3
+5
+1
+1
+2
+2
+1
+2
+1
+2
+1
+2
+3
+2
+1
+3
+1
+1
+1
+1
+4
+2
+1
+1
+2
+1
+2
+1
+1
+1
+2
+1
+3
+1
+1
+3
+5
+1
+2
+2
+1
+1
+18
+1
+1
+1
+3
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+2
+2
+2
+2
+2
+1
+9
+1
+2
+1
+2
+2
+1
+2
+1
+1
+1
+1
+2
+2
+2
+1
+1
+1
+1
+2
+6
+2
+1
+2
+2
+2
+2
+4
+8
+3
+1
+3
+1
+2
+4
+2
+1
+1
+3
+1
+1
+7
+3
+1
+4
+3
+2
+2
+2
+1
+1
+3
+5
+2
+1
+1
+3
+1
+1
+1
+3
+5
+4
+3
+1
+2
+1
+1
+2
+5
+2
+4
+1
+2
+2
+3
+2
+2
+5
+2
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+2
+2
+1
+3
+2
+2
+2
+2
+2
+5
+1
+2
+1
+1
+6
+2
+2
+1
+1
+2
+5
+1
+3
+1
+3
+2
+3
+1
+3
+1
+2
+1
+1
+2
+2
+2
+2
+1
+2
+2
+1
+2
+2
+1
+1
+1
+1
+1
+2
+1
+1
+2
+2
+3
+1
+2
+3
+2
+1
+2
+1
+1
+4
+1
+2
+2
+2
+2
+2
+2
+2
+1
+1
+2
+1
+2
+1
+2
+1
+2
+2
+2
+3
+3
+2
+2
+2
+2
+1
+2
+1
+1
+3
+3
+2
+2
+2
+2
+3
+2
+6
+2
+3
+3
+1
+1
+1
+1
+2
+1
+3
+3
+1
+1
+3
+3
+1
+1
+2
+2
+2
+1
+2
+2
+1
+2
+2
+2
+7
+1
+1
+2
+1
+2
+2
+1
+1
+1
+1
+1
+1
+2
+1
+1
+3
+2
+2
+1
+1
+1
+1
+2
+2
+1
+2
+1
+2
+1
+1
+2
+1
+2
+3
+1
+1
+1
+1
+1
+1
+2
+1
+2
+1
+1
+2
+2
+1
+1
+1
+2
+2
+2
+1
+1
+1
+2
+1
+2
+1
+1
+1
+2
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+2
+1
+2
+1
+3
+2
+6
+2
+2
+2
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+2
+2
+2
+2
+1
+2
+1
+2
+2
+1
+2
+1
+1
+1
+1
+6
+2
+1
+1
+3
+2
+3
+2
+1
+1
+2
+1
+1
+1
+1
+4
+1
+1
+2
+2
+2
+2
+1
+2
+2
+1
+1
+1
+1
+3
+2
+2
+1
+2
+2
+1
+2
+1
+3
+1
+1
+2
+2
+1
+2
+1
+1
+1
+1
+2
+1
+2
+3
+2
+1
+1
+2
+2
+2
+2
+2
+1
+2
+2
+1
+2
+1
+1
+2
+1
+1
+1
+2
+1
+3
+2
+2
+1
+1
+2
+1
+1
+1
+4
+2
+4
+5
+2
+1
+1
+5
+1
+1
+1
+3
+2
+2
+2
+2
+2
+2
+2
+1
+1
+4
+2
+2
+1
+1
+1
+1
+1
+1
+2
+2
+3
+6
+1
+2
+1
+2
+5
+7
+2
+1
+2
+2
+1
+1
+1
+1
+1
+2
+1
+3
+1
+2
+2
+1
+1
+2
+1
+1
+1
+2
+5
+2
+4
+2
+1
+1
+2
+1
+4
+1
+6
+1
+2
+1
+2
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+3
+1
+1
+7
+1
+6
+2
+3
+11
+18
+5
+4
+5
+2
+4
+2
+1
+3
+1
+4
+2
+4
+2
+3
+1
+2
+3
+1
+7
+2
+1
+1
+2
+1
+3
+3
+2
+2
+2
+1
+2
+1
+4
+2
+2
+1
+1
+1
+1
+3
+1
+1
+2
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+2
+1
+2
+1
+2
+1
+2
+2
+2
+2
+3
+5
+3
+3
+4
+2
+3
+3
+3
+3
+3
+5
+2
+1
+1
+2
+1
+2
+2
+1
+1
+4
+1
+1
+1
+2
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+2
+3
+2
+1
+1
+3
+1
+1
+2
+3
+5
+1
+2
+1
+2
+2
+5
+1
+1
+2
+2
+1
+2
+11
+2
+3
+1
+1
+9
+1
+1
+1
+1
+2
+2
+1
+2
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+2
+1
+8
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+2
+1
+1
+2
+2
+2
+2
+1
+2
+1
+2
+1
+2
+1
+2
+1
+1
+1
+2
+1
+1
+1
+9
+1
+1
+1
+1
+1
+3
+1
+1
+2
+1
+1
+2
+1
+3
+44
+2
+1
+2
+3
+2
+3
+2
+2
+2
+1
+2
+2
+2
+2
+3
+3
+2
+2
+2
+2
+2
+6
+7
+2
+2
+3
+1
+1
+1
+1
+6
+3
+2
+1
+2
+2
+2
+2
+1
+1
+2
+1
+1
+2
+2
+2
+2
+1
+1
+1
+3
+2
+1
+2
+2
+1
+2
+1
+2
+2
+1
+2
+2
+1
+2
+1
+1
+1
+3
+2
+3
+1
+1
+1
+1
+1
+11
+1
+1
+1
+4
+2
+2
+1
+1
+1
+1
+2
+1
+1
+2
+1
+1
+2
+1
+1
+2
+1
+1
+2
+2
+1
+1
+2
+1
+2
+2
+1
+1
+2
+2
+2
+2
+1
+1
+1
+4
+1
+2
+1
+1
+3
+2
+2
+1
+2
+2
+4
+3
+2
+1
+2
+1
+2
+1
+2
+1
+1
+2
+2
+1
+1
+1
+2
+1
+1
+2
+1
+1
+2
+2
+1
+1
+1
+1
+2
+2
+2
+1
+2
+2
+2
+1
+2
+2
+1
+3
+2
+1
+2
+2
+1
+1
+3
+1
+1
+1
+1
+2
+1
+1
+1
+1
+2
+1
+1
+2
+2
+1
+1
+1
+2
+1
+2
+1
+9
+1
+1
+1
+2
+1
+1
+2
+1
+1
+2
+1
+1
+1
+2
+2
+3
+1
+1
+1
+1
+2
+1
+1
+1
+4
+2
+4
+7
+1
+1
+2
+1
+2
+2
+2
+2
+1
+3
+5
+2
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+2
+1
+1
+1
+1
+1
+2
+1
+1
+2
+1
+2
+2
+2
+2
+1
+2
+2
+1
+1
+2
+4
+2
+2
+1
+2
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+5
+2
+3
+2
+2
+1
+2
+1
+1
+1
+2
+3
+2
+1
+2
+1
+1
+2
+1
+1
+1
+1
+2
+1
+1
+1
+1
+2
+2
+2
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+2
+1
+2
+1
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+2
+1
+2
+2
+1
+2
+2
+3
+3
+2
+2
+3
+1
+1
+2
+2
+2
+1
+2
+2
+2
+2
+2
+1
+2
+1
+1
+2
+2
+2
+2
+2
+2
+2
+1
+1
+3
+1
+1
+10
+2
+3
+3
+4
+3
+1
+1
+2
+2
+1
+2
+12
+2
+2
+4
+4
+2
+5
+1
+5
+3
+2
+1
+3
+1
+4
+3
+1
+1
+3
+2
+2
+3
+2
+1
+1
+3
+2
+2
+1
+3
+2
+2
+3
+3
+1
+2
+2
+2
+1
+1
+1
+3
+2
+2
+2
+2
+2
+1
+1
+1
+1
+2
+1
+2
+2
+3
+3
+4
+2
+2
+1
+2
+1
+1
+1
+2
+2
+2
+2
+2
+1
+1
+4
+2
+3
+1
+1
+1
+1
+1
+1
+1
+1
+2
+3
+1
+2
+2
+2
+1
+2
+1
+2
+1
+2
+1
+3
+2
+2
+1
+2
+1
+2
+1
+2
+2
+1
+1
+2
+1
+2
+1
+2
+1
+2
+2
+2
+2
+1
+2
+1
+2
+2
+2
+1
+1
+3
+4
+4
+2
+2
+2
+2
+1
+2
+1
+1
+1
+1
+1
+2
+2
+2
+1
+2
+2
+1
+1
+1
+1
+3
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+2
+2
+1
+2
+2
+2
+2
+2
+1
+1
+2
+2
+2
+1
+1
+1
+1
+1
+3
+4
+1
+2
+1
+1
+1
+1
+1
+1
+3
+2
+1
+3
+2
+5
+1
+2
+1
+10
+3
+1
+1
+2
+1
+2
+1
+1
+2
+1
+2
+1
+1
+1
+1
+1
+7
+2
+1
+1
+1
+1
+1
+1
+1
+2
+2
+1
+1
+1
+3
+7
+2
+1
+1
+3
+2
+1
+1
+2
+4
+2
+1
+1
+1
+1
+1
+1
+2
+1
+2
+1
+1
+1
+2
+1
+2
+2
+2
+1
+1
+1
+2
+1
+1
+2
+2
+1
+5
+1
+1
+1
+1
+2
+6
+9
+1
+1
+1
+3
+4
+1
+2
+1
+1
+1
+1
+2
+1
+3
+1
+2
+2
+1
+1
+1
+3
+2
+1
+2
+1
+1
+1
+1
+1
+3
+3
+1
+2
+1
+1
+1
+1
+1
+3
+1
+2
+1
+2
+1
+1
+1
+1
+4
+2
+1
+1
+2
+9
+2
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+1
+1
+1
+2
+6
+2
+1
+3
+2
+1
+1
+2
+2
+1
+2
+1
+2
+1
+1
+2
+1
+1
+1
+1
+2
+2
+1
+1
+2
+1
+2
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+2
+1
+1
+2
+1
+1
+1
+1
+2
+1
+1
+1
+1
+3
+1
+1
+1
+1
+1
+1
+2
+1
+2
+1
+1
+1
+2
+2
+1
+1
+1
+1
+2
+1
+2
+2
+1
+2
+1
+2
+1
+1
+1
+1
+1
+2
+2
+1
+2
+1
+1
+2
+1
+1
+2
+2
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+2
+1
+1
+1
+1
+4
+1
+1
+2
+1
+2
+1
+2
+1
+1
+1
+1
+1
+1
+2
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+2
+2
+1
+1
+2
+1
+1
+1
+1
+1
+1
+2
+1
+3
+2
+1
+2
+1
+2
+1
+1
+2
+3
+1
+2
+1
+1
+1
+2
+2
+1
+1
+2
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+2
+1
+1
+2
+2
+2
+1
+3
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+3
+1
+1
+2
+1
+4
+1
+1
+2
+1
+2
+1
+3
+2
+3
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+4
+1
+1
+4
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+5
+5
+3
+2
+2
+1
+1
+1
+1
+1
+2
+2
+1
+3
+2
+2
+1
+2
+1
+3
+2
+1
+1
+1
+2
+1
+2
+1
+1
+2
+2
+2
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+2
+1
+2
+1
+1
+1
+1
+1
+1
+1
+2
+2
+2
+4
+1
+4
+1
+1
+2
+1
+2
+1
+1
+1
+1
+1
+2
+1
+1
+1
+3
+1
+1
+2
+2
+1
+2
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+2
+1
+2
+2
+1
+1
+1
+2
+1
+1
+1
+2
+2
+1
+4
+1
+2
+2
+1
+4
+1
+2
+2
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+4
+1
+1
+1
+2
+5
+1
+1
+1
+2
+1
+1
+3
+3
+2
+2
+3
+1
+2
+1
+2
+1
+1
+1
+3
+1
+3
+1
+1
+1
+1
+1
+1
+1
+2
+2
+1
+1
+2
+1
+1
+1
+1
+3
+2
+1
+1
+1
+2
+1
+3
+1
+3
+2
+3
+2
+2
+3
+1
+2
+1
+2
+2
+2
+2
+2
+1
+1
+1
+1
+1
+1
+1
+2
+2
+1
+1
+2
+1
+1
+2
+6
+1
+3
+1
+4
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+2
+2
+2
+1
+1
+1
+1
+1
+2
+1
+3
+1
+1
+5
+4
+1
+2
+2
+2
+1
+6
+1
+1
+2
+2
+2
+5
+1
+3
+1
+1
+2
+1
+1
+1
+1
+1
+2
+1
+5
+2
+2
+1
+2
+1
+2
+2
+2
+4
+1
+6
+1
+2
+1
+1
+1
+2
+1
+2
+2
+7
+1
+3
+3
+1
+1
+2
+1
+2
+1
+1
+1
+1
+2
+2
+4
+1
+2
+1
+1
+1
+1
+2
+1
+2
+1
+2
+2
+1
+1
+1
+2
+1
+7
+3
+4
+1
+1
+1
+2
+1
+2
+1
+1
+3
+2
+1
+1
+3
+2
+1
+2
+3
+2
+2
+1
+2
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+2
+1
+1
+2
+2
+1
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+1
+2
+1
+2
+1
+2
+2
+2
+1
+9
+1
+1
+1
+1
+1
+2
+2
+2
+2
+1
+2
+1
+2
+1
+1
+1
+2
+1
+1
+2
+2
+1
+1
+2
+1
+1
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+2
+1
+1
+2
+2
+1
+1
+3
+2
+1
+1
+1
+1
+1
+2
+1
+6
+2
+2
+2
+1
+1
+1
+2
+1
+2
+1
+2
+3
+2
+1
+1
+1
+1
+2
+2
+2
+1
+1
+1
+1
+1
+1
+2
+1
+1
+3
+1
+2
+1
+2
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+2
+1
+2
+1
+2
+1
+4
+2
+3
+2
+2
+2
+5
+1
+2
+1
+1
+1
+1
+1
+1
+1
+2
+3
+1
+1
+1
+1
+2
+1
+1
+1
+1
+2
+1
+2
+1
+2
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+2
+2
+1
+1
+1
+2
+1
+2
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+6
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+3
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+3
+2
+1
+2
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+2
+1
+1
+2
+1
+1
+2
+1
+1
+1
+1
+2
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+2
+2
+2
+2
+2
+1
+1
+1
+1
+2
+1
+2
+1
+2
+1
+2
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+2
+1
+1
+1
+2
+1
+2
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+2
+1
+1
+1
+2
+1
+6
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+2
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+2
+2
+1
+2
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+3
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2
+1
+1
+1
+1
+1
+1
diff --git a/examples/Makefile.am b/examples/Makefile.am
new file mode 100644
index 0000000..4e33c16
--- /dev/null
+++ b/examples/Makefile.am
@@ -0,0 +1,4 @@
+exampledir=$(prefix)/$(PACKAGE)-examples
+example_DATA = AS-20010316.net_degs er_1000_2000.net \
+er_1000_5000.net Makefile.am pl_-3.0_3_500_10000
+dist_example_DATA = $(example_DATA)
diff --git a/examples/Makefile.in b/examples/Makefile.in
new file mode 100644
index 0000000..bb02109
--- /dev/null
+++ b/examples/Makefile.in
@@ -0,0 +1,476 @@
+# 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 = examples
+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_example_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; }; \
+ }
+am__installdirs = "$(DESTDIR)$(exampledir)" "$(DESTDIR)$(exampledir)"
+DATA = $(dist_example_DATA) $(example_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(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 = @docdir@
+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@
+exampledir = $(prefix)/$(PACKAGE)-examples
+example_DATA = AS-20010316.net_degs er_1000_2000.net \
+er_1000_5000.net Makefile.am pl_-3.0_3_500_10000
+
+dist_example_DATA = $(example_DATA)
+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 examples/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign examples/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-dist_exampleDATA: $(dist_example_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(dist_example_DATA)'; test -n "$(exampledir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(exampledir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(exampledir)" || 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)$(exampledir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(exampledir)" || exit $$?; \
+ done
+
+uninstall-dist_exampleDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_example_DATA)'; test -n "$(exampledir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(exampledir)'; $(am__uninstall_files_from_dir)
+install-exampleDATA: $(example_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(example_DATA)'; test -n "$(exampledir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(exampledir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(exampledir)" || 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)$(exampledir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(exampledir)" || exit $$?; \
+ done
+
+uninstall-exampleDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(example_DATA)'; test -n "$(exampledir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(exampledir)'; $(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
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(exampledir)" "$(DESTDIR)$(exampledir)"; 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_exampleDATA install-exampleDATA
+
+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-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_exampleDATA uninstall-exampleDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am 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_exampleDATA install-dvi \
+ install-dvi-am install-exampleDATA install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man 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_exampleDATA uninstall-exampleDATA
+
+.PRECIOUS: Makefile
+
+
+# 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/examples/er_1000_2000.net b/examples/er_1000_2000.net
new file mode 100644
index 0000000..c61c33b
--- /dev/null
+++ b/examples/er_1000_2000.net
@@ -0,0 +1,2000 @@
+8 0
+15 9
+34 25
+36 10
+41 38
+55 12
+56 31
+62 30
+64 8
+65 44
+71 57
+74 16
+74 65
+77 15
+87 29
+98 96
+99 69
+101 16
+102 77
+104 11
+106 17
+112 11
+113 84
+114 19
+116 47
+123 3
+123 65
+124 81
+125 4
+125 22
+125 113
+126 19
+126 73
+128 2
+128 10
+129 73
+132 10
+133 44
+133 50
+134 71
+135 36
+135 67
+140 98
+141 9
+141 120
+147 10
+147 25
+147 38
+148 6
+149 4
+150 24
+150 89
+151 15
+151 120
+152 50
+155 84
+156 4
+158 109
+159 120
+161 94
+162 37
+163 88
+164 98
+164 132
+165 108
+166 38
+168 53
+170 15
+170 135
+171 47
+173 31
+177 24
+177 104
+177 113
+179 74
+179 109
+181 42
+182 15
+182 65
+186 30
+189 144
+189 177
+190 2
+191 48
+191 109
+192 52
+192 123
+193 108
+193 147
+195 73
+196 38
+196 106
+198 105
+198 158
+199 16
+199 132
+199 168
+202 174
+203 160
+204 83
+204 100
+205 49
+205 127
+205 147
+211 174
+212 93
+212 108
+212 173
+213 66
+213 117
+214 21
+216 165
+219 44
+219 56
+219 70
+219 182
+220 94
+220 188
+223 160
+224 216
+225 20
+225 128
+230 33
+230 61
+231 96
+232 114
+233 175
+235 80
+236 84
+237 12
+237 25
+237 33
+237 133
+237 141
+239 122
+240 143
+244 28
+244 133
+244 210
+246 204
+247 40
+248 172
+249 5
+250 23
+250 89
+251 227
+254 166
+254 247
+255 186
+257 202
+257 256
+260 103
+261 220
+265 26
+265 115
+266 18
+267 144
+270 61
+271 29
+271 77
+271 94
+271 108
+273 139
+275 134
+275 161
+275 163
+276 101
+276 270
+278 206
+279 105
+279 115
+281 129
+282 64
+282 132
+283 202
+284 254
+287 118
+287 237
+289 131
+290 154
+290 268
+292 73
+292 234
+293 207
+294 215
+295 38
+295 133
+295 161
+297 41
+297 46
+298 39
+299 152
+300 34
+300 200
+300 272
+301 126
+301 243
+301 263
+302 217
+303 72
+303 147
+303 267
+305 56
+305 206
+306 22
+306 79
+306 275
+307 287
+307 302
+308 199
+309 154
+310 74
+311 168
+312 144
+313 202
+313 246
+314 129
+315 59
+315 79
+316 187
+318 136
+319 305
+322 128
+323 26
+323 95
+324 9
+324 51
+327 198
+327 204
+329 70
+329 287
+330 28
+330 64
+330 83
+331 88
+331 172
+334 76
+334 296
+335 141
+335 204
+335 278
+336 1
+336 297
+338 257
+339 71
+339 178
+339 241
+339 308
+342 15
+342 254
+344 263
+345 8
+345 106
+348 11
+348 329
+349 221
+350 110
+351 88
+351 133
+351 259
+352 4
+352 7
+356 319
+356 352
+357 232
+357 255
+358 111
+358 225
+358 317
+359 57
+359 69
+359 191
+360 121
+360 271
+360 334
+361 155
+362 96
+362 207
+363 45
+363 65
+363 290
+364 0
+365 121
+365 193
+365 288
+366 35
+367 54
+367 170
+367 224
+369 109
+370 214
+371 23
+372 60
+372 122
+372 208
+372 314
+373 55
+373 198
+374 360
+375 73
+375 315
+377 365
+378 264
+378 340
+379 219
+379 314
+380 17
+380 252
+381 106
+382 41
+382 92
+382 167
+382 325
+383 229
+384 99
+384 156
+384 257
+388 168
+389 98
+389 303
+390 308
+391 301
+395 127
+395 172
+396 27
+399 43
+399 44
+399 150
+400 28
+401 204
+402 130
+402 264
+402 308
+403 95
+403 247
+403 367
+407 321
+408 3
+408 320
+408 371
+408 385
+409 15
+409 59
+409 172
+410 214
+410 323
+410 345
+410 407
+411 64
+412 303
+413 147
+413 166
+414 253
+414 272
+414 387
+415 125
+415 170
+415 238
+415 261
+416 7
+416 270
+417 362
+417 373
+418 1
+418 163
+418 417
+419 24
+419 347
+420 106
+420 152
+421 248
+421 305
+422 153
+423 112
+424 51
+424 147
+424 240
+425 158
+425 276
+425 396
+427 388
+428 198
+428 239
+428 297
+428 377
+429 12
+429 25
+429 366
+430 14
+430 207
+431 140
+432 113
+432 212
+432 356
+432 388
+433 49
+433 170
+433 283
+435 278
+435 286
+437 113
+437 121
+437 250
+439 81
+439 93
+439 198
+439 307
+442 304
+442 414
+443 135
+444 311
+445 17
+445 371
+445 389
+446 58
+446 103
+446 320
+447 282
+447 304
+447 333
+447 376
+448 282
+449 442
+450 151
+450 185
+450 309
+451 22
+451 271
+452 137
+452 165
+452 432
+453 209
+453 315
+454 289
+455 129
+455 325
+456 373
+456 393
+457 130
+457 145
+458 24
+458 29
+458 58
+460 253
+460 294
+460 452
+462 68
+462 189
+462 206
+462 419
+464 16
+464 457
+465 249
+465 253
+465 377
+466 325
+467 203
+468 30
+468 459
+468 465
+469 18
+469 82
+469 131
+469 160
+469 370
+470 367
+470 406
+471 69
+471 163
+472 6
+472 273
+473 121
+474 225
+474 322
+475 105
+475 254
+477 174
+477 233
+477 348
+477 391
+477 448
+479 308
+479 447
+480 199
+480 422
+480 463
+481 169
+481 221
+483 301
+483 430
+484 233
+484 322
+484 399
+484 438
+485 364
+485 477
+486 0
+487 258
+488 1
+488 44
+488 243
+488 384
+488 466
+489 105
+489 131
+489 262
+489 405
+489 466
+490 90
+491 77
+492 155
+493 184
+494 37
+494 125
+494 206
+494 217
+494 256
+495 61
+495 149
+495 219
+497 190
+498 3
+498 294
+498 310
+498 393
+499 494
+500 64
+500 284
+500 293
+501 106
+501 200
+501 359
+501 462
+502 111
+502 122
+502 137
+502 140
+502 338
+503 26
+503 236
+503 415
+503 453
+503 472
+504 12
+504 268
+504 486
+505 164
+505 244
+506 30
+506 209
+506 415
+507 197
+507 470
+509 59
+510 9
+512 112
+513 187
+515 343
+516 28
+516 153
+516 425
+517 141
+517 305
+517 379
+517 498
+518 1
+518 14
+518 92
+518 247
+518 465
+519 36
+519 379
+519 411
+520 449
+521 32
+522 80
+522 434
+522 459
+523 12
+523 28
+523 194
+523 249
+523 463
+523 475
+523 500
+524 149
+524 173
+524 261
+525 34
+526 79
+526 485
+527 147
+527 381
+527 428
+528 68
+528 227
+528 276
+529 185
+529 234
+529 282
+530 153
+530 208
+530 484
+531 42
+531 201
+531 381
+532 201
+533 16
+533 171
+533 394
+534 39
+534 257
+535 33
+535 111
+535 126
+535 463
+536 89
+536 98
+536 270
+536 527
+538 521
+539 355
+539 475
+540 266
+540 288
+541 38
+541 124
+541 149
+542 259
+543 212
+544 242
+545 23
+545 81
+545 85
+545 196
+545 233
+545 377
+546 47
+546 353
+547 17
+547 290
+548 185
+548 383
+548 547
+549 85
+549 91
+550 128
+550 173
+551 26
+551 199
+552 275
+552 306
+552 411
+552 490
+552 526
+554 345
+555 52
+555 238
+555 494
+556 28
+557 154
+557 156
+557 201
+557 227
+557 540
+558 178
+559 164
+559 225
+559 459
+559 525
+560 307
+561 31
+561 394
+562 86
+562 147
+562 386
+563 261
+563 288
+564 242
+564 513
+564 543
+565 8
+565 384
+567 66
+567 325
+568 90
+568 189
+569 149
+569 412
+569 421
+570 232
+570 236
+571 51
+571 202
+571 529
+573 252
+574 45
+574 145
+574 175
+575 19
+575 276
+575 336
+576 462
+576 496
+576 531
+576 535
+577 117
+577 125
+577 285
+579 37
+579 53
+579 233
+580 193
+580 210
+581 154
+581 229
+581 296
+582 333
+582 528
+583 296
+584 118
+584 183
+585 266
+585 336
+585 458
+586 102
+586 387
+587 60
+587 195
+587 455
+587 461
+587 535
+587 583
+588 115
+588 296
+589 48
+589 366
+589 509
+589 521
+590 10
+590 206
+590 354
+591 52
+591 400
+592 295
+592 327
+592 439
+593 55
+593 257
+594 93
+594 232
+594 235
+594 334
+594 542
+594 564
+595 2
+595 24
+595 30
+595 104
+596 400
+596 587
+597 409
+597 507
+597 512
+598 181
+598 203
+598 334
+598 423
+599 15
+599 156
+599 328
+599 512
+600 443
+601 277
+601 587
+602 415
+602 495
+603 14
+603 78
+603 357
+603 507
+604 84
+604 114
+604 198
+605 110
+605 180
+605 247
+605 512
+606 88
+606 324
+607 87
+608 18
+608 277
+608 528
+609 33
+609 467
+610 91
+612 128
+612 133
+612 385
+613 423
+614 206
+614 264
+614 361
+614 418
+615 60
+615 174
+616 318
+616 514
+616 562
+617 254
+617 401
+620 109
+620 168
+620 231
+620 304
+620 343
+620 385
+620 407
+620 436
+620 476
+621 69
+622 27
+622 498
+622 500
+622 610
+623 189
+623 386
+624 311
+624 496
+625 415
+625 455
+627 458
+627 518
+628 436
+628 503
+629 10
+629 71
+630 169
+631 217
+631 316
+631 414
+631 418
+631 445
+632 355
+633 38
+633 90
+633 282
+633 342
+633 395
+633 539
+634 408
+634 520
+635 8
+635 66
+636 359
+637 507
+637 544
+637 555
+637 605
+638 0
+638 123
+639 590
+640 215
+640 217
+640 238
+640 523
+641 20
+641 80
+641 599
+641 638
+642 138
+642 526
+643 83
+643 274
+643 390
+643 449
+643 544
+643 603
+644 275
+645 322
+646 131
+647 17
+647 88
+647 120
+647 193
+647 283
+647 453
+647 459
+648 481
+649 12
+649 40
+649 188
+650 427
+651 443
+652 241
+652 463
+652 530
+652 649
+653 517
+654 85
+654 294
+654 354
+654 420
+656 3
+657 350
+658 114
+658 267
+659 413
+660 51
+660 227
+660 476
+661 200
+661 262
+661 322
+661 328
+662 216
+662 278
+662 544
+662 578
+664 73
+664 98
+664 195
+664 259
+664 383
+664 525
+665 462
+666 61
+666 151
+666 394
+667 7
+667 269
+667 281
+667 501
+667 571
+667 607
+668 367
+668 606
+669 3
+669 234
+669 389
+669 454
+670 417
+670 605
+671 570
+672 79
+672 260
+673 12
+673 480
+673 522
+673 560
+674 0
+674 64
+674 142
+675 239
+675 424
+676 19
+676 157
+676 600
+676 603
+677 106
+677 358
+677 614
+678 49
+678 79
+678 212
+678 510
+678 608
+678 661
+679 17
+679 195
+679 270
+679 615
+680 244
+680 442
+680 447
+681 284
+681 370
+681 400
+682 304
+683 279
+683 633
+683 660
+684 132
+684 491
+685 320
+685 490
+685 509
+685 642
+686 192
+686 397
+687 491
+687 522
+688 214
+688 412
+688 554
+689 476
+690 330
+690 481
+691 435
+691 647
+692 37
+692 343
+692 410
+693 86
+693 233
+693 432
+695 21
+695 363
+695 405
+695 459
+695 653
+696 107
+696 114
+696 457
+696 530
+697 102
+697 150
+697 514
+698 286
+699 31
+699 74
+699 78
+699 442
+700 47
+700 234
+700 339
+700 469
+700 507
+700 514
+700 571
+701 337
+701 340
+701 375
+701 576
+701 670
+702 158
+702 687
+703 98
+703 225
+703 280
+703 438
+704 122
+704 239
+704 522
+705 140
+705 353
+705 363
+706 106
+706 150
+706 389
+706 494
+707 163
+707 226
+707 536
+707 586
+707 702
+708 0
+708 205
+708 358
+708 599
+708 683
+709 67
+709 162
+709 434
+709 563
+709 604
+709 611
+710 1
+710 169
+710 315
+711 111
+711 158
+712 487
+713 252
+713 430
+714 650
+714 688
+716 87
+716 114
+716 445
+717 34
+717 494
+718 83
+719 65
+719 69
+719 470
+719 694
+720 202
+720 392
+720 523
+721 64
+721 85
+721 101
+721 241
+722 23
+722 129
+722 170
+723 53
+723 377
+723 583
+723 619
+723 620
+723 692
+724 38
+724 373
+724 445
+725 41
+725 55
+725 310
+725 346
+726 46
+726 243
+726 388
+726 573
+726 627
+726 659
+727 101
+727 120
+727 205
+727 442
+727 593
+728 46
+729 128
+729 316
+729 537
+729 658
+729 666
+729 707
+730 90
+730 252
+730 487
+730 553
+730 560
+730 725
+731 342
+731 374
+732 135
+732 508
+732 702
+733 84
+733 169
+733 270
+733 531
+734 32
+734 185
+734 608
+734 613
+735 31
+735 116
+735 361
+735 672
+736 58
+736 108
+736 535
+737 280
+737 491
+738 213
+738 273
+738 525
+739 453
+740 236
+740 669
+741 11
+741 118
+741 185
+742 219
+742 291
+742 310
+743 201
+743 213
+743 272
+743 385
+743 419
+743 679
+744 442
+744 449
+745 4
+745 118
+745 264
+745 302
+745 391
+745 623
+746 410
+746 489
+747 262
+747 300
+747 320
+748 30
+748 271
+749 76
+749 230
+750 188
+750 287
+750 387
+752 159
+752 187
+752 225
+752 632
+753 462
+754 45
+754 396
+754 404
+754 428
+755 279
+755 337
+755 378
+755 494
+755 605
+755 678
+757 338
+757 510
+757 705
+758 16
+758 23
+758 132
+759 267
+759 385
+759 471
+760 13
+760 201
+760 559
+760 690
+760 714
+760 720
+761 150
+762 108
+762 449
+762 490
+762 527
+763 357
+763 690
+763 694
+764 83
+764 234
+764 310
+764 556
+764 697
+765 83
+765 302
+765 370
+766 443
+767 501
+767 588
+768 612
+769 475
+769 725
+770 429
+771 35
+771 353
+771 370
+771 524
+771 557
+771 738
+772 95
+772 173
+772 424
+772 703
+773 251
+773 307
+773 344
+774 37
+774 739
+775 654
+776 91
+776 126
+777 42
+777 241
+777 538
+777 607
+777 687
+777 719
+778 615
+779 123
+779 585
+779 658
+779 749
+780 136
+780 484
+780 579
+781 79
+781 294
+781 670
+781 730
+781 764
+782 353
+783 278
+783 420
+784 443
+784 690
+785 111
+785 204
+785 421
+786 125
+786 231
+786 295
+786 608
+786 716
+787 6
+787 292
+787 393
+787 593
+787 761
+788 155
+788 172
+788 482
+788 563
+788 632
+789 83
+789 199
+789 353
+789 619
+791 495
+791 626
+791 768
+792 636
+792 685
+793 5
+794 386
+794 471
+795 150
+795 199
+796 515
+797 62
+797 530
+798 475
+798 722
+798 774
+799 124
+799 322
+799 512
+799 599
+800 481
+801 113
+801 356
+801 385
+801 465
+801 689
+802 246
+802 766
+803 403
+803 494
+804 40
+804 719
+805 123
+805 608
+806 92
+806 563
+806 576
+806 695
+807 35
+807 153
+807 244
+807 489
+808 374
+808 377
+809 135
+809 176
+809 339
+809 741
+810 92
+810 229
+810 279
+811 72
+811 268
+812 521
+813 286
+814 95
+815 17
+815 207
+815 428
+815 564
+816 105
+816 634
+817 12
+817 223
+817 317
+818 254
+818 542
+818 749
+818 813
+819 119
+819 202
+819 471
+819 695
+820 194
+820 203
+820 609
+821 136
+821 306
+822 138
+823 412
+824 130
+824 262
+824 316
+824 324
+825 29
+825 37
+825 76
+825 403
+825 481
+825 624
+826 12
+826 14
+826 250
+826 501
+826 504
+826 739
+827 109
+827 419
+827 720
+827 732
+828 248
+828 343
+829 458
+829 550
+830 417
+830 515
+830 571
+830 727
+831 251
+831 339
+831 426
+831 793
+832 60
+832 181
+832 278
+832 468
+832 755
+833 338
+833 431
+834 533
+834 725
+835 599
+836 15
+836 145
+836 378
+836 397
+836 455
+836 751
+837 479
+838 262
+838 271
+838 393
+838 655
+838 678
+839 105
+839 525
+839 629
+840 17
+840 132
+840 292
+840 351
+840 438
+840 544
+841 127
+841 341
+841 399
+842 375
+842 524
+843 8
+843 192
+843 225
+843 298
+844 687
+845 666
+846 86
+846 87
+846 204
+846 268
+846 393
+847 176
+848 180
+848 472
+848 732
+849 68
+849 492
+849 785
+850 473
+850 718
+850 751
+851 103
+851 215
+851 450
+851 700
+851 789
+852 464
+852 573
+853 31
+854 34
+854 118
+854 167
+854 255
+854 361
+854 382
+854 688
+855 39
+855 155
+855 493
+855 632
+855 827
+856 498
+856 524
+856 533
+856 696
+857 103
+857 189
+857 199
+857 408
+857 729
+858 183
+858 332
+858 351
+858 410
+858 448
+858 741
+859 121
+859 568
+859 771
+859 784
+859 803
+860 275
+860 293
+860 427
+861 91
+861 242
+861 306
+862 681
+864 177
+864 207
+864 267
+864 309
+864 666
+864 767
+865 31
+865 477
+866 13
+866 103
+866 422
+866 445
+867 127
+867 238
+867 359
+867 434
+867 767
+867 803
+868 41
+868 408
+868 548
+868 655
+869 670
+870 253
+870 460
+870 503
+871 1
+871 227
+871 245
+871 312
+871 348
+871 624
+872 14
+872 187
+872 201
+872 754
+873 267
+874 18
+874 188
+874 470
+875 445
+875 541
+875 798
+876 543
+877 0
+877 231
+877 282
+877 567
+878 39
+878 412
+879 502
+879 830
+880 120
+880 327
+880 478
+881 2
+881 427
+881 800
+881 810
+882 274
+884 146
+884 465
+884 683
+884 722
+884 789
+885 371
+885 576
+885 744
+886 583
+886 600
+886 692
+886 771
+887 183
+887 666
+887 869
+888 207
+889 395
+889 766
+890 167
+890 259
+890 726
+890 745
+890 856
+891 65
+891 389
+891 708
+891 864
+891 884
+892 71
+892 132
+892 157
+893 52
+893 217
+893 601
+894 583
+894 601
+895 659
+895 720
+895 800
+896 178
+896 306
+896 559
+897 286
+897 289
+897 716
+898 837
+898 890
+899 312
+899 403
+900 100
+900 181
+900 445
+900 511
+901 64
+901 72
+901 177
+901 229
+901 565
+901 751
+902 252
+902 478
+903 254
+903 617
+903 695
+903 713
+903 892
+904 277
+904 748
+905 301
+905 427
+905 615
+906 86
+906 89
+906 159
+906 242
+906 411
+906 594
+907 42
+907 523
+907 785
+908 128
+909 246
+909 696
+909 908
+910 29
+910 396
+910 765
+911 133
+912 481
+912 675
+912 840
+912 847
+913 282
+913 388
+913 518
+913 815
+913 905
+914 134
+914 267
+914 410
+914 415
+914 684
+914 792
+915 45
+915 141
+915 533
+916 454
+916 789
+918 5
+918 24
+918 253
+918 519
+918 625
+919 326
+919 630
+919 734
+920 519
+920 543
+921 155
+921 266
+921 270
+921 447
+922 230
+922 359
+922 537
+922 696
+922 768
+923 68
+923 236
+923 530
+923 695
+924 107
+924 829
+924 864
+924 891
+925 296
+925 797
+926 158
+926 823
+927 276
+927 819
+928 214
+928 316
+928 609
+929 10
+929 209
+929 308
+929 406
+929 789
+929 807
+930 380
+930 533
+931 91
+931 204
+931 350
+931 397
+931 494
+931 702
+931 852
+932 261
+932 332
+932 380
+932 429
+932 623
+932 788
+933 400
+933 528
+933 901
+934 4
+934 70
+934 191
+934 199
+934 207
+934 254
+934 479
+934 672
+934 720
+934 893
+935 47
+935 150
+935 271
+935 342
+935 716
+936 270
+936 364
+936 436
+936 690
+936 860
+936 888
+937 461
+937 496
+938 418
+938 622
+938 858
+938 930
+939 232
+939 453
+939 465
+939 836
+940 18
+940 140
+940 713
+940 782
+941 312
+941 503
+941 647
+941 722
+942 701
+943 423
+943 642
+943 855
+944 444
+945 555
+945 577
+945 581
+945 841
+946 44
+946 731
+946 820
+947 107
+947 150
+947 749
+947 798
+948 156
+948 521
+948 544
+948 703
+949 55
+949 353
+949 360
+949 467
+949 552
+949 909
+950 69
+950 204
+950 251
+950 489
+950 777
+950 920
+951 382
+951 412
+951 935
+952 355
+952 490
+952 537
+952 588
+952 921
+953 124
+953 354
+953 372
+953 449
+953 736
+953 794
+954 49
+954 350
+955 527
+956 244
+956 652
+956 782
+957 140
+957 262
+957 396
+957 494
+957 709
+958 618
+958 655
+958 666
+958 707
+959 98
+959 157
+959 321
+959 718
+960 158
+960 456
+960 462
+960 552
+960 674
+960 892
+961 286
+962 21
+962 25
+962 93
+962 335
+962 844
+962 864
+962 946
+963 18
+963 102
+964 2
+964 359
+964 427
+964 612
+964 719
+965 300
+965 338
+965 473
+965 606
+966 226
+966 466
+967 122
+967 251
+967 256
+967 710
+968 84
+968 104
+968 333
+968 463
+969 26
+969 358
+970 57
+970 314
+970 491
+970 610
+971 97
+971 644
+971 903
+971 925
+972 263
+972 374
+972 585
+973 180
+973 419
+973 826
+973 922
+974 32
+974 199
+974 308
+974 369
+974 465
+974 543
+974 600
+974 952
+975 16
+975 158
+975 164
+975 612
+975 700
+975 888
+976 216
+976 818
+977 92
+977 839
+977 930
+978 141
+979 488
+979 504
+979 962
+980 505
+980 765
+980 815
+980 892
+981 48
+981 228
+981 251
+982 460
+982 846
+982 869
+983 142
+983 269
+983 394
+983 406
+983 669
+984 775
+985 60
+985 443
+986 65
+986 262
+986 677
+987 327
+987 361
+987 462
+987 578
+987 739
+988 670
+988 671
+989 932
+990 930
+991 40
+991 288
+992 120
+992 152
+992 266
+992 880
+992 942
+993 811
+993 975
+994 87
+994 181
+994 194
+994 291
+994 440
+994 578
+994 641
+994 790
+995 97
+995 161
+995 186
+995 275
+995 373
+995 502
+995 621
+995 880
+996 163
+996 236
+996 656
+996 810
+997 391
+998 31
+998 700
+998 735
+998 987
+999 719
diff --git a/examples/er_1000_5000.net b/examples/er_1000_5000.net
new file mode 100644
index 0000000..0de9e67
--- /dev/null
+++ b/examples/er_1000_5000.net
@@ -0,0 +1,5000 @@
+9 2
+12 10
+17 12
+21 15
+23 21
+25 22
+30 5
+31 21
+32 4
+33 4
+34 16
+35 25
+35 30
+37 4
+39 27
+42 37
+47 45
+49 17
+49 23
+50 36
+54 38
+60 14
+66 23
+68 40
+68 58
+69 44
+71 19
+71 64
+71 67
+73 10
+76 7
+79 15
+81 31
+81 37
+84 46
+86 5
+86 75
+91 6
+91 17
+92 0
+92 77
+93 42
+93 67
+100 58
+100 59
+102 87
+103 49
+105 26
+106 51
+108 55
+108 86
+111 10
+111 16
+113 22
+114 25
+114 87
+118 12
+119 110
+120 55
+121 19
+121 47
+121 76
+122 27
+122 31
+124 13
+125 65
+125 77
+126 93
+128 38
+128 54
+130 42
+130 50
+130 118
+133 29
+133 77
+133 103
+135 46
+137 36
+137 112
+138 5
+138 34
+138 105
+139 36
+139 92
+141 9
+143 64
+143 112
+143 130
+145 24
+145 39
+145 60
+145 115
+146 38
+146 40
+147 37
+147 144
+148 41
+149 52
+149 77
+150 16
+150 138
+151 54
+152 127
+153 40
+153 78
+154 24
+155 22
+155 27
+155 28
+155 44
+155 91
+156 71
+158 67
+158 74
+159 19
+159 27
+159 71
+159 149
+160 146
+161 122
+162 36
+162 66
+162 88
+163 122
+164 84
+164 107
+167 64
+167 90
+168 46
+168 100
+169 145
+171 105
+172 54
+173 10
+173 92
+174 131
+177 136
+177 156
+179 129
+181 73
+183 167
+184 23
+184 180
+185 146
+186 167
+187 91
+187 96
+188 4
+188 7
+188 42
+189 40
+189 65
+191 67
+191 125
+193 14
+194 38
+195 93
+195 140
+196 143
+197 170
+197 187
+198 77
+199 4
+199 14
+199 57
+199 167
+200 37
+200 112
+200 114
+200 186
+202 149
+203 184
+204 89
+204 145
+204 149
+205 30
+206 39
+206 51
+206 139
+207 35
+207 132
+208 22
+208 98
+209 48
+209 151
+210 118
+211 41
+211 145
+211 184
+212 5
+212 95
+212 171
+213 146
+213 167
+214 120
+215 39
+215 104
+215 105
+215 138
+215 161
+216 76
+216 101
+217 147
+218 62
+220 157
+220 187
+221 38
+221 61
+223 62
+223 133
+224 5
+224 28
+224 144
+224 148
+224 177
+224 199
+225 43
+225 105
+225 110
+225 114
+225 118
+226 65
+227 151
+228 5
+228 82
+228 141
+229 37
+229 46
+229 76
+229 178
+229 189
+230 173
+230 190
+231 21
+231 83
+231 91
+231 122
+231 166
+232 13
+232 29
+232 220
+233 74
+233 98
+234 25
+234 36
+234 73
+234 140
+236 56
+237 120
+238 142
+239 16
+239 89
+239 195
+240 0
+240 113
+240 183
+240 233
+241 81
+241 135
+242 36
+242 72
+242 233
+243 118
+244 97
+244 226
+244 227
+245 47
+245 161
+245 162
+246 35
+247 11
+247 23
+247 60
+247 69
+247 193
+247 202
+247 243
+249 77
+249 124
+249 165
+249 179
+249 185
+249 198
+250 6
+250 89
+250 112
+250 137
+250 212
+250 232
+251 22
+251 90
+252 115
+252 251
+253 206
+254 27
+254 41
+254 153
+255 121
+256 60
+256 198
+256 209
+258 12
+258 18
+259 5
+259 203
+260 213
+260 253
+261 94
+261 132
+261 151
+261 158
+262 20
+262 195
+264 125
+265 185
+265 264
+266 163
+267 9
+267 80
+267 102
+267 112
+267 120
+267 143
+268 110
+268 152
+268 192
+269 115
+269 186
+269 200
+270 18
+270 39
+270 119
+271 61
+272 14
+272 156
+272 264
+273 46
+273 93
+273 226
+274 43
+274 246
+275 5
+275 8
+275 80
+275 241
+276 5
+276 74
+277 99
+277 137
+277 158
+277 218
+277 219
+277 262
+278 35
+278 161
+278 211
+278 227
+279 84
+279 160
+279 183
+280 112
+281 22
+282 79
+282 233
+283 44
+283 62
+283 143
+284 3
+284 6
+284 54
+284 126
+284 182
+284 272
+285 167
+285 221
+286 68
+286 275
+287 151
+287 208
+287 212
+287 238
+287 273
+288 59
+288 83
+288 279
+289 50
+289 250
+290 67
+290 114
+290 150
+290 173
+290 256
+291 56
+291 260
+292 180
+292 278
+293 152
+293 155
+293 182
+293 285
+294 6
+294 7
+294 59
+294 69
+294 86
+294 123
+294 219
+294 237
+296 75
+296 90
+296 108
+296 145
+296 217
+296 294
+297 65
+298 97
+298 167
+299 19
+299 60
+299 128
+299 142
+299 195
+300 6
+300 12
+300 220
+301 4
+301 235
+303 2
+303 48
+303 76
+303 159
+303 197
+303 213
+303 266
+304 204
+304 216
+304 281
+305 56
+305 75
+305 111
+305 230
+306 0
+306 45
+306 112
+306 144
+306 165
+307 24
+307 111
+307 203
+307 278
+308 138
+308 163
+308 303
+309 27
+310 31
+310 104
+310 150
+310 235
+311 2
+312 91
+313 127
+314 143
+314 185
+314 205
+314 244
+315 67
+315 103
+315 138
+315 206
+315 267
+316 31
+316 164
+316 269
+317 213
+317 261
+318 98
+318 112
+318 183
+318 236
+319 169
+320 126
+320 205
+321 202
+321 221
+321 245
+321 308
+322 49
+322 84
+322 226
+322 304
+322 311
+323 261
+323 291
+324 183
+324 194
+325 48
+325 99
+325 181
+325 243
+325 272
+326 190
+326 196
+326 320
+327 76
+327 253
+327 261
+327 309
+327 324
+328 99
+328 110
+328 142
+328 212
+329 73
+329 234
+330 54
+330 55
+330 58
+330 204
+330 258
+330 326
+331 206
+331 219
+332 49
+333 38
+333 113
+333 136
+333 169
+333 253
+333 270
+333 321
+334 289
+335 67
+335 172
+335 307
+336 9
+336 176
+337 45
+337 239
+337 258
+337 273
+337 292
+338 88
+338 118
+338 301
+338 304
+338 337
+339 245
+339 268
+339 284
+340 148
+340 310
+341 6
+341 100
+341 120
+341 168
+341 198
+341 251
+341 278
+341 301
+341 321
+342 82
+342 94
+342 112
+342 145
+342 185
+342 189
+343 39
+343 57
+343 250
+344 63
+344 145
+345 22
+345 227
+345 237
+345 304
+345 339
+346 85
+347 213
+347 270
+348 27
+348 122
+349 63
+349 81
+349 211
+349 212
+349 345
+351 49
+351 136
+351 184
+352 156
+352 194
+352 214
+352 279
+353 219
+353 291
+354 89
+354 165
+354 300
+355 201
+355 228
+355 279
+355 293
+355 307
+356 54
+356 65
+356 84
+356 97
+356 157
+357 242
+357 352
+358 111
+358 117
+359 12
+359 152
+359 284
+359 323
+360 20
+360 73
+360 110
+360 170
+360 185
+361 109
+361 226
+361 340
+362 48
+362 71
+362 84
+362 323
+363 28
+363 89
+363 99
+363 114
+363 200
+364 97
+364 177
+365 11
+365 158
+365 169
+365 331
+366 63
+366 189
+366 302
+366 324
+367 95
+368 108
+368 268
+368 309
+369 106
+369 243
+369 249
+369 340
+370 44
+370 150
+371 20
+372 6
+372 98
+372 101
+372 118
+372 164
+372 191
+372 197
+372 297
+372 348
+373 47
+373 224
+373 293
+373 306
+374 130
+374 131
+374 211
+374 280
+376 4
+376 25
+376 146
+376 186
+376 234
+376 262
+376 370
+377 21
+377 63
+377 130
+377 171
+377 174
+377 288
+378 112
+378 241
+379 42
+379 133
+379 162
+379 164
+379 203
+379 317
+379 333
+380 61
+380 69
+380 83
+380 164
+380 179
+380 197
+380 314
+381 8
+381 360
+382 365
+383 32
+383 41
+383 131
+383 213
+383 282
+384 94
+384 131
+384 179
+385 143
+385 146
+385 170
+385 179
+385 205
+385 359
+386 103
+386 183
+386 345
+387 30
+387 71
+388 150
+388 161
+389 14
+389 129
+389 335
+390 48
+390 61
+390 172
+390 183
+390 358
+390 372
+391 22
+391 194
+391 307
+391 310
+391 328
+392 228
+392 248
+392 351
+393 11
+393 145
+394 108
+394 375
+395 122
+395 139
+395 150
+395 327
+395 375
+396 34
+396 196
+396 260
+396 276
+396 305
+397 52
+397 74
+397 117
+397 127
+397 199
+397 283
+397 319
+397 347
+398 42
+398 180
+398 187
+398 311
+398 327
+399 61
+399 110
+399 160
+399 337
+399 356
+400 3
+400 13
+400 322
+400 360
+400 388
+401 191
+402 31
+402 60
+402 64
+402 140
+402 173
+402 182
+402 188
+402 280
+402 305
+402 318
+403 84
+403 358
+404 212
+404 253
+404 267
+404 285
+405 82
+405 111
+405 118
+405 132
+405 181
+406 21
+406 65
+406 155
+406 191
+406 230
+406 296
+406 297
+406 310
+407 18
+407 280
+407 337
+408 90
+408 231
+408 381
+409 361
+410 175
+411 217
+411 340
+412 25
+412 168
+412 253
+413 71
+413 146
+413 181
+413 225
+413 347
+413 351
+414 116
+414 272
+414 280
+415 149
+415 266
+415 295
+415 402
+416 155
+416 358
+417 18
+417 216
+417 384
+418 5
+418 79
+418 119
+418 249
+419 42
+419 112
+419 315
+420 7
+420 35
+420 241
+420 364
+421 60
+421 114
+421 142
+421 260
+421 269
+421 331
+421 361
+421 375
+421 393
+422 92
+422 132
+422 285
+422 335
+422 344
+422 356
+423 184
+423 279
+423 354
+423 389
+424 40
+424 180
+424 291
+424 422
+425 151
+425 185
+425 238
+425 265
+426 127
+426 342
+427 6
+427 321
+427 338
+427 346
+428 32
+428 162
+428 415
+428 426
+429 130
+429 138
+429 196
+429 321
+429 324
+430 57
+430 123
+430 277
+430 346
+431 47
+431 373
+431 407
+432 123
+432 135
+432 186
+432 348
+433 42
+433 93
+433 129
+433 320
+434 408
+434 433
+435 68
+435 237
+435 247
+436 44
+436 132
+436 187
+436 214
+436 243
+436 340
+437 25
+437 98
+437 423
+438 224
+438 263
+438 291
+438 414
+439 199
+439 228
+439 305
+439 328
+439 384
+439 433
+440 22
+440 120
+440 131
+440 207
+440 245
+440 349
+441 57
+441 65
+441 179
+441 218
+441 319
+441 321
+441 371
+442 151
+442 373
+442 382
+442 429
+443 42
+443 115
+443 151
+443 208
+443 339
+444 115
+444 283
+445 21
+445 255
+445 348
+445 360
+445 442
+446 120
+446 294
+446 413
+447 47
+447 164
+447 200
+447 211
+447 369
+448 365
+449 202
+449 249
+449 284
+450 32
+450 57
+450 181
+450 375
+451 38
+451 49
+451 76
+451 159
+451 217
+451 220
+451 279
+451 306
+451 402
+452 34
+452 155
+452 234
+453 87
+453 134
+453 150
+453 355
+454 30
+454 89
+454 200
+454 372
+454 384
+454 448
+455 210
+455 391
+456 76
+456 349
+457 28
+457 66
+457 96
+457 374
+457 386
+458 26
+458 151
+458 177
+458 260
+458 328
+458 347
+458 369
+458 370
+459 54
+459 174
+459 176
+459 181
+459 237
+459 326
+459 381
+459 445
+460 77
+460 95
+460 150
+460 171
+460 297
+460 452
+461 41
+461 218
+462 47
+462 53
+462 195
+463 85
+463 173
+463 296
+463 374
+463 376
+463 377
+464 51
+464 120
+464 210
+464 212
+464 314
+464 434
+465 259
+465 414
+466 104
+466 238
+467 52
+468 81
+468 114
+468 254
+468 415
+469 34
+469 70
+469 285
+469 378
+470 39
+470 78
+470 86
+470 101
+470 102
+471 137
+471 266
+471 367
+471 393
+472 174
+472 280
+472 377
+473 10
+473 44
+473 143
+474 1
+474 121
+474 210
+474 268
+474 367
+475 384
+476 59
+476 82
+476 222
+476 267
+476 285
+477 196
+477 387
+478 57
+478 124
+478 302
+478 363
+478 414
+479 139
+479 170
+479 196
+479 238
+479 380
+479 425
+480 19
+480 192
+480 320
+480 339
+480 436
+481 105
+481 369
+481 459
+482 18
+482 49
+482 55
+482 81
+482 150
+482 174
+482 176
+482 274
+482 453
+483 52
+483 55
+483 145
+483 175
+483 210
+483 292
+483 397
+483 424
+484 124
+484 173
+484 372
+484 380
+485 276
+486 42
+486 79
+486 206
+487 60
+487 96
+487 111
+487 114
+487 181
+487 466
+487 475
+488 4
+488 423
+489 49
+489 58
+489 211
+489 215
+489 217
+490 100
+490 132
+490 353
+490 409
+490 488
+491 72
+491 82
+491 91
+491 198
+492 198
+492 222
+492 255
+492 269
+492 470
+492 480
+493 159
+493 444
+494 85
+494 151
+494 196
+494 222
+494 377
+494 390
+494 394
+495 36
+495 51
+495 343
+495 425
+495 463
+495 468
+496 5
+496 75
+496 141
+496 161
+496 369
+496 491
+497 9
+497 236
+497 358
+497 440
+497 462
+498 100
+498 252
+498 342
+498 458
+498 468
+498 472
+498 494
+499 42
+499 74
+500 167
+500 204
+500 475
+501 184
+501 333
+501 365
+502 21
+502 186
+502 274
+502 303
+502 426
+503 33
+503 106
+503 179
+503 328
+503 384
+503 397
+503 468
+504 55
+504 183
+504 282
+504 313
+504 340
+505 37
+505 130
+505 389
+505 390
+506 28
+506 215
+506 245
+506 322
+506 442
+507 83
+507 139
+507 215
+507 252
+507 291
+507 374
+508 79
+508 152
+508 227
+508 241
+508 243
+508 284
+508 353
+508 411
+508 476
+509 117
+509 306
+509 408
+509 449
+509 472
+510 43
+510 162
+510 231
+510 381
+510 442
+511 18
+511 186
+511 246
+511 379
+511 412
+512 125
+512 155
+512 282
+512 404
+513 107
+513 285
+513 286
+513 357
+513 374
+513 395
+513 410
+514 11
+514 447
+514 496
+514 503
+515 379
+516 43
+516 140
+516 160
+516 190
+516 244
+516 456
+517 303
+517 387
+517 403
+517 427
+518 78
+518 180
+518 264
+518 309
+518 362
+518 379
+518 417
+518 461
+519 20
+519 63
+519 171
+519 177
+519 193
+519 305
+519 343
+519 357
+519 417
+519 437
+519 468
+520 50
+520 216
+520 424
+521 86
+521 160
+521 183
+521 250
+521 255
+522 29
+522 77
+522 105
+522 109
+522 117
+522 218
+522 289
+522 457
+523 7
+523 178
+523 182
+523 377
+523 440
+523 487
+523 515
+523 516
+524 256
+524 326
+524 334
+524 444
+525 14
+525 46
+525 173
+525 210
+525 301
+525 371
+525 390
+525 411
+525 416
+525 500
+526 178
+526 291
+526 316
+526 388
+527 110
+527 163
+527 201
+527 278
+527 344
+527 364
+527 370
+527 403
+527 484
+527 502
+527 515
+528 50
+528 178
+528 216
+528 259
+528 275
+528 334
+528 461
+528 483
+528 526
+529 52
+529 175
+529 383
+529 503
+530 165
+530 303
+530 333
+530 353
+531 51
+531 71
+531 97
+531 186
+531 219
+531 289
+531 445
+532 105
+532 170
+532 345
+532 391
+532 494
+533 40
+533 253
+533 255
+533 406
+533 476
+534 0
+534 77
+534 99
+534 157
+534 192
+534 273
+534 300
+534 458
+535 16
+535 85
+535 359
+535 412
+536 87
+536 183
+536 322
+536 340
+536 429
+536 526
+536 530
+537 100
+537 158
+538 11
+538 39
+538 48
+538 79
+538 92
+538 131
+538 180
+538 234
+538 371
+538 379
+538 496
+539 111
+539 294
+539 322
+539 462
+540 68
+540 87
+540 123
+540 138
+540 150
+540 325
+540 341
+540 413
+541 28
+541 39
+541 40
+541 81
+541 182
+541 358
+541 396
+541 468
+541 536
+542 18
+542 117
+542 225
+542 536
+543 63
+543 106
+543 127
+543 168
+543 215
+543 313
+543 483
+543 499
+543 530
+543 542
+544 34
+544 131
+544 209
+544 369
+544 381
+544 416
+545 311
+545 371
+545 453
+545 491
+546 115
+546 362
+546 464
+546 529
+547 18
+547 96
+547 105
+547 459
+548 123
+548 174
+548 280
+548 342
+549 96
+549 248
+549 261
+549 364
+549 417
+550 3
+550 75
+550 109
+550 273
+550 388
+550 503
+551 70
+551 110
+551 144
+551 190
+551 433
+552 152
+552 194
+552 219
+552 334
+552 383
+552 534
+553 12
+553 21
+553 301
+553 317
+553 418
+553 425
+553 448
+553 549
+554 2
+554 74
+554 76
+554 83
+554 246
+554 359
+554 440
+554 458
+555 21
+555 39
+555 107
+555 121
+555 206
+555 250
+555 380
+555 417
+555 430
+555 487
+556 13
+556 33
+556 99
+557 43
+557 72
+557 79
+557 315
+557 422
+557 536
+557 539
+558 115
+558 149
+558 383
+558 538
+559 56
+559 83
+559 106
+559 202
+559 206
+559 314
+559 376
+559 535
+560 91
+560 128
+560 223
+560 225
+560 261
+560 511
+561 274
+561 388
+561 494
+562 69
+562 315
+562 316
+562 356
+563 50
+563 152
+563 199
+563 301
+563 532
+564 49
+564 108
+564 296
+564 311
+564 337
+564 418
+564 549
+565 46
+565 47
+565 107
+565 114
+565 383
+565 477
+566 101
+566 119
+566 175
+566 237
+566 257
+566 282
+566 373
+566 478
+566 545
+567 2
+567 48
+567 54
+567 113
+567 138
+567 162
+567 179
+567 247
+567 286
+567 329
+567 445
+567 470
+568 186
+568 207
+568 312
+568 381
+569 105
+569 159
+569 216
+569 263
+569 409
+569 533
+570 52
+570 84
+570 229
+571 122
+571 162
+571 250
+571 283
+571 347
+571 410
+572 73
+572 142
+572 261
+572 288
+572 320
+572 420
+572 466
+573 51
+573 126
+573 138
+573 312
+573 376
+573 437
+574 129
+574 133
+574 231
+574 545
+575 71
+575 105
+575 218
+575 270
+575 316
+575 412
+576 74
+576 177
+576 180
+576 311
+576 405
+577 243
+577 299
+577 322
+577 414
+578 476
+579 219
+579 323
+579 360
+579 393
+579 447
+579 576
+580 363
+580 388
+580 447
+580 459
+580 534
+580 535
+581 99
+581 473
+581 518
+581 540
+582 17
+582 200
+582 378
+582 433
+582 463
+583 142
+583 220
+583 451
+584 27
+584 273
+584 280
+584 287
+584 433
+584 438
+584 479
+584 499
+584 557
+584 576
+585 127
+585 212
+585 241
+585 306
+585 460
+586 99
+586 146
+586 304
+586 314
+586 334
+586 365
+586 451
+586 459
+586 520
+586 554
+587 78
+587 168
+587 202
+587 326
+587 394
+588 168
+588 286
+588 537
+589 253
+589 376
+589 530
+590 105
+590 208
+590 232
+590 351
+590 478
+590 503
+590 575
+591 42
+591 69
+591 155
+591 348
+591 399
+591 491
+591 580
+592 269
+592 286
+592 354
+592 467
+593 347
+593 454
+594 77
+594 532
+595 13
+595 162
+595 189
+595 258
+595 583
+596 25
+596 32
+596 39
+596 41
+596 44
+596 153
+596 262
+596 295
+596 555
+596 556
+596 579
+597 62
+597 181
+597 275
+597 342
+597 469
+597 496
+597 497
+597 569
+598 14
+598 45
+598 108
+598 154
+598 394
+598 446
+598 487
+599 133
+599 195
+599 332
+599 411
+599 436
+599 497
+600 35
+600 120
+600 142
+600 260
+600 272
+600 596
+601 278
+601 351
+601 511
+601 515
+601 531
+602 181
+602 250
+602 265
+602 397
+602 407
+602 422
+603 65
+603 226
+603 402
+603 406
+603 468
+603 486
+603 596
+603 602
+604 0
+604 170
+604 216
+604 386
+604 534
+604 602
+605 79
+605 123
+605 372
+605 512
+605 563
+606 193
+606 209
+606 310
+606 344
+607 235
+607 288
+607 316
+608 42
+608 93
+608 94
+608 368
+608 408
+608 482
+608 553
+608 556
+609 87
+609 250
+609 266
+609 320
+609 359
+609 364
+609 580
+610 214
+610 296
+610 377
+610 457
+611 82
+611 162
+611 167
+611 170
+611 198
+611 241
+611 244
+612 45
+612 193
+612 231
+612 273
+612 289
+612 309
+612 377
+612 434
+612 558
+612 603
+613 85
+613 389
+613 454
+614 29
+614 47
+614 273
+614 432
+614 538
+615 190
+615 229
+615 327
+615 374
+615 481
+616 57
+616 156
+616 254
+616 359
+616 436
+616 501
+616 502
+617 43
+617 468
+617 476
+617 505
+618 25
+618 247
+618 393
+618 421
+619 6
+619 7
+619 122
+619 462
+620 85
+620 605
+621 17
+621 148
+621 156
+621 228
+621 269
+621 527
+622 6
+622 112
+622 228
+622 237
+622 342
+622 447
+623 82
+623 208
+623 504
+623 534
+624 259
+624 288
+624 403
+624 413
+624 416
+624 437
+624 461
+624 519
+624 586
+624 622
+625 163
+625 214
+625 242
+625 334
+625 426
+625 491
+625 493
+625 538
+625 570
+626 46
+626 68
+626 372
+626 419
+626 563
+626 567
+627 103
+627 133
+627 184
+627 190
+627 388
+627 416
+627 431
+627 434
+627 478
+627 528
+627 589
+627 606
+627 623
+628 58
+628 491
+628 540
+629 90
+629 218
+629 319
+629 468
+630 37
+630 54
+630 77
+630 140
+630 154
+630 173
+630 231
+630 354
+630 517
+630 531
+631 116
+631 142
+631 303
+631 326
+631 339
+631 341
+632 20
+632 90
+632 94
+632 107
+632 138
+632 162
+632 232
+632 277
+632 343
+632 347
+632 498
+632 561
+632 602
+632 626
+633 6
+633 22
+633 85
+633 143
+633 261
+633 291
+633 571
+634 90
+634 102
+634 258
+634 271
+634 464
+634 468
+635 239
+635 323
+635 376
+635 545
+635 606
+636 55
+636 243
+636 340
+636 359
+636 465
+636 543
+636 622
+636 634
+637 46
+637 56
+637 256
+637 283
+637 305
+637 408
+637 423
+638 27
+638 229
+638 254
+638 393
+638 408
+638 493
+639 125
+639 385
+639 388
+640 9
+640 30
+640 67
+640 102
+640 337
+640 358
+640 417
+640 459
+640 477
+640 490
+641 121
+641 136
+641 232
+641 433
+641 437
+641 605
+641 617
+642 103
+642 130
+642 399
+642 476
+642 498
+642 589
+643 62
+643 248
+643 277
+643 288
+643 360
+643 523
+643 594
+643 636
+644 118
+644 124
+644 145
+644 150
+644 190
+644 243
+644 327
+644 558
+644 591
+645 10
+645 15
+645 91
+645 142
+645 164
+645 309
+645 487
+645 539
+645 640
+646 18
+646 186
+646 349
+646 353
+646 369
+646 609
+647 123
+647 176
+647 186
+647 265
+647 372
+647 441
+647 510
+647 535
+648 17
+648 135
+648 223
+648 367
+648 386
+648 410
+648 449
+648 519
+648 555
+648 570
+648 586
+648 596
+649 156
+649 383
+649 432
+649 448
+650 125
+650 234
+650 262
+650 265
+650 268
+650 298
+650 355
+650 367
+650 402
+650 474
+650 513
+650 570
+650 584
+651 267
+651 487
+651 499
+651 591
+652 12
+652 178
+652 254
+652 330
+652 367
+652 373
+652 551
+653 47
+653 120
+653 140
+653 162
+653 327
+653 350
+653 382
+653 416
+653 522
+653 542
+654 93
+654 110
+654 154
+654 204
+654 218
+654 274
+654 298
+654 348
+654 477
+654 540
+654 559
+654 589
+654 602
+654 640
+655 194
+655 240
+655 303
+655 389
+655 605
+656 10
+656 207
+656 220
+656 536
+656 589
+656 655
+657 66
+657 226
+657 268
+657 315
+657 370
+657 454
+657 503
+657 620
+657 634
+658 76
+658 113
+658 280
+658 484
+658 526
+658 652
+659 35
+659 98
+659 332
+659 343
+659 444
+659 469
+659 590
+660 28
+660 236
+660 380
+660 388
+660 391
+660 446
+661 8
+661 260
+661 479
+662 81
+662 87
+662 282
+662 366
+662 622
+663 83
+663 123
+663 183
+663 283
+663 412
+663 503
+664 103
+664 163
+664 266
+664 507
+664 530
+664 565
+665 125
+665 147
+665 254
+665 356
+665 405
+665 432
+665 507
+665 556
+665 574
+666 43
+666 164
+666 511
+667 23
+667 354
+667 420
+667 525
+667 649
+668 213
+668 261
+668 554
+669 91
+669 176
+669 241
+669 319
+669 516
+669 600
+670 93
+670 163
+670 260
+670 364
+670 407
+670 497
+671 303
+671 376
+671 435
+671 530
+671 559
+671 620
+672 102
+672 226
+672 229
+672 451
+672 580
+673 0
+673 267
+673 426
+673 427
+673 509
+673 615
+673 645
+674 378
+674 386
+674 508
+674 543
+674 570
+674 574
+674 625
+674 651
+675 220
+675 283
+675 291
+675 330
+675 397
+675 427
+675 486
+676 34
+676 44
+676 117
+676 162
+676 206
+676 224
+676 308
+676 332
+676 358
+676 387
+676 615
+677 43
+677 90
+677 113
+677 193
+677 242
+677 263
+677 322
+677 413
+677 415
+678 36
+678 115
+678 327
+678 389
+678 498
+678 515
+678 533
+678 607
+679 17
+679 28
+679 88
+679 143
+679 216
+679 316
+679 331
+679 332
+679 408
+679 641
+680 396
+680 526
+680 543
+680 636
+680 654
+681 117
+681 133
+681 198
+681 264
+681 276
+681 336
+681 471
+682 180
+682 252
+682 471
+683 166
+683 629
+684 39
+684 68
+684 103
+684 104
+684 115
+684 305
+684 313
+684 393
+684 453
+684 473
+684 515
+684 629
+685 7
+685 276
+685 435
+685 442
+685 505
+685 567
+685 630
+686 79
+686 107
+686 427
+686 457
+686 664
+687 605
+688 55
+688 70
+688 92
+688 234
+688 372
+688 387
+688 459
+688 592
+688 685
+689 37
+689 97
+689 191
+689 212
+689 543
+689 564
+689 565
+690 117
+690 125
+690 180
+690 284
+690 468
+690 536
+690 655
+691 9
+691 47
+691 190
+691 243
+691 356
+691 367
+691 554
+691 622
+691 673
+692 98
+692 100
+692 135
+692 255
+692 446
+692 612
+692 632
+692 662
+693 98
+693 257
+693 289
+693 406
+693 425
+693 452
+693 513
+694 20
+694 50
+694 284
+694 292
+694 311
+694 380
+694 561
+694 598
+695 286
+695 380
+695 395
+695 467
+695 609
+695 657
+696 36
+696 70
+696 151
+696 195
+696 490
+696 664
+697 15
+697 137
+697 196
+697 408
+697 495
+697 505
+697 641
+697 674
+698 22
+698 67
+698 156
+698 203
+698 249
+698 449
+698 461
+698 600
+699 73
+699 143
+699 424
+699 466
+700 19
+700 107
+700 300
+700 410
+700 429
+700 451
+700 572
+700 679
+701 37
+701 69
+701 107
+701 220
+701 232
+701 443
+701 497
+701 629
+701 634
+702 29
+702 167
+702 180
+702 248
+702 486
+702 503
+702 522
+702 614
+702 644
+702 649
+703 136
+703 329
+703 349
+703 423
+703 537
+703 553
+703 562
+703 595
+703 700
+704 127
+704 222
+704 285
+704 375
+704 554
+704 615
+704 620
+704 621
+704 672
+705 178
+705 227
+705 229
+705 291
+705 301
+705 404
+705 456
+705 515
+705 561
+705 651
+705 673
+705 694
+706 87
+706 152
+706 171
+706 432
+707 150
+707 213
+707 326
+707 373
+707 476
+707 528
+707 643
+708 17
+708 196
+708 427
+708 453
+708 595
+709 92
+709 207
+709 390
+709 705
+710 327
+710 690
+711 170
+711 379
+711 503
+711 541
+711 704
+712 87
+712 191
+712 197
+712 315
+712 412
+712 435
+712 571
+712 685
+713 144
+713 502
+713 589
+713 596
+714 81
+714 164
+714 189
+714 248
+714 312
+714 514
+714 616
+715 173
+715 200
+715 241
+715 417
+715 476
+715 487
+715 576
+715 656
+715 705
+716 112
+716 240
+716 396
+716 433
+716 561
+716 578
+716 593
+717 0
+717 7
+717 41
+717 101
+717 374
+717 501
+717 535
+718 18
+718 172
+718 203
+718 235
+718 293
+718 302
+718 454
+718 686
+719 246
+719 404
+719 422
+719 427
+719 473
+720 40
+720 68
+720 102
+720 153
+720 304
+720 309
+720 333
+720 355
+720 364
+720 429
+720 579
+721 40
+721 101
+721 175
+721 268
+721 494
+722 159
+722 199
+722 384
+722 420
+722 592
+722 645
+723 51
+723 58
+723 78
+723 95
+723 129
+723 407
+724 8
+724 11
+724 154
+724 242
+724 486
+724 588
+724 640
+725 12
+725 129
+725 253
+725 451
+726 245
+726 396
+726 663
+726 715
+726 719
+727 21
+727 320
+727 413
+727 608
+728 180
+728 417
+728 476
+728 517
+728 672
+729 30
+729 101
+729 116
+729 236
+729 309
+729 368
+729 392
+729 445
+729 598
+729 606
+730 63
+730 231
+730 355
+730 695
+730 723
+731 42
+731 63
+731 98
+731 234
+731 296
+731 369
+731 422
+731 554
+731 607
+731 617
+731 643
+731 688
+732 20
+732 24
+732 141
+732 151
+732 215
+732 224
+732 256
+732 296
+732 534
+733 161
+733 374
+733 608
+733 645
+734 58
+734 120
+734 148
+734 178
+734 578
+735 20
+735 92
+735 233
+735 277
+735 449
+735 542
+735 601
+735 653
+736 108
+736 209
+736 373
+736 506
+736 536
+736 562
+736 731
+737 403
+737 500
+737 530
+737 577
+737 629
+737 676
+738 50
+738 99
+738 507
+738 623
+739 86
+739 228
+739 239
+739 314
+739 330
+739 340
+739 374
+739 384
+739 401
+739 438
+739 471
+739 493
+739 536
+739 730
+740 74
+740 242
+740 378
+740 571
+741 93
+741 139
+741 315
+741 320
+741 324
+741 498
+741 627
+741 719
+742 62
+742 116
+742 147
+742 160
+742 250
+742 278
+742 317
+742 351
+742 445
+742 526
+742 703
+743 134
+743 161
+743 270
+743 312
+743 350
+743 353
+743 441
+743 717
+743 736
+744 13
+744 25
+744 89
+744 180
+744 198
+744 200
+744 218
+744 488
+744 623
+744 696
+745 142
+745 265
+745 461
+745 496
+745 676
+746 69
+746 220
+746 300
+746 472
+746 524
+746 699
+747 71
+747 79
+747 124
+747 165
+747 265
+747 366
+747 458
+747 683
+748 0
+748 352
+748 357
+748 494
+748 667
+748 668
+749 26
+749 55
+749 106
+749 129
+749 146
+749 385
+749 498
+749 688
+750 71
+750 187
+750 395
+750 458
+750 663
+750 706
+751 172
+751 215
+751 270
+751 284
+751 331
+751 423
+751 481
+751 491
+751 532
+751 617
+751 630
+751 678
+751 679
+752 26
+752 60
+752 222
+752 660
+752 744
+753 67
+753 228
+753 315
+753 342
+753 427
+753 466
+753 476
+753 570
+753 607
+753 644
+754 46
+754 84
+754 202
+754 227
+754 264
+754 337
+754 348
+754 480
+754 668
+755 16
+755 27
+755 149
+755 237
+755 240
+755 417
+755 528
+755 529
+755 595
+755 733
+756 28
+756 33
+756 192
+756 461
+756 541
+756 614
+757 5
+757 100
+757 147
+757 278
+757 359
+757 410
+757 551
+758 71
+758 392
+758 424
+758 566
+758 574
+758 598
+758 622
+758 687
+758 690
+759 275
+759 416
+759 442
+759 569
+759 599
+759 743
+760 69
+760 343
+760 346
+760 504
+760 708
+761 4
+761 81
+761 127
+761 238
+761 255
+761 259
+761 443
+761 458
+761 472
+762 171
+762 183
+762 439
+762 516
+762 541
+762 710
+762 735
+763 27
+763 73
+763 74
+763 304
+763 305
+763 380
+763 395
+763 427
+763 446
+763 510
+763 570
+763 643
+764 158
+764 171
+764 287
+764 310
+764 364
+764 373
+764 398
+764 541
+764 689
+765 91
+765 349
+765 621
+765 708
+765 744
+766 49
+766 56
+766 212
+766 339
+766 374
+766 536
+766 623
+766 703
+766 704
+767 171
+767 237
+767 262
+767 394
+767 408
+767 464
+767 496
+767 539
+767 580
+768 55
+768 302
+768 330
+768 332
+768 566
+768 694
+768 698
+769 27
+769 28
+769 123
+769 141
+769 253
+769 273
+769 617
+770 197
+770 227
+770 320
+770 326
+770 666
+770 723
+770 730
+770 766
+771 60
+771 72
+771 175
+771 222
+771 329
+771 567
+771 711
+772 19
+772 71
+772 120
+772 217
+772 224
+772 423
+772 534
+772 578
+772 635
+772 732
+772 768
+773 76
+773 207
+773 334
+773 373
+773 459
+773 659
+773 728
+774 248
+774 285
+774 318
+774 325
+774 413
+774 454
+774 457
+774 661
+774 675
+775 11
+775 53
+775 233
+775 338
+775 353
+775 414
+775 493
+775 649
+775 723
+776 3
+776 62
+776 68
+776 86
+776 205
+776 324
+776 334
+776 450
+776 455
+776 522
+776 688
+777 5
+777 163
+777 214
+777 218
+777 727
+778 618
+779 57
+779 82
+779 203
+779 204
+779 351
+779 458
+779 484
+779 647
+779 704
+780 52
+780 66
+780 156
+780 157
+780 190
+780 211
+780 369
+780 387
+780 613
+780 658
+780 750
+781 99
+781 121
+781 365
+781 494
+781 573
+781 645
+781 719
+782 75
+782 223
+782 429
+782 435
+782 466
+782 484
+782 728
+783 61
+783 217
+783 394
+783 460
+783 514
+783 524
+783 529
+783 547
+783 601
+783 677
+783 748
+784 35
+784 256
+784 274
+784 282
+784 290
+784 318
+784 464
+784 471
+784 552
+784 557
+784 586
+784 627
+784 732
+785 9
+785 27
+785 30
+785 51
+785 359
+785 556
+785 679
+786 18
+786 31
+786 34
+786 356
+786 406
+786 481
+786 677
+786 687
+787 79
+787 131
+787 162
+787 249
+787 505
+788 85
+788 109
+788 188
+788 425
+788 550
+788 619
+788 670
+789 106
+789 135
+789 460
+789 714
+789 777
+790 41
+790 93
+790 171
+790 172
+790 236
+790 627
+790 643
+790 727
+790 768
+791 124
+791 209
+791 297
+791 482
+791 515
+791 670
+791 688
+792 325
+792 535
+792 541
+793 37
+793 60
+793 140
+793 212
+793 287
+793 347
+793 382
+793 435
+793 458
+793 467
+793 682
+793 782
+794 82
+794 322
+794 333
+794 489
+794 516
+794 538
+795 79
+795 118
+795 153
+795 163
+795 324
+795 332
+795 430
+795 454
+795 510
+795 545
+795 660
+796 35
+796 51
+796 99
+796 149
+796 276
+796 557
+796 629
+796 718
+797 10
+797 102
+797 233
+797 292
+797 306
+797 334
+797 355
+797 433
+797 440
+797 482
+797 663
+797 726
+798 57
+798 91
+798 104
+798 143
+798 479
+798 488
+799 131
+799 137
+799 145
+799 156
+799 340
+799 394
+799 420
+799 526
+799 545
+799 578
+799 592
+799 606
+799 719
+799 760
+799 788
+800 131
+800 159
+800 392
+800 464
+800 608
+800 615
+800 655
+801 41
+801 72
+801 256
+801 379
+801 638
+802 47
+802 50
+802 69
+802 74
+802 215
+802 239
+802 350
+802 565
+802 663
+802 786
+803 5
+803 72
+803 120
+803 329
+803 380
+803 775
+804 32
+804 315
+804 406
+805 36
+805 103
+805 144
+805 264
+805 371
+805 410
+805 424
+805 508
+805 579
+805 724
+806 202
+806 349
+806 494
+806 677
+806 744
+806 772
+806 794
+807 0
+807 226
+807 417
+807 437
+807 516
+807 671
+807 780
+808 12
+808 173
+808 208
+808 223
+808 226
+808 249
+808 380
+808 399
+808 556
+808 686
+808 716
+809 119
+809 181
+809 274
+809 333
+809 335
+809 351
+809 362
+809 408
+809 411
+809 500
+809 521
+810 30
+810 61
+810 70
+810 97
+810 164
+810 195
+810 292
+810 343
+810 376
+810 511
+810 612
+810 666
+810 690
+810 704
+811 369
+811 389
+811 434
+811 507
+812 96
+812 206
+812 207
+812 331
+812 462
+813 54
+813 102
+813 198
+813 206
+813 509
+813 585
+813 627
+813 642
+813 684
+813 688
+813 805
+814 151
+814 194
+814 457
+814 639
+814 750
+815 145
+815 402
+815 446
+815 543
+815 690
+815 733
+815 743
+815 804
+816 53
+816 168
+816 210
+816 213
+816 217
+816 254
+816 279
+816 443
+816 712
+817 294
+817 305
+817 349
+817 669
+818 9
+818 43
+818 145
+818 215
+818 278
+818 304
+818 556
+818 653
+818 686
+818 709
+818 749
+819 43
+819 129
+819 138
+819 377
+819 413
+819 471
+819 617
+820 104
+820 225
+820 277
+820 368
+820 672
+820 747
+820 817
+821 57
+821 75
+821 128
+821 332
+821 537
+821 567
+822 23
+822 31
+822 298
+822 338
+822 353
+822 381
+822 463
+822 488
+822 530
+822 641
+823 2
+823 55
+823 116
+823 171
+823 175
+823 284
+823 384
+823 736
+824 237
+824 385
+824 411
+824 731
+825 60
+825 272
+825 345
+825 623
+825 640
+826 27
+826 117
+826 148
+826 250
+826 360
+826 420
+826 422
+826 435
+826 482
+827 129
+827 223
+827 367
+827 388
+827 479
+827 592
+827 674
+828 84
+828 225
+828 330
+828 369
+828 487
+828 621
+828 728
+828 751
+829 129
+829 213
+829 292
+829 330
+829 487
+829 577
+829 602
+829 654
+829 656
+829 732
+830 148
+830 191
+830 480
+830 518
+830 666
+830 672
+830 767
+831 18
+831 75
+831 198
+831 249
+831 272
+831 372
+831 484
+831 513
+831 520
+831 703
+831 748
+832 287
+832 325
+832 412
+832 422
+832 508
+832 548
+832 556
+832 564
+832 613
+832 699
+833 6
+833 123
+833 192
+833 229
+833 316
+833 414
+833 481
+833 564
+833 824
+834 70
+834 239
+834 313
+834 382
+834 397
+834 696
+834 700
+834 714
+834 734
+835 13
+835 80
+835 91
+835 135
+835 226
+835 248
+835 255
+835 286
+835 478
+835 521
+835 667
+835 672
+835 811
+836 24
+836 66
+836 98
+836 101
+836 314
+836 351
+836 484
+836 579
+836 722
+837 25
+837 56
+837 100
+837 533
+837 594
+837 756
+838 167
+838 255
+838 549
+838 747
+838 825
+839 151
+839 364
+839 559
+839 573
+839 655
+839 777
+840 43
+840 201
+840 295
+840 408
+840 429
+840 542
+840 769
+841 1
+841 10
+841 79
+841 279
+841 341
+841 417
+841 524
+841 620
+841 664
+841 825
+842 41
+842 59
+842 81
+842 188
+842 193
+842 245
+842 454
+842 563
+842 616
+842 658
+842 685
+842 748
+843 15
+843 120
+843 282
+843 315
+843 385
+843 452
+843 471
+843 480
+843 566
+843 581
+843 744
+844 38
+844 50
+844 112
+844 136
+844 140
+844 209
+844 266
+844 272
+844 504
+844 778
+845 8
+845 284
+845 644
+845 646
+846 28
+846 241
+846 455
+846 459
+846 490
+846 500
+846 514
+846 547
+846 587
+847 47
+847 185
+847 354
+847 455
+847 614
+847 631
+847 718
+847 812
+848 12
+848 343
+848 478
+848 490
+848 504
+848 552
+848 652
+848 668
+848 674
+848 727
+848 781
+848 788
+849 146
+849 168
+849 217
+849 226
+849 295
+849 325
+849 528
+849 546
+849 589
+849 591
+849 602
+849 629
+849 738
+849 821
+850 85
+850 96
+850 160
+850 189
+850 271
+850 493
+850 721
+850 775
+851 4
+851 443
+851 806
+852 223
+852 436
+852 707
+852 780
+852 815
+852 833
+853 43
+853 92
+853 543
+853 661
+853 707
+853 769
+853 845
+854 178
+854 245
+854 271
+854 284
+854 675
+854 701
+854 710
+854 714
+855 48
+855 240
+855 265
+855 329
+855 424
+855 671
+855 684
+855 705
+855 727
+855 776
+855 830
+856 82
+856 102
+856 161
+856 169
+856 378
+856 447
+856 478
+856 523
+856 606
+856 703
+857 287
+857 395
+857 438
+857 474
+857 477
+857 538
+857 590
+857 787
+857 788
+857 807
+858 9
+858 89
+858 219
+858 302
+858 412
+858 444
+858 500
+858 518
+858 536
+858 586
+858 767
+858 808
+859 175
+859 246
+859 593
+859 679
+859 735
+859 747
+860 64
+860 206
+860 285
+860 366
+860 388
+860 570
+860 617
+860 788
+860 829
+861 89
+861 166
+861 216
+861 260
+861 347
+861 348
+861 439
+861 526
+861 537
+861 567
+861 851
+862 405
+862 529
+862 804
+862 840
+863 188
+863 198
+863 216
+863 445
+863 518
+863 559
+863 703
+863 774
+864 52
+864 248
+864 309
+864 420
+864 529
+864 620
+864 660
+864 725
+864 839
+865 14
+865 112
+865 232
+865 235
+865 255
+865 347
+865 369
+865 470
+865 648
+865 797
+865 814
+865 844
+866 60
+866 183
+866 687
+866 741
+866 789
+866 861
+867 74
+867 86
+867 119
+867 217
+867 263
+867 268
+867 363
+867 475
+867 624
+867 778
+867 813
+867 831
+867 838
+868 95
+868 105
+868 194
+868 295
+868 328
+868 383
+868 421
+868 430
+868 501
+868 527
+868 528
+868 587
+868 605
+868 614
+868 796
+868 798
+868 823
+869 40
+869 157
+869 186
+869 222
+869 262
+869 521
+869 605
+869 655
+869 736
+869 789
+870 152
+870 159
+870 181
+870 182
+870 431
+870 546
+870 554
+870 682
+871 53
+871 259
+871 368
+871 382
+871 563
+872 100
+872 263
+872 303
+872 337
+872 431
+872 437
+872 458
+872 661
+872 736
+872 753
+873 110
+873 492
+873 563
+873 660
+873 663
+874 5
+874 66
+874 134
+874 175
+874 229
+874 312
+874 504
+874 510
+874 521
+874 675
+875 181
+875 310
+875 459
+875 460
+875 501
+875 571
+875 693
+876 73
+876 149
+876 296
+876 346
+876 389
+876 525
+877 11
+877 187
+877 318
+877 336
+877 583
+877 681
+877 790
+878 408
+878 702
+878 706
+878 764
+878 769
+878 816
+879 73
+879 87
+879 158
+879 284
+879 353
+879 359
+879 423
+879 520
+879 559
+879 726
+879 796
+879 875
+880 20
+880 24
+880 175
+880 253
+880 340
+880 377
+880 450
+880 465
+880 632
+880 738
+881 99
+881 181
+881 223
+881 314
+881 449
+881 549
+881 840
+882 2
+882 8
+882 74
+882 123
+882 195
+882 301
+882 318
+882 331
+882 339
+882 475
+882 549
+882 595
+883 104
+883 198
+883 228
+883 265
+883 346
+883 418
+883 423
+883 683
+883 706
+883 712
+883 732
+883 761
+883 845
+884 102
+884 322
+884 330
+884 351
+884 389
+884 392
+884 430
+884 503
+884 731
+884 780
+884 821
+885 66
+885 123
+885 305
+885 353
+885 403
+885 411
+885 625
+885 756
+885 837
+886 67
+886 123
+886 195
+886 198
+886 272
+886 387
+886 451
+886 454
+886 538
+886 644
+886 663
+886 676
+886 701
+886 773
+887 17
+887 368
+887 427
+887 452
+887 478
+887 769
+887 818
+887 848
+888 163
+888 201
+888 354
+888 413
+888 758
+888 883
+889 176
+889 242
+889 243
+889 264
+889 299
+889 301
+889 368
+889 502
+889 731
+889 830
+889 874
+890 44
+890 65
+890 86
+890 106
+890 178
+890 201
+890 352
+890 420
+890 829
+891 92
+891 210
+891 464
+891 664
+891 671
+891 679
+891 743
+892 12
+892 19
+892 31
+892 34
+892 92
+892 550
+892 659
+892 879
+893 38
+893 261
+893 348
+893 632
+894 248
+894 282
+894 298
+894 314
+894 424
+894 437
+894 517
+894 599
+894 612
+894 615
+894 879
+895 45
+895 178
+895 228
+895 314
+895 334
+895 387
+895 574
+895 781
+896 5
+896 51
+896 142
+896 235
+896 514
+896 550
+896 582
+896 619
+897 171
+897 438
+897 493
+897 528
+897 750
+897 787
+897 823
+898 16
+898 67
+898 184
+898 336
+898 365
+898 367
+898 374
+898 471
+898 744
+899 245
+899 352
+899 372
+899 501
+899 568
+899 694
+899 831
+900 97
+900 203
+900 223
+900 264
+900 366
+900 388
+900 419
+900 753
+901 38
+901 121
+901 131
+901 197
+901 212
+901 232
+901 309
+901 317
+901 394
+901 573
+901 615
+901 686
+901 808
+901 812
+902 112
+902 587
+902 647
+902 742
+902 885
+903 139
+903 185
+903 247
+903 331
+903 377
+903 442
+903 466
+903 469
+903 785
+903 855
+904 266
+904 408
+904 451
+904 522
+904 528
+904 804
+904 861
+904 862
+905 51
+905 561
+905 677
+906 75
+906 183
+906 291
+906 376
+906 379
+906 387
+906 396
+906 431
+906 560
+906 585
+906 710
+906 838
+906 890
+907 54
+907 162
+907 521
+907 560
+907 723
+907 748
+908 350
+908 493
+908 588
+908 685
+908 692
+908 730
+908 763
+908 901
+909 214
+909 354
+909 477
+909 490
+909 697
+909 826
+909 829
+910 54
+910 319
+910 341
+910 377
+910 478
+910 547
+910 637
+910 867
+911 203
+911 460
+911 509
+911 607
+911 841
+911 845
+912 335
+912 407
+912 433
+912 495
+912 522
+912 555
+912 712
+912 749
+913 187
+913 310
+913 375
+913 485
+913 497
+913 577
+913 629
+913 692
+913 774
+913 791
+914 107
+914 223
+914 296
+914 320
+914 341
+914 509
+914 782
+914 861
+914 871
+914 902
+915 16
+915 51
+915 122
+915 126
+915 154
+915 203
+915 329
+915 387
+915 461
+915 580
+915 626
+915 658
+915 714
+915 813
+915 826
+916 56
+916 128
+916 699
+916 762
+916 909
+917 6
+917 215
+917 260
+917 365
+917 483
+917 549
+917 623
+917 835
+917 864
+917 871
+917 872
+918 94
+918 104
+918 327
+918 375
+918 416
+918 604
+918 682
+918 695
+918 755
+919 182
+919 246
+919 283
+919 293
+919 448
+919 587
+919 650
+919 836
+920 32
+920 181
+920 267
+920 411
+920 505
+920 580
+920 656
+920 840
+921 20
+921 23
+921 181
+921 278
+921 314
+921 398
+921 529
+921 879
+921 893
+922 68
+922 81
+922 457
+922 473
+922 505
+922 615
+922 644
+922 838
+923 354
+923 371
+923 850
+924 200
+924 228
+924 232
+924 256
+924 269
+924 429
+924 440
+924 536
+924 566
+924 686
+924 841
+924 882
+925 108
+925 137
+925 234
+925 517
+925 663
+926 34
+926 100
+926 335
+926 361
+926 368
+926 433
+926 499
+926 534
+926 546
+926 614
+926 870
+926 880
+927 79
+927 177
+927 264
+927 456
+927 482
+927 496
+927 663
+927 709
+927 870
+927 881
+928 76
+928 125
+928 161
+928 199
+928 249
+928 415
+928 416
+928 510
+928 533
+928 612
+928 627
+928 728
+928 786
+928 825
+929 19
+929 100
+929 542
+929 616
+929 617
+929 643
+929 715
+929 833
+929 841
+930 0
+930 80
+930 114
+930 296
+930 364
+930 384
+930 432
+930 614
+930 756
+930 889
+930 917
+931 23
+931 132
+931 175
+931 179
+931 192
+931 265
+931 266
+931 367
+931 379
+931 458
+931 507
+931 544
+931 547
+931 559
+931 623
+931 663
+931 731
+931 793
+932 114
+932 349
+932 508
+932 636
+932 904
+933 149
+933 154
+933 208
+933 413
+933 919
+934 111
+934 116
+934 261
+934 363
+934 393
+934 402
+934 514
+934 570
+934 605
+934 673
+934 697
+934 842
+934 891
+935 76
+935 163
+935 193
+935 560
+935 620
+935 685
+935 697
+935 842
+935 847
+935 934
+936 6
+936 21
+936 123
+936 339
+936 424
+936 461
+936 471
+936 570
+936 705
+936 755
+937 264
+937 328
+937 505
+937 542
+937 588
+937 613
+937 720
+937 732
+937 791
+937 877
+938 23
+938 31
+938 60
+938 112
+938 129
+938 345
+938 412
+938 447
+938 712
+938 835
+938 888
+938 934
+939 5
+939 26
+939 35
+939 120
+939 285
+939 297
+939 442
+939 480
+939 516
+939 560
+940 105
+940 140
+940 288
+940 469
+940 581
+940 758
+940 779
+940 882
+941 41
+941 231
+941 354
+941 444
+941 480
+941 621
+941 679
+941 709
+941 741
+941 773
+942 96
+942 221
+942 305
+942 519
+942 641
+942 737
+942 805
+942 915
+943 109
+943 156
+943 169
+943 195
+943 204
+943 240
+943 452
+943 553
+943 620
+943 621
+943 713
+943 785
+943 856
+944 202
+944 262
+944 273
+944 315
+944 461
+944 489
+944 524
+944 683
+944 702
+944 784
+944 853
+945 32
+945 246
+945 288
+945 392
+945 464
+945 545
+945 628
+945 658
+945 848
+945 912
+945 931
+946 18
+946 31
+946 36
+946 80
+946 342
+946 369
+946 379
+946 799
+946 803
+946 890
+947 223
+947 236
+947 360
+947 382
+947 492
+947 560
+947 811
+948 129
+948 222
+948 255
+948 458
+948 716
+948 797
+948 870
+948 879
+948 889
+948 908
+949 12
+949 46
+949 131
+949 375
+949 441
+949 463
+949 491
+949 498
+949 746
+949 814
+949 823
+949 831
+949 879
+950 384
+950 443
+950 505
+950 517
+950 561
+950 612
+950 628
+950 682
+950 690
+950 908
+951 85
+951 99
+951 102
+951 277
+951 384
+951 460
+951 528
+951 651
+951 834
+951 874
+951 907
+951 912
+951 932
+952 11
+952 82
+952 269
+952 314
+952 386
+952 531
+952 652
+952 830
+952 901
+953 16
+953 104
+953 200
+953 457
+953 500
+953 799
+953 809
+954 96
+954 134
+954 246
+954 267
+954 286
+954 422
+954 493
+954 757
+954 764
+954 788
+954 937
+955 31
+955 153
+955 198
+955 385
+955 465
+955 507
+955 569
+955 611
+955 619
+955 789
+955 830
+955 871
+955 931
+956 35
+956 123
+956 283
+956 286
+956 303
+956 369
+956 427
+956 737
+956 872
+956 926
+957 68
+957 128
+957 306
+957 700
+957 852
+957 923
+958 56
+958 118
+958 177
+958 258
+958 300
+958 439
+958 536
+958 585
+958 757
+958 813
+958 886
+959 106
+959 303
+959 380
+959 419
+959 611
+959 674
+959 823
+960 20
+960 103
+960 147
+960 627
+960 633
+960 679
+960 708
+960 713
+960 720
+960 871
+961 19
+961 113
+961 133
+961 261
+961 412
+961 454
+961 484
+961 691
+961 804
+961 938
+962 140
+962 301
+962 325
+962 392
+962 428
+962 563
+962 717
+962 761
+962 913
+963 50
+963 102
+963 425
+963 525
+963 874
+963 915
+964 81
+964 316
+964 346
+964 511
+964 620
+964 659
+964 936
+965 164
+965 530
+965 548
+965 561
+965 743
+965 767
+965 790
+965 871
+966 181
+966 210
+966 268
+966 292
+966 314
+966 354
+966 447
+966 494
+966 614
+966 649
+966 868
+966 902
+967 3
+967 305
+968 20
+968 30
+968 44
+968 133
+968 470
+968 479
+968 641
+968 667
+968 777
+968 795
+968 816
+968 878
+968 879
+969 178
+969 318
+969 321
+969 359
+969 444
+969 684
+969 685
+969 705
+969 706
+969 822
+970 288
+970 291
+970 473
+970 629
+970 644
+970 833
+970 862
+971 77
+971 245
+971 317
+971 321
+971 348
+971 426
+971 472
+971 551
+971 721
+971 727
+971 911
+972 93
+972 196
+972 303
+972 400
+972 687
+972 767
+972 786
+972 829
+973 9
+973 100
+973 123
+973 344
+973 470
+973 480
+973 524
+973 579
+973 592
+973 666
+973 700
+973 713
+973 746
+973 859
+973 893
+973 941
+974 11
+974 57
+974 149
+974 206
+974 299
+974 478
+974 484
+974 516
+974 684
+974 777
+974 809
+975 111
+975 253
+975 442
+975 612
+975 766
+975 836
+975 930
+976 185
+976 290
+976 310
+976 367
+976 536
+976 657
+976 849
+976 974
+977 43
+977 161
+977 272
+977 335
+977 401
+977 414
+977 533
+977 633
+977 712
+977 816
+977 822
+977 876
+977 891
+977 909
+977 957
+978 52
+978 89
+978 243
+978 443
+978 446
+978 450
+978 637
+978 730
+978 927
+978 964
+978 972
+979 29
+979 31
+979 528
+979 598
+979 646
+979 774
+979 886
+979 908
+980 135
+980 243
+980 289
+980 365
+980 674
+980 685
+980 937
+980 960
+981 13
+981 46
+981 63
+981 110
+981 128
+981 132
+981 146
+981 180
+981 394
+981 485
+981 492
+981 675
+981 700
+981 760
+981 794
+981 954
+981 958
+982 61
+982 189
+982 265
+982 275
+982 309
+982 512
+982 635
+982 835
+982 881
+983 114
+983 375
+983 624
+983 648
+984 47
+984 50
+984 194
+984 283
+984 319
+984 457
+984 477
+984 642
+984 669
+984 725
+984 760
+984 805
+984 904
+984 965
+985 154
+985 229
+985 316
+985 781
+985 900
+985 910
+985 945
+986 53
+986 108
+986 116
+986 141
+986 194
+986 352
+986 392
+986 577
+986 655
+986 666
+986 746
+986 777
+986 860
+987 140
+987 225
+987 263
+987 375
+987 466
+987 501
+987 515
+987 770
+987 853
+987 922
+988 51
+988 98
+988 246
+988 290
+988 328
+988 411
+988 444
+988 454
+988 466
+988 505
+988 538
+988 559
+988 687
+988 790
+988 858
+988 883
+988 953
+989 214
+989 227
+989 570
+989 700
+989 941
+990 130
+990 238
+990 479
+990 516
+990 521
+990 786
+990 889
+990 981
+991 1
+991 42
+991 125
+991 145
+991 152
+991 155
+991 267
+991 338
+991 405
+991 434
+991 763
+991 793
+992 101
+992 136
+992 223
+992 278
+992 503
+992 568
+992 692
+992 698
+992 704
+992 919
+993 77
+993 104
+993 373
+993 618
+993 759
+993 845
+993 899
+993 903
+993 909
+993 954
+994 123
+994 131
+994 216
+994 267
+994 350
+994 361
+994 419
+994 645
+994 776
+995 17
+995 104
+995 125
+995 391
+995 458
+995 512
+995 532
+995 538
+995 566
+995 760
+995 949
+995 964
+995 992
+996 103
+996 206
+996 560
+996 633
+996 664
+996 850
+996 919
+996 969
+997 102
+997 145
+997 160
+997 255
+997 351
+997 387
+997 388
+997 505
+997 562
+997 673
+997 737
+997 861
+997 903
+997 935
+997 954
+998 124
+998 203
+998 286
+998 516
+998 527
+998 596
+998 655
+998 664
+998 698
+998 879
+999 159
+999 161
+999 255
+999 323
+999 344
+999 670
+999 715
+999 730
+999 935
diff --git a/examples/pl_-3.0_3_500_10000 b/examples/pl_-3.0_3_500_10000
new file mode 100644
index 0000000..4459e0d
--- /dev/null
+++ b/examples/pl_-3.0_3_500_10000
@@ -0,0 +1,10000 @@
+3
+3
+3
+6
+4
+3
+3
+20
+18
+4
+3
+5
+4
+6
+7
+3
+3
+4
+6
+3
+3
+4
+12
+3
+3
+3
+6
+3
+6
+6
+8
+6
+3
+7
+6
+4
+24
+3
+4
+7
+5
+3
+3
+3
+3
+6
+6
+3
+3
+4
+3
+5
+3
+3
+7
+5
+3
+3
+3
+4
+3
+9
+3
+3
+4
+27
+3
+3
+4
+3
+3
+3
+7
+8
+4
+9
+10
+3
+3
+3
+3
+4
+6
+6
+6
+5
+6
+3
+3
+8
+6
+6
+4
+5
+3
+4
+7
+3
+9
+3
+3
+5
+4
+4
+3
+4
+3
+9
+3
+5
+3
+3
+5
+10
+4
+3
+5
+4
+3
+3
+4
+4
+3
+5
+3
+3
+9
+8
+3
+3
+6
+3
+4
+11
+84
+3
+12
+3
+3
+5
+3
+3
+3
+3
+6
+3
+5
+3
+4
+10
+3
+3
+5
+3
+3
+3
+21
+3
+4
+6
+4
+3
+5
+4
+3
+3
+4
+10
+4
+3
+4
+7
+3
+6
+3
+3
+5
+3
+3
+6
+3
+4
+3
+3
+6
+5
+3
+6
+5
+3
+3
+3
+4
+3
+3
+5
+3
+5
+5
+15
+3
+10
+3
+11
+3
+3
+3
+5
+5
+6
+3
+6
+8
+6
+4
+3
+4
+3
+17
+5
+4
+3
+3
+5
+3
+3
+3
+3
+3
+5
+4
+5
+3
+7
+4
+4
+4
+85
+4
+5
+3
+3
+4
+4
+9
+4
+3
+5
+4
+4
+3
+3
+7
+3
+3
+3
+6
+6
+3
+3
+4
+5
+3
+3
+3
+6
+7
+27
+3
+3
+4
+5
+4
+5
+7
+3
+4
+3
+3
+3
+3
+4
+3
+6
+3
+14
+3
+3
+3
+5
+5
+4
+4
+3
+3
+3
+5
+3
+4
+4
+3
+3
+3
+4
+3
+3
+11
+3
+4
+3
+7
+3
+4
+4
+8
+6
+4
+5
+4
+3
+3
+6
+4
+8
+3
+24
+10
+7
+6
+4
+4
+7
+4
+11
+7
+3
+5
+5
+16
+4
+9
+5
+4
+3
+3
+3
+3
+4
+4
+3
+5
+7
+3
+7
+3
+5
+6
+3
+3
+12
+3
+5
+3
+18
+20
+3
+5
+3
+7
+3
+4
+3
+4
+6
+5
+6
+8
+13
+8
+12
+3
+4
+4
+3
+3
+4
+3
+9
+3
+4
+3
+20
+15
+3
+8
+5
+5
+3
+3
+9
+4
+11
+3
+3
+4
+4
+3
+3
+3
+10
+3
+4
+3
+4
+6
+4
+11
+3
+3
+3
+3
+3
+3
+3
+3
+7
+8
+8
+42
+3
+6
+3
+3
+3
+3
+10
+5
+4
+4
+3
+3
+8
+4
+7
+3
+3
+9
+6
+3
+3
+3
+5
+3
+4
+3
+9
+3
+3
+4
+3
+22
+8
+3
+3
+5
+10
+4
+5
+6
+4
+3
+9
+3
+3
+7
+7
+3
+5
+3
+7
+3
+21
+3
+6
+3
+3
+11
+3
+20
+3
+8
+4
+8
+3
+3
+4
+3
+6
+3
+6
+3
+6
+37
+3
+3
+6
+5
+3
+9
+3
+12
+3
+3
+4
+4
+4
+3
+4
+3
+3
+4
+5
+5
+10
+4
+12
+4
+4
+3
+5
+5
+3
+4
+4
+5
+4
+3
+3
+3
+4
+3
+4
+4
+3
+3
+3
+3
+3
+3
+13
+7
+3
+5
+7
+3
+11
+6
+3
+4
+8
+4
+3
+4
+40
+4
+5
+3
+4
+4
+3
+6
+9
+4
+9
+4
+3
+9
+3
+4
+3
+3
+5
+26
+6
+5
+3
+3
+3
+3
+3
+6
+3
+3
+3
+4
+13
+4
+3
+8
+3
+3
+3
+3
+3
+3
+3
+3
+5
+4
+3
+3
+5
+10
+4
+3
+3
+6
+3
+5
+3
+3
+7
+7
+5
+4
+3
+3
+3
+3
+3
+3
+7
+3
+3
+3
+5
+3
+5
+3
+4
+4
+7
+7
+3
+4
+3
+9
+8
+3
+7
+5
+10
+3
+3
+3
+3
+4
+3
+8
+3
+11
+3
+14
+9
+3
+4
+3
+3
+3
+6
+3
+5
+9
+3
+5
+3
+3
+4
+5
+3
+3
+32
+4
+3
+3
+5
+7
+3
+4
+4
+3
+3
+3
+11
+3
+3
+3
+3
+3
+4
+3
+3
+6
+6
+3
+7
+3
+6
+5
+3
+3
+3
+3
+4
+4
+3
+3
+5
+3
+4
+3
+4
+3
+3
+3
+3
+3
+7
+6
+3
+3
+3
+3
+9
+4
+4
+14
+7
+4
+4
+3
+8
+12
+3
+3
+3
+3
+3
+3
+4
+6
+3
+3
+3
+3
+3
+3
+3
+10
+3
+3
+5
+4
+4
+3
+6
+3
+9
+3
+7
+6
+3
+3
+3
+17
+3
+5
+4
+3
+3
+3
+4
+3
+3
+4
+3
+3
+4
+6
+10
+3
+3
+3
+3
+4
+5
+10
+5
+6
+9
+3
+5
+4
+4
+3
+3
+5
+5
+6
+3
+10
+35
+4
+3
+8
+5
+3
+3
+5
+3
+3
+4
+3
+6
+4
+3
+3
+3
+3
+3
+4
+3
+3
+4
+17
+3
+5
+7
+3
+5
+7
+3
+3
+3
+8
+3
+21
+3
+4
+3
+7
+5
+3
+3
+3
+4
+3
+3
+3
+4
+4
+3
+8
+6
+3
+3
+3
+8
+3
+4
+4
+6
+23
+8
+4
+3
+27
+5
+3
+3
+5
+11
+3
+4
+3
+3
+3
+3
+4
+4
+4
+3
+4
+4
+5
+3
+3
+4
+3
+4
+4
+3
+3
+3
+4
+3
+6
+7
+3
+3
+3
+4
+7
+4
+4
+4
+3
+3
+3
+6
+3
+68
+3
+4
+3
+7
+3
+3
+5
+3
+3
+3
+3
+4
+6
+3
+3
+4
+24
+3
+6
+6
+4
+13
+3
+4
+5
+3
+3
+3
+3
+4
+4
+6
+3
+8
+3
+3
+6
+8
+3
+3
+4
+9
+3
+3
+8
+3
+3
+3
+3
+4
+6
+6
+4
+4
+3
+4
+3
+9
+5
+3
+3
+3
+3
+4
+4
+5
+4
+9
+3
+6
+3
+3
+5
+6
+4
+3
+3
+3
+5
+7
+5
+4
+3
+4
+10
+10
+5
+6
+5
+7
+11
+3
+3
+4
+6
+3
+3
+3
+3
+4
+3
+3
+8
+3
+6
+11
+126
+11
+3
+3
+3
+4
+3
+3
+3
+4
+3
+3
+3
+8
+3
+5
+8
+4
+3
+3
+3
+3
+3
+5
+4
+5
+3
+3
+3
+3
+10
+4
+4
+11
+13
+11
+4
+4
+7
+3
+4
+3
+6
+3
+4
+3
+3
+3
+10
+3
+3
+3
+4
+6
+3
+8
+3
+3
+4
+6
+6
+4
+5
+5
+3
+4
+4
+3
+3
+7
+3
+9
+8
+3
+8
+4
+3
+5
+7
+4
+5
+3
+5
+4
+4
+3
+3
+3
+4
+4
+5
+3
+3
+5
+4
+3
+3
+4
+5
+3
+6
+15
+11
+3
+4
+3
+108
+3
+4
+3
+3
+3
+4
+10
+3
+4
+8
+3
+4
+3
+3
+3
+3
+3
+3
+4
+3
+3
+5
+3
+4
+8
+3
+3
+3
+3
+3
+4
+3
+3
+5
+3
+3
+3
+3
+3
+3
+3
+8
+3
+3
+4
+3
+3
+3
+3
+5
+4
+3
+3
+4
+3
+3
+3
+3
+3
+3
+3
+3
+5
+3
+3
+3
+3
+3
+3
+3
+3
+3
+4
+3
+4
+9
+3
+6
+5
+18
+3
+3
+3
+3
+3
+3
+4
+3
+5
+3
+4
+3
+3
+3
+3
+3
+4
+3
+3
+3
+7
+3
+3
+4
+3
+3
+4
+3
+3
+6
+3
+5
+4
+9
+3
+3
+3
+6
+4
+3
+3
+5
+3
+4
+31
+8
+4
+4
+4
+9
+6
+3
+27
+3
+4
+3
+4
+4
+4
+3
+4
+3
+3
+3
+3
+4
+3
+7
+8
+10
+11
+3
+3
+3
+5
+3
+3
+4
+3
+6
+3
+3
+3
+19
+3
+4
+3
+7
+3
+3
+3
+4
+3
+5
+9
+5
+21
+3
+3
+3
+3
+7
+4
+5
+3
+3
+3
+6
+4
+4
+3
+3
+3
+3
+3
+17
+5
+3
+4
+3
+5
+18
+11
+3
+3
+3
+3
+4
+3
+5
+6
+4
+4
+3
+5
+5
+6
+3
+4
+3
+3
+3
+5
+4
+3
+8
+3
+4
+3
+5
+3
+3
+3
+5
+3
+4
+3
+10
+3
+3
+7
+4
+4
+4
+6
+5
+4
+6
+11
+4
+4
+7
+3
+8
+3
+3
+3
+3
+30
+4
+6
+5
+4
+3
+3
+5
+3
+3
+3
+3
+3
+9
+3
+3
+4
+3
+3
+21
+4
+3
+3
+3
+4
+3
+5
+5
+3
+5
+4
+18
+3
+7
+3
+4
+3
+3
+3
+7
+5
+6
+3
+4
+3
+3
+4
+3
+3
+4
+9
+3
+3
+4
+10
+3
+3
+3
+4
+3
+3
+4
+5
+3
+7
+4
+3
+7
+4
+5
+5
+3
+6
+8
+3
+3
+8
+4
+4
+5
+7
+3
+3
+3
+3
+3
+5
+3
+3
+31
+3
+3
+5
+8
+8
+4
+10
+5
+7
+3
+7
+3
+3
+3
+4
+3
+3
+3
+4
+3
+5
+3
+7
+35
+6
+3
+5
+3
+12
+3
+7
+4
+3
+3
+3
+3
+5
+4
+3
+3
+5
+11
+6
+4
+9
+3
+3
+3
+7
+3
+3
+7
+3
+4
+3
+5
+3
+3
+3
+9
+4
+5
+3
+4
+3
+3
+5
+29
+3
+3
+3
+3
+9
+8
+4
+7
+3
+3
+3
+3
+28
+4
+3
+4
+3
+3
+3
+3
+3
+3
+7
+7
+4
+3
+3
+3
+3
+6
+3
+3
+3
+4
+5
+4
+6
+3
+4
+5
+3
+7
+5
+4
+5
+3
+5
+3
+3
+5
+3
+4
+3
+11
+3
+5
+4
+3
+4
+3
+3
+3
+3
+3
+9
+3
+3
+4
+3
+3
+3
+3
+3
+3
+4
+3
+3
+3
+4
+3
+4
+8
+5
+3
+13
+3
+3
+7
+4
+3
+3
+3
+8
+3
+14
+3
+15
+3
+4
+4
+14
+4
+9
+3
+3
+5
+3
+3
+4
+4
+14
+3
+9
+4
+16
+14
+3
+17
+3
+5
+3
+3
+4
+3
+3
+4
+7
+3
+3
+3
+3
+10
+5
+4
+3
+3
+4
+4
+3
+3
+3
+3
+4
+4
+3
+5
+3
+4
+4
+5
+3
+3
+4
+3
+6
+5
+3
+5
+3
+5
+3
+3
+3
+3
+6
+3
+3
+6
+4
+5
+3
+3
+3
+3
+3
+3
+4
+3
+4
+3
+4
+3
+3
+3
+3
+3
+4
+4
+3
+3
+3
+3
+3
+4
+5
+3
+4
+7
+8
+7
+3
+3
+4
+9
+5
+5
+4
+6
+3
+4
+3
+3
+4
+5
+4
+3
+5
+3
+9
+3
+17
+4
+3
+3
+5
+5
+4
+6
+3
+4
+3
+6
+3
+3
+5
+4
+9
+3
+4
+5
+3
+3
+4
+3
+4
+4
+3
+5
+3
+3
+5
+6
+3
+6
+4
+13
+17
+6
+3
+3
+3
+6
+3
+3
+4
+6
+4
+13
+5
+4
+3
+3
+5
+5
+8
+3
+3
+3
+3
+3
+3
+3
+4
+4
+9
+5
+3
+4
+14
+3
+3
+3
+3
+10
+5
+4
+3
+4
+7
+3
+3
+3
+7
+5
+8
+5
+3
+5
+3
+3
+6
+9
+4
+6
+4
+3
+9
+3
+5
+4
+9
+7
+3
+7
+3
+4
+8
+3
+3
+5
+15
+3
+16
+4
+3
+3
+4
+4
+5
+3
+4
+3
+4
+5
+3
+3
+3
+3
+5
+21
+3
+3
+3
+4
+3
+3
+3
+3
+26
+3
+3
+8
+5
+3
+3
+4
+3
+3
+4
+4
+15
+4
+3
+4
+3
+6
+3
+3
+8
+3
+3
+4
+4
+3
+6
+18
+5
+6
+3
+3
+3
+3
+11
+3
+3
+14
+26
+3
+3
+5
+3
+3
+3
+3
+3
+4
+7
+5
+3
+4
+19
+3
+3
+4
+4
+8
+7
+3
+9
+3
+7
+4
+5
+4
+3
+5
+7
+3
+13
+4
+5
+4
+4
+4
+21
+5
+5
+4
+5
+4
+3
+6
+3
+3
+3
+5
+4
+5
+3
+4
+3
+8
+4
+3
+5
+3
+3
+3
+5
+4
+4
+3
+4
+3
+3
+5
+9
+3
+3
+5
+15
+9
+5
+16
+7
+4
+6
+4
+4
+3
+3
+3
+3
+5
+4
+3
+3
+3
+4
+4
+4
+10
+6
+8
+3
+3
+7
+5
+4
+11
+3
+13
+5
+3
+3
+6
+13
+3
+3
+3
+3
+6
+4
+3
+3
+3
+4
+3
+3
+5
+6
+3
+3
+4
+4
+9
+3
+4
+3
+3
+3
+4
+8
+3
+9
+8
+4
+4
+4
+3
+6
+6
+3
+3
+3
+8
+6
+3
+3
+3
+4
+3
+3
+8
+4
+8
+4
+5
+3
+3
+3
+3
+4
+5
+3
+3
+5
+6
+3
+4
+3
+3
+3
+3
+7
+11
+4
+3
+5
+3
+6
+5
+6
+3
+3
+4
+4
+52
+4
+3
+12
+4
+3
+5
+4
+6
+3
+3
+3
+7
+4
+4
+15
+7
+3
+6
+3
+4
+25
+3
+3
+3
+4
+3
+4
+6
+4
+3
+3
+11
+3
+3
+3
+4
+8
+5
+5
+3
+9
+6
+4
+4
+3
+4
+35
+3
+3
+3
+3
+4
+5
+6
+3
+5
+4
+3
+3
+3
+11
+4
+4
+3
+3
+3
+3
+3
+3
+4
+23
+3
+6
+6
+4
+3
+3
+4
+4
+6
+3
+3
+3
+4
+3
+3
+3
+4
+3
+3
+4
+3
+3
+4
+3
+7
+4
+7
+3
+3
+3
+3
+34
+8
+3
+6
+4
+3
+7
+3
+4
+4
+6
+13
+7
+9
+3
+3
+5
+4
+27
+3
+3
+4
+3
+3
+4
+6
+4
+3
+5
+5
+3
+4
+4
+4
+3
+3
+3
+3
+3
+5
+4
+3
+3
+5
+4
+3
+3
+4
+3
+3
+3
+3
+4
+4
+7
+11
+5
+5
+5
+3
+8
+11
+3
+8
+4
+5
+3
+3
+3
+4
+3
+6
+5
+6
+3
+5
+3
+24
+3
+8
+3
+5
+5
+9
+10
+4
+3
+5
+7
+3
+4
+6
+4
+4
+5
+4
+3
+3
+4
+19
+5
+3
+5
+4
+5
+4
+6
+3
+3
+3
+3
+6
+3
+3
+3
+3
+4
+5
+6
+12
+3
+8
+8
+3
+8
+18
+4
+3
+9
+4
+3
+3
+3
+3
+3
+7
+4
+3
+8
+4
+3
+7
+3
+5
+4
+4
+3
+5
+5
+7
+3
+3
+4
+3
+3
+3
+4
+4
+3
+3
+4
+4
+4
+3
+3
+3
+13
+3
+4
+7
+3
+5
+3
+4
+5
+3
+5
+3
+3
+7
+4
+7
+3
+3
+3
+4
+17
+11
+6
+4
+3
+6
+3
+5
+3
+3
+6
+4
+8
+4
+3
+3
+5
+4
+7
+3
+5
+4
+5
+5
+6
+12
+9
+4
+17
+7
+4
+6
+4
+5
+3
+5
+4
+3
+4
+3
+11
+12
+5
+4
+5
+3
+5
+4
+3
+5
+3
+6
+4
+9
+3
+4
+4
+9
+3
+3
+3
+3
+3
+3
+8
+3
+3
+4
+3
+3
+5
+3
+3
+4
+8
+8
+3
+18
+4
+6
+3
+3
+3
+3
+3
+6
+3
+3
+4
+4
+5
+3
+3
+3
+4
+4
+14
+3
+8
+5
+3
+3
+5
+6
+5
+4
+5
+3
+4
+3
+3
+12
+4
+3
+6
+6
+4
+3
+7
+3
+4
+3
+3
+4
+4
+5
+3
+5
+6
+4
+3
+4
+4
+5
+3
+16
+3
+3
+3
+5
+4
+4
+3
+3
+3
+4
+3
+3
+3
+3
+11
+6
+17
+3
+3
+3
+3
+5
+6
+3
+3
+4
+3
+3
+3
+3
+22
+3
+3
+3
+4
+3
+7
+3
+8
+8
+7
+5
+3
+6
+5
+3
+3
+5
+3
+4
+3
+5
+3
+5
+3
+3
+3
+3
+5
+16
+3
+3
+4
+3
+5
+4
+8
+25
+3
+6
+3
+3
+3
+7
+3
+3
+7
+11
+3
+3
+3
+6
+6
+3
+4
+4
+3
+3
+4
+8
+3
+3
+3
+3
+4
+3
+3
+3
+11
+3
+4
+3
+6
+13
+3
+3
+9
+4
+3
+5
+3
+3
+3
+3
+7
+4
+3
+3
+10
+3
+3
+4
+7
+3
+31
+3
+3
+27
+5
+3
+8
+3
+3
+3
+4
+3
+3
+4
+7
+3
+9
+3
+3
+3
+5
+3
+6
+5
+5
+3
+4
+10
+3
+4
+4
+10
+4
+3
+4
+3
+3
+8
+3
+3
+4
+3
+5
+5
+4
+3
+3
+4
+3
+3
+5
+3
+3
+3
+4
+3
+3
+3
+3
+7
+3
+9
+6
+3
+4
+5
+7
+3
+5
+3
+4
+3
+4
+4
+4
+4
+3
+3
+44
+3
+5
+5
+5
+4
+8
+6
+3
+3
+11
+6
+3
+4
+9
+16
+3
+3
+3
+3
+3
+3
+3
+4
+3
+4
+4
+7
+5
+7
+3
+4
+102
+3
+3
+7
+6
+3
+3
+3
+4
+6
+3
+3
+3
+4
+3
+4
+3
+3
+4
+4
+3
+3
+6
+3
+4
+5
+4
+6
+3
+6
+5
+5
+3
+3
+3
+3
+7
+5
+3
+3
+4
+5
+3
+4
+3
+3
+6
+6
+9
+8
+3
+3
+4
+4
+5
+6
+4
+3
+3
+3
+4
+20
+3
+4
+8
+3
+4
+8
+4
+3
+3
+5
+4
+4
+3
+6
+3
+3
+4
+3
+3
+3
+3
+3
+6
+3
+3
+7
+3
+3
+3
+4
+11
+4
+12
+16
+3
+3
+5
+4
+4
+4
+6
+4
+6
+5
+3
+6
+3
+4
+3
+4
+10
+3
+3
+3
+4
+4
+3
+4
+3
+3
+3
+3
+3
+10
+3
+3
+3
+3
+3
+3
+12
+3
+3
+3
+10
+4
+3
+3
+5
+3
+4
+4
+4
+3
+5
+3
+3
+6
+3
+4
+3
+4
+8
+6
+7
+5
+3
+3
+6
+3
+6
+3
+3
+3
+3
+5
+12
+3
+3
+3
+3
+4
+4
+5
+3
+28
+4
+12
+3
+3
+3
+4
+4
+3
+3
+10
+5
+6
+3
+4
+4
+3
+17
+3
+3
+9
+5
+5
+5
+3
+3
+6
+4
+3
+3
+11
+4
+3
+3
+3
+15
+3
+4
+3
+4
+3
+5
+5
+8
+3
+12
+3
+3
+3
+5
+4
+3
+3
+3
+7
+3
+5
+4
+3
+4
+4
+3
+3
+3
+3
+3
+3
+5
+3
+4
+3
+3
+3
+3
+3
+4
+3
+5
+3
+5
+4
+4
+3
+7
+4
+3
+9
+4
+3
+4
+3
+4
+11
+3
+11
+3
+6
+4
+3
+4
+5
+3
+3
+7
+3
+3
+5
+3
+13
+4
+33
+3
+8
+3
+3
+5
+4
+4
+3
+6
+17
+6
+7
+3
+3
+5
+11
+7
+3
+9
+4
+3
+6
+3
+3
+4
+3
+17
+3
+13
+3
+3
+7
+3
+3
+3
+4
+9
+3
+4
+3
+7
+3
+5
+3
+7
+3
+4
+3
+3
+5
+8
+6
+7
+3
+5
+3
+3
+3
+3
+4
+3
+3
+3
+3
+7
+19
+4
+4
+10
+7
+3
+3
+3
+3
+3
+7
+5
+3
+7
+5
+5
+3
+4
+5
+4
+3
+9
+7
+9
+4
+4
+4
+5
+4
+3
+3
+7
+3
+6
+5
+4
+3
+3
+3
+14
+3
+4
+13
+3
+8
+4
+3
+3
+6
+3
+3
+3
+3
+4
+4
+5
+3
+3
+4
+4
+14
+5
+4
+3
+5
+3
+3
+4
+22
+3
+4
+3
+3
+4
+3
+3
+3
+3
+5
+3
+3
+3
+6
+3
+3
+3
+3
+3
+3
+3
+3
+4
+3
+3
+5
+3
+6
+5
+7
+3
+3
+4
+3
+6
+4
+6
+3
+9
+3
+4
+4
+3
+6
+3
+6
+4
+3
+4
+8
+15
+3
+3
+3
+3
+3
+4
+4
+3
+4
+3
+5
+3
+7
+4
+3
+3
+3
+3
+3
+3
+7
+3
+3
+5
+4
+3
+3
+3
+3
+3
+3
+4
+4
+3
+3
+4
+5
+3
+3
+6
+6
+3
+3
+4
+4
+5
+18
+4
+3
+4
+7
+24
+3
+4
+3
+3
+3
+3
+3
+4
+5
+14
+4
+3
+3
+5
+3
+5
+3
+8
+5
+3
+3
+5
+10
+4
+6
+3
+3
+3
+4
+4
+4
+3
+4
+9
+4
+3
+3
+3
+4
+7
+3
+6
+6
+4
+5
+3
+3
+9
+3
+3
+3
+3
+4
+5
+3
+3
+6
+4
+3
+3
+3
+3
+3
+4
+3
+3
+3
+6
+6
+4
+3
+3
+3
+4
+3
+3
+3
+3
+6
+3
+3
+3
+3
+6
+3
+3
+4
+4
+3
+3
+5
+67
+3
+4
+4
+5
+5
+3
+5
+4
+3
+6
+3
+4
+3
+3
+3
+3
+3
+3
+3
+5
+5
+3
+4
+5
+3
+4
+6
+3
+7
+3
+5
+3
+3
+7
+3
+3
+3
+4
+3
+7
+6
+4
+5
+5
+3
+4
+3
+12
+3
+5
+3
+4
+6
+5
+3
+3
+3
+6
+3
+3
+4
+4
+9
+3
+3
+6
+3
+4
+4
+3
+14
+3
+9
+8
+4
+9
+3
+3
+3
+3
+7
+3
+4
+3
+3
+3
+3
+4
+3
+3
+5
+3
+4
+3
+3
+3
+15
+3
+18
+7
+3
+7
+4
+3
+5
+3
+4
+4
+25
+3
+3
+3
+3
+3
+3
+7
+22
+10
+3
+3
+5
+3
+7
+4
+4
+3
+3
+4
+3
+3
+4
+3
+5
+12
+3
+5
+7
+3
+33
+4
+4
+4
+3
+3
+5
+3
+4
+4
+3
+3
+3
+4
+3
+4
+4
+5
+3
+11
+4
+6
+33
+3
+3
+10
+5
+6
+3
+4
+3
+3
+4
+18
+4
+15
+3
+3
+4
+8
+10
+14
+35
+3
+3
+4
+3
+3
+3
+4
+3
+8
+3
+4
+3
+4
+3
+5
+3
+4
+3
+6
+3
+3
+3
+10
+3
+3
+3
+4
+4
+3
+8
+3
+3
+7
+14
+4
+4
+3
+6
+4
+9
+6
+3
+3
+5
+4
+3
+9
+6
+5
+4
+5
+3
+5
+15
+3
+3
+10
+3
+3
+5
+6
+3
+5
+4
+3
+5
+3
+5
+3
+3
+4
+3
+3
+5
+7
+5
+4
+3
+3
+6
+7
+3
+4
+6
+5
+5
+6
+6
+4
+3
+12
+3
+3
+3
+3
+35
+3
+3
+3
+3
+3
+3
+3
+3
+4
+3
+3
+3
+10
+4
+3
+4
+14
+3
+13
+3
+5
+3
+8
+4
+3
+3
+3
+5
+4
+3
+3
+3
+9
+3
+3
+3
+3
+5
+3
+8
+8
+3
+4
+3
+4
+12
+3
+4
+4
+3
+4
+5
+3
+3
+5
+6
+3
+4
+4
+3
+13
+5
+3
+4
+3
+5
+3
+3
+10
+4
+5
+3
+4
+3
+3
+3
+3
+5
+3
+3
+3
+4
+3
+10
+3
+41
+5
+3
+66
+4
+3
+5
+12
+14
+5
+3
+3
+3
+3
+3
+5
+4
+3
+10
+5
+4
+3
+4
+5
+5
+5
+4
+4
+5
+3
+4
+10
+4
+4
+4
+3
+3
+4
+7
+3
+7
+3
+3
+3
+3
+5
+4
+5
+7
+4
+4
+4
+3
+6
+3
+4
+3
+5
+3
+3
+5
+6
+3
+4
+9
+4
+17
+4
+3
+3
+3
+3
+7
+8
+3
+3
+6
+3
+4
+4
+3
+3
+3
+3
+3
+5
+3
+3
+6
+8
+3
+4
+3
+3
+4
+3
+8
+4
+3
+3
+3
+5
+7
+3
+3
+4
+3
+3
+7
+3
+7
+39
+5
+3
+4
+3
+3
+6
+6
+7
+7
+10
+4
+3
+3
+5
+4
+5
+3
+3
+3
+4
+3
+6
+3
+8
+3
+32
+5
+11
+3
+7
+3
+3
+4
+5
+4
+4
+4
+11
+3
+5
+5
+6
+8
+3
+3
+3
+7
+4
+4
+3
+4
+3
+3
+5
+8
+4
+3
+3
+3
+3
+4
+3
+5
+8
+3
+4
+3
+22
+5
+5
+3
+3
+5
+3
+4
+3
+3
+4
+8
+3
+6
+3
+4
+3
+12
+9
+3
+3
+3
+8
+5
+3
+3
+3
+3
+3
+3
+3
+6
+3
+3
+8
+3
+6
+3
+4
+22
+21
+3
+3
+3
+5
+19
+5
+3
+4
+3
+3
+6
+3
+5
+3
+3
+5
+3
+3
+3
+3
+5
+3
+3
+3
+3
+10
+4
+3
+4
+8
+3
+3
+4
+3
+4
+3
+4
+3
+6
+3
+3
+8
+3
+7
+3
+4
+3
+11
+5
+6
+3
+6
+3
+4
+5
+6
+5
+4
+5
+4
+3
+3
+3
+5
+3
+3
+4
+4
+3
+4
+7
+3
+3
+4
+3
+5
+3
+3
+3
+5
+3
+3
+3
+4
+3
+3
+3
+5
+6
+3
+3
+3
+3
+3
+3
+3
+3
+5
+6
+4
+3
+3
+6
+18
+16
+4
+3
+3
+4
+4
+6
+37
+5
+19
+3
+4
+3
+6
+3
+5
+15
+5
+3
+3
+3
+3
+7
+3
+11
+3
+3
+3
+4
+3
+5
+3
+3
+6
+13
+10
+10
+5
+3
+3
+4
+3
+4
+3
+3
+22
+4
+8
+3
+27
+5
+6
+3
+4
+5
+4
+4
+3
+3
+3
+5
+6
+3
+4
+3
+3
+3
+10
+4
+8
+3
+5
+3
+3
+3
+3
+3
+3
+6
+4
+3
+4
+8
+3
+7
+7
+7
+3
+4
+6
+3
+4
+3
+3
+6
+3
+7
+3
+3
+3
+3
+3
+6
+3
+4
+3
+53
+4
+4
+3
+3
+4
+3
+4
+4
+3
+3
+3
+6
+3
+3
+3
+6
+4
+7
+4
+3
+5
+3
+3
+3
+3
+8
+3
+28
+3
+5
+5
+3
+6
+10
+7
+5
+3
+16
+4
+6
+4
+3
+3
+3
+4
+5
+4
+4
+8
+3
+3
+3
+4
+6
+4
+7
+3
+3
+3
+3
+7
+3
+4
+3
+3
+3
+6
+3
+3
+5
+3
+3
+4
+3
+38
+5
+3
+3
+3
+3
+4
+3
+3
+7
+3
+8
+3
+3
+3
+5
+3
+3
+3
+14
+9
+3
+4
+5
+7
+22
+3
+5
+5
+3
+9
+3
+3
+3
+4
+3
+4
+3
+3
+9
+3
+3
+5
+24
+24
+4
+3
+3
+7
+6
+5
+3
+4
+3
+7
+7
+3
+9
+6
+4
+3
+5
+5
+3
+3
+3
+3
+3
+3
+5
+4
+3
+4
+4
+3
+3
+3
+3
+4
+3
+7
+4
+4
+3
+25
+7
+3
+3
+4
+3
+3
+96
+4
+3
+3
+11
+36
+3
+3
+3
+6
+5
+3
+3
+3
+5
+3
+4
+3
+5
+3
+13
+3
+6
+31
+4
+3
+19
+3
+8
+4
+6
+3
+3
+3
+4
+5
+4
+3
+3
+4
+3
+3
+3
+3
+3
+4
+4
+4
+3
+12
+3
+3
+4
+3
+3
+3
+3
+4
+3
+3
+10
+13
+4
+4
+3
+6
+3
+3
+3
+8
+3
+5
+3
+3
+3
+4
+3
+6
+3
+4
+6
+6
+4
+5
+3
+5
+4
+3
+6
+7
+8
+3
+6
+3
+4
+3
+3
+3
+18
+3
+5
+3
+4
+4
+4
+3
+5
+3
+3
+3
+5
+3
+5
+5
+4
+3
+3
+5
+3
+14
+4
+3
+3
+24
+3
+10
+3
+3
+3
+4
+5
+3
+4
+4
+3
+4
+8
+3
+3
+3
+4
+4
+3
+3
+3
+4
+3
+12
+3
+6
+10
+3
+16
+27
+3
+5
+7
+4
+6
+9
+13
+3
+3
+4
+4
+10
+4
+3
+3
+5
+7
+4
+5
+10
+3
+4
+3
+4
+3
+5
+3
+3
+6
+4
+3
+24
+5
+4
+7
+12
+3
+3
+3
+11
+20
+3
+3
+3
+7
+3
+3
+5
+3
+4
+6
+3
+3
+6
+3
+9
+4
+4
+3
+3
+9
+22
+3
+3
+3
+3
+3
+3
+4
+5
+5
+3
+4
+3
+4
+24
+9
+4
+5
+3
+5
+4
+4
+3
+4
+14
+4
+3
+4
+3
+6
+4
+3
+5
+3
+4
+3
+6
+5
+3
+12
+4
+3
+5
+4
+5
+32
+3
+5
+6
+6
+7
+3
+3
+5
+4
+3
+3
+3
+5
+9
+10
+8
+25
+8
+4
+3
+6
+3
+6
+10
+4
+3
+3
+8
+18
+4
+5
+13
+15
+4
+4
+10
+3
+3
+19
+4
+3
+3
+3
+4
+3
+3
+3
+4
+3
+6
+11
+26
+6
+4
+3
+3
+6
+3
+3
+3
+4
+3
+5
+3
+3
+3
+14
+3
+4
+4
+7
+4
+10
+6
+4
+4
+5
+3
+5
+3
+6
+3
+5
+4
+3
+3
+3
+7
+4
+3
+8
+3
+5
+3
+3
+3
+4
+11
+8
+4
+6
+3
+4
+3
+14
+3
+4
+4
+4
+11
+8
+3
+7
+8
+4
+3
+3
+3
+4
+6
+4
+4
+3
+4
+4
+4
+10
+3
+5
+4
+3
+4
+3
+3
+6
+3
+3
+4
+7
+3
+4
+3
+3
+3
+3
+3
+4
+3
+15
+3
+4
+3
+3
+3
+5
+5
+8
+8
+3
+3
+3
+11
+4
+3
+5
+3
+3
+3
+3
+5
+3
+3
+3
+4
+3
+4
+4
+3
+5
+4
+3
+4
+3
+7
+8
+3
+3
+5
+4
+4
+3
+3
+5
+8
+3
+8
+3
+25
+3
+3
+3
+4
+3
+5
+4
+4
+3
+5
+5
+4
+3
+5
+3
+3
+4
+4
+8
+3
+3
+4
+3
+5
+3
+3
+3
+7
+3
+4
+3
+4
+3
+5
+19
+3
+3
+3
+4
+4
+3
+3
+3
+3
+7
+4
+5
+7
+3
+3
+7
+3
+4
+3
+3
+15
+3
+5
+5
+3
+3
+5
+3
+5
+3
+3
+6
+3
+3
+5
+3
+6
+3
+3
+5
+4
+3
+4
+6
+3
+3
+3
+3
+3
+7
+5
+5
+3
+3
+5
+5
+5
+3
+3
+5
+3
+4
+6
+3
+3
+3
+5
+3
+7
+3
+3
+6
+3
+4
+4
+3
+3
+3
+4
+3
+3
+5
+4
+3
+6
+3
+6
+3
+3
+4
+3
+3
+9
+3
+3
+3
+3
+4
+3
+13
+3
+3
+5
+3
+7
+3
+7
+3
+3
+3
+3
+10
+3
+7
+3
+5
+6
+4
+3
+3
+4
+3
+3
+3
+3
+3
+3
+11
+4
+3
+4
+3
+9
+3
+4
+27
+3
+4
+4
+3
+4
+4
+3
+4
+3
+7
+3
+3
+3
+3
+6
+5
+3
+3
+3
+5
+8
+5
+5
+3
+5
+12
+3
+3
+5
+3
+5
+4
+3
+13
+4
+3
+3
+5
+3
+6
+3
+3
+3
+3
+9
+3
+3
+5
+14
+7
+3
+7
+3
+3
+5
+3
+6
+6
+5
+5
+3
+3
+3
+5
+6
+5
+5
+5
+3
+3
+3
+8
+5
+7
+6
+3
+7
+4
+3
+3
+14
+4
+4
+4
+3
+4
+3
+3
+3
+3
+6
+3
+4
+6
+40
+3
+3
+4
+18
+3
+9
+5
+4
+6
+3
+5
+3
+5
+4
+7
+4
+4
+6
+4
+3
+3
+3
+3
+6
+3
+3
+3
+8
+3
+3
+12
+3
+13
+4
+9
+4
+3
+6
+3
+6
+5
+4
+3
+5
+8
+6
+3
+3
+3
+6
+10
+3
+3
+13
+4
+7
+5
+3
+12
+5
+3
+5
+5
+7
+11
+3
+3
+3
+3
+4
+7
+3
+7
+4
+4
+5
+10
+3
+3
+4
+6
+3
+31
+3
+4
+3
+3
+3
+15
+5
+3
+3
+9
+4
+4
+6
+7
+3
+4
+3
+3
+4
+6
+80
+3
+3
+3
+3
+7
+4
+3
+5
+3
+6
+3
+3
+3
+3
+3
+42
+3
+6
+5
+5
+3
+3
+4
+3
+6
+3
+3
+4
+5
+4
+4
+4
+6
+3
+3
+3
+3
+5
+7
+9
+7
+7
+3
+3
+4
+7
+3
+6
+4
+4
+3
+5
+7
+3
+3
+3
+20
+3
+5
+10
+3
+3
+3
+4
+3
+17
+3
+3
+3
+4
+3
+4
+3
+4
+3
+3
+3
+4
+3
+3
+3
+4
+8
+3
+3
+3
+9
+3
+6
+3
+3
+39
+5
+3
+5
+5
+4
+4
+3
+4
+6
+6
+3
+10
+3
+5
+3
+3
+3
+3
+10
+3
+3
+3
+6
+4
+4
+3
+4
+3
+3
+4
+7
+30
+3
+3
+3
+10
+3
+4
+4
+5
+5
+5
+3
+3
+3
+4
+4
+3
+7
+4
+3
+3
+3
+4
+3
+3
+3
+3
+3
+3
+3
+7
+4
+12
+12
+4
+7
+4
+4
+3
+3
+4
+3
+4
+3
+3
+16
+3
+3
+6
+4
+3
+3
+5
+9
+5
+4
+3
+3
+3
+5
+4
+3
+3
+3
+9
+3
+3
+3
+5
+22
+3
+5
+3
+3
+3
+3
+3
+4
+3
+4
+3
+3
+4
+3
+3
+5
+5
+10
+3
+5
+6
+15
+3
+6
+3
+4
+3
+5
+3
+3
+3
+3
+4
+3
+3
+3
+5
+3
+4
+4
+3
+9
+3
+4
+4
+3
+6
+16
+4
+3
+3
+4
+3
+6
+6
+3
+6
+6
+6
+5
+3
+3
+3
+3
+3
+4
+4
+3
+11
+3
+4
+8
+5
+3
+3
+10
+3
+3
+4
+4
+3
+3
+3
+3
+4
+3
+3
+3
+5
+4
+3
+3
+5
+12
+3
+3
+6
+3
+3
+4
+3
+3
+5
+4
+4
+3
+5
+9
+7
+7
+3
+3
+3
+4
+3
+4
+5
+3
+3
+7
+8
+4
+4
+3
+3
+3
+3
+3
+4
+6
+4
+16
+3
+6
+4
+3
+6
+3
+4
+5
+3
+5
+3
+7
+3
+3
+3
+3
+3
+4
+9
+3
+3
+3
+5
+4
+3
+4
+3
+6
+3
+3
+3
+3
+3
+3
+3
+5
+8
+6
+4
+5
+4
+6
+6
+3
+4
+3
+3
+3
+4
+3
+5
+5
+11
+3
+9
+3
+3
+3
+5
+3
+4
+3
+5
+3
+4
+7
+7
+3
+3
+3
+3
+4
+5
+4
+7
+6
+6
+3
+3
+8
+3
+4
+3
+3
+5
+5
+3
+3
+3
+3
+4
+3
+3
+3
+4
+6
+4
+3
+6
+4
+3
+4
+5
+3
+11
+5
+10
+9
+3
+10
+6
+5
+3
+4
+5
+4
+4
+3
+64
+56
+3
+3
+12
+3
+3
+4
+3
+4
+3
+3
+3
+3
+4
+3
+6
+4
+6
+3
+3
+6
+3
+7
+5
+3
+5
+3
+3
+9
+4
+3
+3
+4
+3
+5
+4
+3
+16
+6
+4
+15
+5
+3
+5
+4
+3
+6
+3
+3
+3
+5
+4
+4
+28
+3
+4
+5
+4
+3
+3
+4
+10
+6
+6
+3
+3
+15
+17
+3
+6
+4
+3
+4
+3
+3
+4
+3
+3
+4
+20
+3
+3
+4
+4
+12
+6
+6
+5
+3
+3
+5
+3
+4
+5
+3
+3
+5
+4
+3
+7
+4
+4
+7
+8
+3
+3
+3
+14
+17
+8
+3
+7
+3
+4
+4
+4
+3
+4
+3
+49
+5
+10
+3
+4
+4
+3
+4
+3
+5
+3
+3
+4
+6
+3
+5
+3
+5
+3
+7
+6
+3
+4
+3
+6
+7
+4
+5
+4
+3
+6
+3
+3
+6
+4
+4
+3
+5
+17
+5
+3
+6
+5
+9
+3
+3
+3
+7
+3
+3
+3
+3
+9
+3
+3
+4
+5
+3
+3
+5
+4
+3
+3
+3
+5
+3
+4
+5
+4
+3
+3
+3
+4
+3
+7
+6
+11
+3
+3
+3
+10
+14
+18
+8
+5
+3
+3
+5
+3
+3
+3
+3
+3
+3
+4
+3
+3
+3
+5
+4
+3
+3
+3
+3
+3
+3
+8
+3
+4
+3
+10
+7
+4
+3
+9
+5
+3
+4
+14
+4
+5
+3
+6
+5
+5
+5
+4
+4
+4
+3
+3
+4
+3
+6
+3
+35
+8
+4
+4
+3
+3
+3
+3
+3
+3
+3
+3
+3
+3
+3
+3
+4
+4
+8
+4
+3
+14
+3
+3
+3
+3
+3
+8
+3
+3
+5
+3
+4
+5
+5
+4
+4
+4
+8
+4
+3
+3
+7
+3
+3
+5
+5
+3
+4
+4
+4
+3
+4
+4
+4
+5
+3
+5
+3
+3
+3
+3
+6
+3
+3
+4
+3
+5
+5
+29
+4
+9
+5
+8
+5
+3
+3
+3
+4
+3
+4
+3
+4
+3
+3
+4
+9
+5
+3
+4
+5
+3
+4
+5
+3
+16
+4
+4
+4
+4
+6
+3
+9
+3
+4
+3
+5
+3
+3
+3
+6
+4
+6
+5
+5
+3
+5
+3
+3
+7
+4
+3
+5
+4
+3
+4
+3
+3
+3
+3
+4
+3
+3
+7
+3
+5
+8
+3
+3
+5
+5
+3
+4
+3
+5
+4
+3
+4
+4
+5
+3
+10
+3
+5
+3
+8
+6
+5
+5
+18
+3
+6
+3
+4
+5
+3
+6
+9
+3
+6
+3
+12
+7
+3
+3
+3
+4
+3
+3
+3
+3
+3
+3
+3
+4
+4
+7
+4
+3
+3
+7
+3
+4
+4
+4
+3
+3
+10
+3
+3
+3
+3
+3
+19
+4
+3
+11
+9
+3
+3
+3
+4
+4
+4
+6
+3
+3
+3
+4
+7
+5
+3
+3
+3
+10
+3
+3
+6
+4
+4
+4
+3
+5
+7
+3
+3
+5
+4
+3
+4
+4
+3
+7
+4
+4
+4
+3
+4
+7
+3
+3
+10
+3
+3
+3
+3
+5
+4
+5
+9
+3
+3
+4
+7
+3
+4
+5
+4
+3
+3
+4
+3
+3
+6
+6
+3
+3
+3
+4
+3
+3
+4
+3
+6
+3
+6
+4
+7
+4
+4
+3
+4
+3
+4
+4
+6
+3
+4
+7
+3
+4
+4
+5
+10
+3
+4
+3
+3
+7
+3
+8
+3
+5
+3
+4
+4
+3
+3
+4
+3
+5
+3
+8
+4
+3
+3
+3
+3
+4
+5
+3
+3
+4
+3
+7
+6
+3
+5
+4
+13
+3
+3
+7
+5
+5
+4
+6
+3
+4
+3
+3
+3
+3
+4
+3
+4
+5
+3
+6
+3
+3
+3
+5
+4
+12
+5
+3
+3
+4
+3
+4
+3
+4
+8
+3
+3
+6
+6
+5
+6
+3
+5
+3
+6
+3
+4
+3
+6
+3
+3
+5
+3
+4
+3
+3
+3
+3
+6
+13
+5
+5
+4
+3
+5
+3
+6
+3
+3
+5
+3
+3
+3
+3
+3
+6
+3
+3
+4
+3
+3
+3
+21
+5
+3
+4
+3
+3
+3
+7
+4
+4
+3
+4
+6
+3
+3
+6
+5
+3
+12
+6
+4
+42
+3
+3
+4
+4
+3
+5
+3
+6
+3
+3
+3
+3
+3
+3
+5
+3
+3
+4
+5
+5
+3
+6
+3
+4
+3
+3
+7
+4
+3
+4
+3
+6
+4
+4
+5
+3
+6
+5
+5
+5
+5
+3
+3
+4
+3
+4
+3
+3
+12
+78
+8
+11
+3
+12
+7
+12
+5
+3
+3
+8
+3
+9
+15
+5
+4
+4
+16
+3
+3
+3
+7
+5
+4
+6
+8
+4
+3
+3
+3
+3
+4
+4
+3
+5
+20
+5
+3
+3
+3
+4
+13
+3
+3
+3
+3
+7
+3
+3
+3
+3
+8
+15
+3
+3
+4
+3
+3
+6
+6
+3
+5
+4
+4
+4
+6
+5
+5
+4
+3
+3
+37
+4
+5
+3
+4
+3
+9
+3
+8
+3
+5
+3
+4
+5
+3
+4
+15
+3
+3
+3
+3
+3
+6
+4
+3
+3
+4
+5
+6
+11
+3
+6
+5
+6
+3
+3
+7
+5
+3
+3
+3
+5
+5
+5
+6
+3
+3
+3
+3
+3
+13
+3
+6
+4
+3
+3
+6
+5
+3
+3
+3
+3
+7
+3
+3
+3
+13
+10
+3
+4
+3
+3
+3
+6
+3
+5
+4
+3
+3
+3
+3
+4
+3
+7
+9
+4
+3
+4
+6
+14
+3
+7
+5
+3
+3
+3
+3
+4
+4
+11
+10
+5
+3
+7
+4
+3
+4
+6
+3
+3
+5
+3
+6
+6
+3
+5
+3
+3
+6
+5
+3
+3
+3
+3
+3
+3
+3
+3
+5
+3
+9
+7
+5
+5
+4
+3
+3
+4
+5
+3
+3
+3
+3
+3
+5
+10
+15
+7
+3
+3
+14
+4
+5
+3
+4
+4
+7
+10
+3
+3
+3
+8
+3
+5
+3
+7
+3
+5
+3
+4
+4
+5
+8
+4
+9
+4
+3
+17
+3
+3
+5
+7
+4
+3
+4
+3
+4
+4
+3
+6
+3
+3
+6
+5
+3
+4
+3
+5
+3
+3
+3
+7
+3
+3
+4
+15
+3
+3
+4
+3
+3
+3
+3
+4
+6
+10
+26
+5
+3
+4
+3
+5
+15
+4
+6
+3
+3
+3
+11
+9
+4
+6
+4
+5
+4
+6
+18
+20
+3
+4
+3
+3
+6
+3
+3
+4
+3
+4
+7
+5
+4
+3
+3
+4
+4
+7
+3
+4
+4
+5
+3
+3
+4
+3
+3
+6
+3
+3
+7
+3
+3
+3
+3
+3
+4
+4
+3
+3
+3
+3
+3
+3
+5
+3
+3
+12
+3
+5
+7
+3
+9
+3
+4
+5
+6
+3
+4
+9
+7
+7
+5
+4
+16
+4
+3
+3
+4
+3
+3
+3
+7
+3
+6
+6
+3
+7
+4
+3
+6
+3
+4
+3
+3
+3
+5
+3
+4
+3
+3
+3
+4
+4
+4
+4
+3
+3
+4
+3
+4
+3
+3
+6
+4
+4
+5
+3
+7
+3
+4
+5
+10
+6
+3
+3
+3
+6
+4
+4
+4
+3
+3
+5
+3
+3
+3
+5
+3
+4
+3
+3
+3
+7
+4
+3
+5
+4
+4
+5
+3
+5
+3
+5
+27
+3
+3
+5
+3
+3
+3
+3
+3
+4
+16
+16
+4
+3
+3
+4
+3
+4
+3
+5
+5
+3
+3
+4
+3
+6
+5
+4
+4
+3
+3
+8
+3
+6
+4
+3
+3
+3
+3
+4
+3
+4
+3
+3
+3
+3
+5
+19
+4
+5
+3
+4
+3
+4
+5
+7
+3
+5
+7
+9
+10
+3
+3
+7
+3
+3
+4
+3
+3
+3
+6
+11
+5
+4
+3
+4
+4
+3
+3
+5
+4
+5
+3
+3
+6
+6
+4
+5
+3
+3
+5
+3
+4
+3
+3
+13
+4
+3
+5
+6
+5
+3
+3
+6
+3
+5
+4
+3
+4
+4
+3
+14
+3
+7
+3
+4
+3
+3
+4
+4
+3
+4
+3
+5
+8
+6
+16
+9
+16
+3
+3
+4
+4
+3
+3
+4
+3
+3
+5
+4
+3
+5
+3
+3
+3
+4
+4
+4
+3
+3
+3
+9
+18
+3
+9
+3
+3
+3
+6
+4
+4
+3
+3
+3
+7
+8
+3
+3
+8
+3
+9
+10
+5
+3
+3
+6
+7
+8
+5
+4
+15
+4
+3
+7
+3
+17
+4
+16
+3
+11
+3
+6
+5
+3
+3
+3
+3
+3
+3
+4
+3
+4
+3
+3
+5
+5
+3
+5
+3
+3
+3
+3
+3
+7
+10
+3
+8
+3
+3
+8
+7
+5
+3
+5
+3
+4
+4
+3
+4
+3
+4
+5
+3
+5
+4
+3
+3
+3
+5
+6
+3
+5
+3
+3
+3
+3
+3
+3
+10
+3
+3
+6
+5
+31
+3
+4
+3
+3
+3
+3
+3
+9
+4
+3
+4
+3
+11
+4
+11
+3
+3
+4
+10
+3
+3
+3
+3
+3
+3
+3
+14
+10
+3
+4
+3
+3
+4
+13
+3
+4
+4
+3
+3
+4
+5
+5
+3
+4
+3
+5
+3
+4
+7
+3
+4
+6
+5
+14
+3
+13
+3
+4
+3
+3
+4
+5
+3
+3
+6
+3
+6
+4
+7
+5
+3
+5
+3
+3
+4
+3
+17
+5
+3
+3
+3
+4
+4
+4
+7
+3
+7
+4
+3
+3
+11
+3
+3
+3
+4
+7
+4
+5
+5
+4
+3
+4
+9
+4
+3
+3
+7
+3
+3
+13
+4
+4
+3
+3
+4
+5
+7
+3
+4
+3
+3
+3
+4
+4
+8
+3
+3
+5
+3
+5
+3
+5
+5
+7
+6
+3
+3
+3
+3
+5
+3
+4
+3
+3
+4
+3
+3
+5
+12
+4
+4
+10
+4
+7
+3
+12
+6
+3
+9
+3
+4
+3
+4
+3
+3
+3
+4
+4
+4
+22
+3
+3
+4
+8
+3
+6
+8
+8
+4
+15
+7
+5
+3
+4
+10
+6
+4
+3
+10
+4
+3
+3
+3
+4
+3
+6
+6
+3
+9
+3
+5
+11
+3
+4
+9
+3
+3
+3
+4
+4
+3
+4
+10
+4
+3
+5
+8
+3
+4
+3
+14
+5
+3
+3
+8
+5
+3
+4
+4
+8
+3
+7
+3
+3
+3
+3
+3
+4
+3
+28
+3
+3
+3
+4
+3
+4
+3
+3
+4
+3
+3
+3
+9
+3
+3
+3
+3
+3
+6
+3
+3
+4
+8
+4
+3
+3
+4
+8
+3
+4
+5
+12
+3
+3
+5
+3
+6
+3
+6
+3
+3
+4
+3
+3
+6
+3
+3
+4
+3
+20
+3
+3
+3
+4
+5
+3
+3
+8
+3
+4
+7
+4
+3
+3
+14
+6
+3
+9
+3
+4
+3
+10
+5
+3
+14
+3
+4
+3
+6
+3
+3
+6
+17
+3
+3
+8
+7
+3
+4
+4
+11
+3
+3
+3
+5
+5
+4
+4
+3
+4
+7
+95
+3
+3
+3
+4
+3
+7
+4
+3
+4
+3
+4
+4
+5
+3
+4
+3
+4
+5
+3
+4
+3
+3
+3
+3
+4
+3
+3
+3
+5
+3
+3
+3
+3
+11
+3
+3
+8
+3
+12
+3
+4
+6
+8
+3
+5
+6
+4
+6
+6
+4
+3
+3
+3
+3
+3
+17
+3
+3
+7
+4
+3
+4
+3
+6
+3
+3
+3
+3
+3
+3
+5
+32
+3
+5
+5
+4
+5
+3
+4
+3
+3
+3
+3
+4
+4
+17
+3
+3
+3
+3
+3
+9
+3
+10
+5
+7
+4
+5
+4
+3
+3
+3
+3
+3
+3
+3
+4
+3
+3
+3
+3
+8
+8
+7
+3
+6
+4
+3
+5
+3
+8
+3
+5
+4
+8
+4
+3
+3
+3
+6
+3
+6
+8
+7
+3
+5
+5
+6
+10
+3
+5
+3
+3
+3
+4
+3
+6
+3
+9
+3
+3
+4
+3
+3
+4
+3
+3
+4
+5
+4
+3
+3
+3
+5
+4
+4
+3
+4
+4
+3
+3
+4
+3
+5
+3
+4
+9
+3
+4
+5
+3
+5
+4
+3
+3
+3
+3
+4
+3
+8
+5
+4
+3
+3
+4
+7
+3
+3
+3
+3
+3
+3
+4
+3
+3
+38
+4
+3
+3
+5
+3
+5
+3
+3
+8
+4
+6
+4
+3
+3
+3
+3
+4
+5
+3
+6
+3
+10
+3
+4
+4
+3
+12
+5
+27
+8
+5
+10
+3
+3
+3
+5
+4
+3
+8
+3
+3
+6
+3
+4
+3
+4
+5
+3
+3
+3
+3
+3
+3
+3
+6
+6
+6
+3
+3
+4
+4
+3
+4
+3
+4
+10
+3
+3
+18
+6
+3
+12
+3
+3
+4
+4
+3
+4
+3
+4
+3
+4
+5
+4
+5
+4
+13
+3
+7
+4
+4
+4
+3
+4
+9
+3
+4
+3
+4
+9
+9
+4
+7
+3
+3
+3
+5
+4
+5
+3
+3
+4
+37
+6
+3
+3
+3
+16
+3
+5
+4
+4
+3
+3
+3
+5
+4
+7
+7
+3
+3
+3
+27
+3
+3
+3
+11
+3
+6
+3
+4
+3
+3
+4
+6
+3
+3
+4
+4
+4
+3
+3
+3
+4
+5
+3
+3
+3
+4
+4
+36
+4
+3
+4
+3
+4
+6
+7
+4
+3
+3
+4
+10
+7
+3
+8
+3
+3
+4
+5
+14
+4
+3
+9
+17
+3
+5
+6
+13
+3
+3
+3
+4
+4
+3
+3
+4
+3
+3
+3
+3
+5
+3
+5
+3
+3
+40
+3
+3
+5
+6
+3
+6
+4
+3
+4
+3
+6
+20
+4
+3
+4
+3
+24
+3
+3
+5
+4
+4
+6
+6
+4
+8
+3
+14
+3
+4
+7
+3
+5
+4
+3
+3
+6
+3
+5
+3
+6
+5
+8
+6
+3
+4
+4
+8
+3
+3
+6
+6
+3
+3
+8
+3
+3
+6
+8
+3
+3
+3
+6
+3
+3
+3
+3
+7
+5
+4
+4
+3
+3
+3
+7
+3
+4
+5
+3
+4
+3
+9
+3
+9
+13
+5
+4
+4
+3
+9
+3
+3
+3
+3
+3
+3
+3
+6
+20
+4
+3
+4
+4
+4
+8
+3
+4
+3
+4
+4
+3
+3
+3
+3
+4
+59
+3
+5
+4
+5
+6
+5
+4
+3
+4
+9
+10
+4
+6
+3
+5
+3
+4
+5
+3
+3
+4
+4
+3
+3
+3
+7
+3
+11
+3
+4
+3
+3
+8
+4
+3
+3
+3
+3
+5
+3
+10
+4
+5
+3
+4
+3
+8
+3
+3
+11
+32
+3
+11
+4
+3
+3
+3
+3
+5
+3
+4
+3
+3
+3
+3
+6
+3
+4
+4
+3
+3
+4
+4
+3
+3
+4
+4
+4
+13
+3
+3
+4
+3
+7
+3
+4
+3
+4
+3
+3
+3
+4
+3
+4
+9
+4
+3
+3
+39
+4
+3
+3
+4
+3
+3
+3
+3
+3
+4
+7
+5
+4
+3
+5
+3
+4
+4
+3
+3
+4
+3
+3
+3
+3
+3
+3
+3
+26
+3
+3
+3
+12
+5
+5
+6
+9
+3
+4
+6
+3
+5
+8
+5
+9
+4
+3
+6
+3
+3
+3
+3
+3
+4
+6
+3
+3
+5
+3
+3
+3
+3
+3
+3
+4
+4
+4
+3
+3
+3
+3
+3
+3
+4
+3
+4
+3
+3
+3
+3
+3
+4
+3
+3
+4
+8
+4
+8
+3
+3
+3
+3
+4
+9
+4
+3
+4
+3
+5
+4
+4
+5
+4
+8
+3
+3
+4
+4
+4
+9
+4
+8
+3
+15
+8
+3
+3
+4
+5
+4
+3
+3
+3
+3
+3
+3
+4
+9
+3
+6
+4
+4
+3
+5
+4
+5
+3
+3
+4
+4
+8
+6
+6
+3
+4
+3
+3
+13
+3
+3
+16
+11
+4
+5
+5
+3
+8
+3
+4
+7
+3
+3
+3
+5
+32
+3
+4
+3
+3
+3
+3
+5
+3
+5
+3
+8
+5
+3
+4
+3
+5
+4
+4
+3
+4
+15
+7
+4
+4
+4
+7
+3
+6
+4
+4
+3
+3
+4
+3
+5
+4
+4
+3
+4
+4
+6
+5
+3
+6
+12
+4
+5
+4
+5
+3
+22
+3
+4
+15
+6
+3
+3
+7
+4
+3
+3
+4
+4
+3
+3
+6
+5
+6
+8
+4
+3
+3
+17
+11
+9
+3
+4
+6
+5
+4
+4
+3
+3
+7
+5
+3
+3
+5
+4
+8
+4
+4
+4
+4
+3
+3
+3
+4
+3
+3
+6
+3
+4
+4
+3
+6
+3
+4
+5
+3
+3
+3
+10
+3
+3
+3
+5
+3
+3
+4
+3
+4
+7
+4
+3
+6
+4
+6
+39
+5
+4
+3
+3
+6
+3
+6
+12
+3
+4
+3
+14
+3
+3
+11
+3
+5
+4
+3
+4
+14
+4
+4
+3
+3
+29
+7
+3
+3
+3
+37
+3
+3
+4
+3
+4
+3
+26
+4
+6
+3
+5
+5
+3
+3
+4
+6
+3
+3
+4
+8
+4
+3
+8
+7
+58
+3
+3
+4
+3
+5
+3
+4
+4
+6
+3
+4
+6
+3
+3
+3
+3
+6
+3
+10
+3
+4
+3
+3
+7
+3
+10
+7
+7
+3
+4
+3
+4
+4
+3
+3
+3
+4
+6
+3
+3
+5
+3
+6
+7
+3
+3
+3
+3
+4
+3
+4
+4
+9
+3
+3
+5
+3
+3
+3
+3
+5
+5
+3
+3
+3
+3
+17
+9
+3
+3
+3
+3
+10
+4
+4
+5
+3
+4
+3
+3
+3
+3
+4
+9
+3
+13
+7
+10
+3
+3
+3
+3
+3
+3
+4
+3
+3
+4
+3
+4
+4
+6
+3
+3
+3
+6
+3
+4
+3
+3
+4
+4
+3
+4
+5
+5
+4
+6
+3
+6
+3
+3
+11
+3
+3
+3
+5
+5
+6
+3
+4
+14
+4
+3
+9
+4
+4
+11
+3
+5
+3
+3
+4
+6
+3
+74
+3
+5
+5
+7
+6
+3
+4
+8
+13
+8
+4
+15
+4
+3
+27
+3
+3
+3
+3
+8
+4
+3
+12
+5
+7
+3
+4
+4
+6
+3
+3
+3
+5
+3
+3
+6
+12
+5
+3
+6
+3
+4
+7
+3
+3
+3
+4
+3
+5
+3
+4
+4
+3
+3
+9
+4
+3
+6
+3
+4
+10
+8
+4
+7
+6
+3
+3
+5
+3
+4
+3
+3
+3
+3
+7
+3
+6
+3
+3
+4
+3
+3
+4
+4
+3
+6
+3
+17
+3
+4
+36
+4
+6
+3
+3
+3
+4
+8
+3
+5
+4
+3
+4
+5
+3
+3
+3
+3
+3
+3
+10
+8
+3
+4
+3
+5
+5
+4
+5
+5
+4
+3
+3
+4
+3
+5
+3
+4
+3
+7
+3
+3
+3
+3
+3
+9
+3
+4
+3
+3
+3
+4
+3
+6
+4
+3
+3
+3
+4
+4
+4
+8
+4
+4
+8
+3
+3
+3
+3
+4
+6
+3
+4
+4
+7
+3
+5
+3
+4
+7
+5
+3
+5
+7
+6
+3
+3
+4
+3
+7
+4
+4
+3
+3
+3
+3
+3
+8
+3
+6
+3
+6
+3
+16
+6
+3
+7
+3
+9
+4
+3
+6
+3
+3
+3
+13
+3
+6
+3
+4
+4
+3
+12
+3
+5
+7
+5
+3
+3
+8
+6
+3
+4
+4
+18
+3
+3
+3
+3
+3
+4
+5
+6
+3
+4
+16
+3
+4
+4
+5
+5
+3
+3
+3
+6
+3
+6
+4
+7
+5
+3
+6
+3
+3
+6
+3
+4
+4
+4
+3
+5
+4
+3
+3
+3
+4
+4
+5
+5
+3
+8
+3
+5
+3
+4
+3
+4
+15
+3
+10
+3
+4
+5
+3
+3
+3
+3
+6
+6
+3
+4
+8
+4
+3
+3
+3
+3
+5
+3
+4
+13
+6
+8
+3
+5
+3
+5
+3
+12
+3
+3
+3
+3
+6
+11
+3
+3
+3
+4
+6
+3
+4
+3
+4
+3
+13
+3
+3
+5
+70
+5
+4
+16
+3
+7
+5
+6
+3
+3
+7
+6
+3
+6
+4
+5
+3
+4
+3
+3
+3
+3
+4
+3
+7
+11
+4
+4
+6
+3
+6
+10
+3
+6
+3
+3
+4
+3
+3
+3
+4
+7
+5
+10
+5
+10
+3
+4
+3
+3
+4
+12
+4
+3
+3
+13
+3
+3
+3
+5
+3
+4
+4
+5
+3
+4
+3
+3
+5
+4
+6
+3
+3
+3
+3
+4
+5
+5
+3
+3
+3
+4
+3
+3
+3
+3
+4
+3
+3
+3
+4
+14
+7
+4
+3
+3
+4
+3
+4
+3
+4
+10
+4
+3
+6
+4
+3
+6
+3
+3
+3
+3
+3
+7
+3
+35
+3
+8
+3
+22
+3
+3
+3
+3
+4
+4
+6
+5
+3
+3
+4
+6
+3
+15
+4
+3
+4
+7
+3
+6
+3
+4
+3
+3
+8
+3
+11
+3
+6
+4
+3
+4
+7
+3
+3
+4
+5
+3
+4
+3
+3
+3
+4
+3
+10
+11
+3
+3
+9
+3
+10
+6
+55
+4
+12
+3
+3
+3
+5
+3
+3
+12
+6
+3
+6
+3
+16
+3
+3
+4
+8
+3
+16
+3
+4
+3
+6
+5
+3
+3
+3
+3
+3
+3
+4
+4
+4
+4
+4
+3
+3
+5
+6
+6
+4
+4
+5
+3
+3
+4
+3
+3
+7
+4
+4
+4
+4
+3
+5
+4
+3
+3
+5
+6
+7
+4
+3
+3
+4
+4
+6
+25
+3
+5
+6
+4
+4
+4
+3
+3
+5
+3
+3
+3
+3
+3
+3
+3
+3
+6
+4
+4
+3
+4
+4
+3
+3
+3
+10
+5
+4
+3
+5
+3
+8
+4
+3
+4
+3
+5
+5
+4
+4
+17
+4
+4
+3
+4
+5
+8
+5
+3
+4
+4
+5
+3
+3
+4
+4
+3
+3
+3
+13
+9
+5
+3
+3
+4
+3
+3
+3
+3
+3
+4
+3
+23
+6
+4
+3
+4
+3
+3
+3
+4
+3
+8
+11
+3
+14
+7
+6
+3
+3
+3
+3
+3
+5
+3
+4
+3
+3
+3
+3
+3
+6
+3
+11
+3
+3
+3
+5
+3
+3
+3
+7
+3
+3
+3
+6
+3
+4
+3
+3
+4
+3
+3
+3
+3
+4
+17
+14
+4
+3
+3
+3
+6
+3
+3
+4
+17
+6
+5
+4
+3
+5
+7
+7
+7
+3
+4
+6
+4
+3
+3
+3
+4
+4
+3
+3
+3
+9
+5
+6
+3
+6
+8
+8
+4
+4
+3
+3
+4
+6
+5
+3
+3
+4
+8
+4
+4
+4
+3
+47
+4
+3
+3
+3
+3
+5
+3
+3
+14
+3
+10
+7
+3
+9
+10
+6
+4
+3
+5
+9
+4
+5
+3
+3
+3
+3
+3
+5
+4
+7
+4
+3
+7
+3
+19
+3
+4
+3
+7
+3
+3
+3
+12
+3
+6
+3
+5
+4
+5
+3
+3
+3
+6
+3
+3
+7
+3
+3
+3
+7
+4
+4
+3
+3
+4
+7
+13
+3
+12
+3
+6
+20
+4
+3
+4
+3
+3
+4
+3
+5
+7
+3
+6
+4
+3
+3
+3
+3
+3
+3
+3
+3
+5
+15
+3
+6
+3
+3
+3
+8
+8
+5
+3
+3
+6
+3
+3
+3
+4
+8
+8
+3
+4
+3
+3
+3
+3
+4
+8
+8
+5
+4
+3
+3
+19
+5
+5
+3
+5
+6
+5
+3
+4
+3
+3
+3
+5
+3
+5
+3
+3
+4
+3
+3
+3
+3
+5
+11
+4
+13
+5
+5
+3
+3
+6
+4
+7
+5
+6
+3
+4
+10
+4
+4
+3
+15
+8
+4
+3
+11
+4
+3
+4
+3
+4
+4
+5
+3
+3
+4
+5
+5
+3
+5
+3
+8
+3
+7
+14
+3
+8
+5
+3
+3
+3
+3
+3
+6
+3
+3
+3
+8
+3
+3
+3
+6
+4
+4
+7
+4
+3
+3
+3
+3
+5
+5
+5
+3
+3
+3
+3
+3
+5
+4
+5
+6
+3
+5
+3
+4
+4
+3
+7
+4
+3
+5
+9
+3
+3
+3
+8
+3
+3
+3
+8
+3
+20
+3
+6
+3
+3
+3
+8
+7
+3
+3
+3
+3
+6
+3
+3
+3
+4
+14
+6
+3
+5
+3
+3
+5
+3
+5
+6
+3
+3
+3
+8
+4
+3
+3
+4
+26
+3
+3
+4
+3
+4
+4
+18
+3
+3
+5
+3
+5
+11
+3
+3
+9
+3
+3
+5
+3
+5
+5
+3
+26
+3
+7
+3
+4
+3
+4
+4
+3
+3
+32
+3
+4
+4
+4
+20
+5
+3
+4
+3
+4
+5
+3
+4
+3
+4
+3
+3
+4
+3
+3
+4
+3
+3
+3
+19
+44
+8
+3
+3
+4
+4
+5
+7
+7
+4
+3
+4
+3
+3
+4
+3
+6
+4
+4
+3
+5
+3
+4
+6
+15
+3
+3
+3
+3
+6
+4
+3
+13
+3
+3
+5
+3
+4
+9
+3
+5
+8
+5
+4
+4
+3
+3
+4
+12
+8
+3
+3
+4
+7
+4
+3
+6
+3
+3
+3
+4
+3
+3
+3
+3
+3
+10
+4
+7
+7
+4
+4
+3
+9
+3
+6
+9
+6
+4
+10
+4
+3
+3
+16
+3
+3
+3
+3
+11
+3
+4
+9
+3
+3
+3
+4
+4
+3
+7
+4
+14
+3
+5
+4
+5
+5
+10
+4
+3
+4
+3
+3
+3
+4
+3
+3
+9
+3
+6
+3
+4
+5
+5
+4
+3
+5
+3
+4
+20
+4
+3
+4
+3
+5
+5
+3
+3
+3
+3
+3
+6
+4
+4
+6
+3
+7
+3
+5
+3
+10
+4
+4
+3
+4
+3
+5
+4
+3
+3
+4
+3
+3
+12
+4
+4
+4
+6
+8
+6
+3
+3
+3
+17
+5
+4
+3
+7
+4
+5
+3
+4
+4
+9
+4
+9
+5
+3
+7
+3
+5
+3
+10
+4
+5
+4
+4
+4
+3
+3
+3
+4
+4
+14
+3
+3
+3
+5
+11
+4
+3
+4
+3
+20
+7
+4
+6
+3
+3
+5
+4
+3
+5
+8
+12
+3
+4
+3
+3
+3
+5
+3
+3
+9
+4
+4
+3
+9
+3
+6
+3
+5
+3
+4
+3
+4
+3
+4
+3
+8
+3
+3
+3
+5
+8
+3
+5
+3
+7
+3
+6
+3
+6
+3
+4
+3
+7
+3
+3
+6
+5
+4
+5
+4
+3
+5
+8
+3
+3
+7
+5
+4
+3
+5
+3
+3
+3
+3
+3
+5
+6
+4
+4
+3
+3
+3
+3
+3
+6
+3
+6
+6
+3
+3
+3
+5
+4
+4
+22
+7
+3
+9
+3
+3
+4
+6
+3
+6
+7
+3
+3
+7
+4
+3
+4
+4
+3
+3
+7
+3
+3
+61
+5
+5
+3
+4
+3
+4
+7
+3
+7
+3
+3
+4
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..59990a1
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,508 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2014-09-12.12; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+tab=' '
+nl='
+'
+IFS=" $tab$nl"
+
+# Set DOITPROG to "echo" to test this script.
+
+doit=${DOITPROG-}
+doit_exec=${doit:-exec}
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+is_target_a_directory=possibly
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t)
+ is_target_a_directory=always
+ dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
+
+ -T) is_target_a_directory=never;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+ if test -n "$dst_arg"; then
+ echo "$0: target directory not allowed when installing a directory." >&2
+ exit 1
+ fi
+fi
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call 'install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ if test $# -gt 1 || test "$is_target_a_directory" = always; then
+ if test ! -d "$dst_arg"; then
+ echo "$0: $dst_arg: Is not a directory." >&2
+ exit 1
+ fi
+ fi
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names problematic for 'test' and other utilities.
+ case $src in
+ -* | [=\(\)!]) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+ dst=$dst_arg
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test "$is_target_a_directory" = never; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ dstdir=`dirname "$dst"`
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ # $RANDOM is not portable (e.g. dash); use it when possible to
+ # lower collision chance
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ # As "mkdir -p" follows symlinks and we work in /tmp possibly; so
+ # create the $tmpdir first (and fail if unsuccessful) to make sure
+ # that nobody tries to guess the $tmpdir name.
+ if (umask $mkdir_umask &&
+ $mkdirprog $mkdir_mode "$tmpdir" &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ test_tmpdir="$tmpdir/a"
+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ oIFS=$IFS
+ IFS=/
+ set -f
+ set fnord $dstdir
+ shift
+ set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+ set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ set +f &&
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/missing b/missing
new file mode 100755
index 0000000..f62bbae
--- /dev/null
+++ b/missing
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2013-10-28.13; # UTC
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+fi
+
+case $1 in
+
+ --is-lightweight)
+ # Used by our autoconf macros to check whether the available missing
+ # script is modern enough.
+ exit 0
+ ;;
+
+ --run)
+ # Back-compat with the calling convention used by older automake.
+ shift
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+
+Supported PROGRAM values:
+ aclocal autoconf autoheader autom4te automake makeinfo
+ bison yacc flex lex help2man
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: unknown '$1' option"
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch. This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+ msg="probably too old"
+elif test $st -eq 127; then
+ # Program was missing.
+ msg="missing on your system"
+else
+ # Program was found and executed, but failed. Give up.
+ exit $st
+fi
+
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+ case $1 in
+ aclocal|automake)
+ echo "The '$1' program is part of the GNU Automake package:"
+ echo "<$gnu_software_URL/automake>"
+ echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/autoconf>"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ autoconf|autom4te|autoheader)
+ echo "The '$1' program is part of the GNU Autoconf package:"
+ echo "<$gnu_software_URL/autoconf/>"
+ echo "It also requires GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ esac
+}
+
+give_advice ()
+{
+ # Normalize program name to check for.
+ normalized_program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+ printf '%s\n' "'$1' is $msg."
+
+ configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+ case $normalized_program in
+ autoconf*)
+ echo "You should only need it if you modified 'configure.ac',"
+ echo "or m4 files included by it."
+ program_details 'autoconf'
+ ;;
+ autoheader*)
+ echo "You should only need it if you modified 'acconfig.h' or"
+ echo "$configure_deps."
+ program_details 'autoheader'
+ ;;
+ automake*)
+ echo "You should only need it if you modified 'Makefile.am' or"
+ echo "$configure_deps."
+ program_details 'automake'
+ ;;
+ aclocal*)
+ echo "You should only need it if you modified 'acinclude.m4' or"
+ echo "$configure_deps."
+ program_details 'aclocal'
+ ;;
+ autom4te*)
+ echo "You might have modified some maintainer files that require"
+ echo "the 'autom4te' program to be rebuilt."
+ program_details 'autom4te'
+ ;;
+ bison*|yacc*)
+ echo "You should only need it if you modified a '.y' file."
+ echo "You may want to install the GNU Bison package:"
+ echo "<$gnu_software_URL/bison/>"
+ ;;
+ lex*|flex*)
+ echo "You should only need it if you modified a '.l' file."
+ echo "You may want to install the Fast Lexical Analyzer package:"
+ echo "<$flex_URL>"
+ ;;
+ help2man*)
+ echo "You should only need it if you modified a dependency" \
+ "of a man page."
+ echo "You may want to install the GNU Help2man package:"
+ echo "<$gnu_software_URL/help2man/>"
+ ;;
+ makeinfo*)
+ echo "You should only need it if you modified a '.texi' file, or"
+ echo "any other file indirectly affecting the aspect of the manual."
+ echo "You might want to install the Texinfo package:"
+ echo "<$gnu_software_URL/texinfo/>"
+ echo "The spurious makeinfo call might also be the consequence of"
+ echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+ echo "want to install GNU make:"
+ echo "<$gnu_software_URL/make/>"
+ ;;
+ *)
+ echo "You might have modified some files without having the proper"
+ echo "tools for further handling them. Check the 'README' file, it"
+ echo "often tells you about the needed prerequisites for installing"
+ echo "this package. You may also peek at any GNU archive site, in"
+ echo "case some other package contains this missing '$1' program."
+ ;;
+ esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+ -e '2,$s/^/ /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..6dc420d
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,5 @@
+include ./common.mk
+SUBDIRS= ba er graph_info dms bb_fitness bbv conf deg_seq \
+power_law shortest components kruskal clust fitmle dijkstra \
+f3m betweenness label_prop cnm johnson gn modularity pm knn \
+hidden ws
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..ffe67b2
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,580 @@
+# 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 = src
+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 $(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 =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/./common.mk $(srcdir)/Makefile.in TODO
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+SUBDIRS = ba er graph_info dms bb_fitness bbv conf deg_seq \
+power_law shortest components kruskal clust fitmle dijkstra \
+f3m betweenness label_prop cnm johnson gn modularity pm knn \
+hidden ws
+
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/./common.mk $(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 src/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/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;
+$(srcdir)/./common.mk $(am__empty):
+
+$(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):
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+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-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+ check-am clean clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-generic distclean-tags distdir dvi dvi-am \
+ html html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# 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/src/TODO b/src/TODO
new file mode 100644
index 0000000..aacf946
--- /dev/null
+++ b/src/TODO
@@ -0,0 +1,24 @@
+
+- make a standalone library with all the algorithms
+
+
+
+- conf/conf_model.c:
+ - SISTEMARE LA DEFINIZIONE DELLA THRESHOLD DI MATCHING
+
+- OVUNQUE: SOSTITUIRE LONG DOUBLE CON LONG LONG INT. Piu' robusto.
+
+- MAKE AN IMPROVED VERSION OF RELABEL
+
+
+- aggiungere al Makefile:
+ - relabel
+ - graph_info
+ - pm_new (the power method)
+ - dms (Dorogovtsev-Mendes-Samukin)
+ - knn_new (knn with linear or exponential binning)
+ - pearson (assortativity coefficient)
+ - bb_fitness (Bianconi-Barabasi)
+ - bto (Border-Toll Optimisation -- Tempered PA)
+ - deg_dist_w (degree-strength disribution)
+ - clust_w
diff --git a/src/ba/Makefile.am b/src/ba/Makefile.am
new file mode 100644
index 0000000..f7238ca
--- /dev/null
+++ b/src/ba/Makefile.am
@@ -0,0 +1,3 @@
+include ../common.mk
+bin_PROGRAMS = ba
+ba_SOURCES = ba.c
diff --git a/src/ba/Makefile.in b/src/ba/Makefile.in
new file mode 100644
index 0000000..81afc0b
--- /dev/null
+++ b/src/ba/Makefile.in
@@ -0,0 +1,564 @@
+# 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 = :
+bin_PROGRAMS = ba$(EXEEXT)
+subdir = src/ba
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_ba_OBJECTS = ba.$(OBJEXT)
+ba_OBJECTS = $(am_ba_OBJECTS)
+ba_LDADD = $(LDADD)
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(ba_SOURCES)
+DIST_SOURCES = $(ba_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+ba_SOURCES = ba.c
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/ba/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/ba/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+ba$(EXEEXT): $(ba_OBJECTS) $(ba_DEPENDENCIES) $(EXTRA_ba_DEPENDENCIES)
+ @rm -f ba$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ba_OBJECTS) $(ba_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ba.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/ba/ba.c b/src/ba/ba.c
new file mode 100644
index 0000000..e395d6d
--- /dev/null
+++ b/src/ba/ba.c
@@ -0,0 +1,185 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ *
+ * This program grows a network with N nodes using the linear
+ * preferential attachment model proposed by Barabasi and
+ * Albert. Each new node creates m links, and the initial (seed)
+ * network is a ring of n0>=m nodes.
+ *
+ *
+ * References:
+ *
+ * [1] A.-L. Barabasi, R. Albert, "Emergence of scaling in random
+ * networks", Science 286, 509-512 (1999).
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- ba -*- **\n"
+ "** **\n"
+ "** Grow a scale-free network of 'N' nodes using the linear **\n"
+ "** preferential attachment model (Barabasi-Albert). **\n"
+ "** The initial network is a ring of 'n0' nodes, and each new **\n"
+ "** node creates 'm' edges. **\n"
+ "** **\n"
+ "** The program prints on STDOUT the edge-list of the final **\n"
+ "** graph. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <N> <m> <n0>\n", argv[0]);
+
+}
+
+
+
+int init_network(unsigned int **S, unsigned int n0){
+
+ int n;
+
+ for(n=0; n<n0; n++){
+ S[0][n] = n;
+ S[1][n] = (n+1) % n0;
+ }
+ return n;
+}
+
+int select_neighbour(unsigned int **S, unsigned int S_num){
+
+ int d;
+
+ d = rand()%(S_num * 2);
+ if (d < S_num)
+ return S[0][d];
+ else{
+ return S[1][d-S_num];
+ }
+}
+
+/* check if 'd' is already a neighbour of 'i' */
+
+int already_neighbour(unsigned int **S, unsigned int S_num, unsigned int j, unsigned int d){
+
+ int i;
+
+ for(i=S_num; i< S_num + j; i ++){
+ if (S[1][i] == d)
+ return 1;
+ }
+ return 0;
+}
+
+unsigned int grow_ba_network(unsigned int **S, unsigned int N,
+ unsigned int m, unsigned int n0, unsigned int S_num){
+
+ int i, j;
+ int n, d;
+
+ for(i=0; i<N-n0; i++){
+ /* Let's add a new node */
+ n = n0 + i; /* This is the id of the new node */
+ for(j=0; j<m; j++){
+ S[0][S_num+j] = n;
+ d = select_neighbour(S, S_num);
+ while(already_neighbour(S, S_num, j, d)){
+ d = select_neighbour(S, S_num);
+ }
+ S[1][S_num + j] = d;
+ }
+ S_num += m;
+ }
+ return S_num;
+}
+
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int **S;
+ unsigned int S_num, S_size, i;
+ int m, n0, N;
+
+ if (argc < 4){
+ usage(argv);
+ exit(1);
+ }
+
+ srand(time(NULL));
+
+ N = atoi(argv[1]);
+ m = atoi(argv[2]);
+ n0 = atoi(argv[3]);
+ S_size = (N+n0) * m ;
+
+ if (N < 1){
+ fprintf(stderr, "N must be positive\n");
+ exit(1);
+ }
+ if(m > n0){
+ fprintf(stderr, "n0 cannot be smaller than m\n");
+ exit(1);
+
+ }
+ if (n0<1){
+ fprintf(stderr, "n0 must be positive\n");
+ exit(1);
+ }
+
+ if (m < 1){
+ fprintf(stderr, "m must be positive\n");
+ exit(1);
+ }
+
+ S = malloc(2 * sizeof(unsigned int*));
+ S[0] = malloc(S_size * sizeof(unsigned int));
+ S[1] = malloc(S_size * sizeof(unsigned int));
+
+ S_num = init_network(S, n0);
+ S_num = grow_ba_network(S, N, m, n0, S_num);
+ for(i=0; i<S_num; i ++){
+ printf("%d %d\n",S[0][i], S[1][i]);
+ }
+ free(S[0]);
+ free(S[1]);
+ free(S);
+}
diff --git a/src/bb_fitness/Makefile.am b/src/bb_fitness/Makefile.am
new file mode 100644
index 0000000..7e1f6ad
--- /dev/null
+++ b/src/bb_fitness/Makefile.am
@@ -0,0 +1,5 @@
+include ../common.mk
+bin_PROGRAMS = bb_fitness
+bb_fitness_SOURCES = bb_fitness.c ../utils/utils.c ../utils/cum_distr.c \
+../include/utils.h ../include/cum_distr.h
+bb_fitness_LDADD = -lm
diff --git a/src/bb_fitness/Makefile.in b/src/bb_fitness/Makefile.in
new file mode 100644
index 0000000..f52c9c6
--- /dev/null
+++ b/src/bb_fitness/Makefile.in
@@ -0,0 +1,584 @@
+# 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 = :
+bin_PROGRAMS = bb_fitness$(EXEEXT)
+subdir = src/bb_fitness
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_bb_fitness_OBJECTS = bb_fitness.$(OBJEXT) ../utils/utils.$(OBJEXT) \
+ ../utils/cum_distr.$(OBJEXT)
+bb_fitness_OBJECTS = $(am_bb_fitness_OBJECTS)
+bb_fitness_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(bb_fitness_SOURCES)
+DIST_SOURCES = $(bb_fitness_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+bb_fitness_SOURCES = bb_fitness.c ../utils/utils.c ../utils/cum_distr.c \
+../include/utils.h ../include/cum_distr.h
+
+bb_fitness_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/bb_fitness/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/bb_fitness/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/cum_distr.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+bb_fitness$(EXEEXT): $(bb_fitness_OBJECTS) $(bb_fitness_DEPENDENCIES) $(EXTRA_bb_fitness_DEPENDENCIES)
+ @rm -f bb_fitness$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(bb_fitness_OBJECTS) $(bb_fitness_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/cum_distr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bb_fitness.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/bb_fitness/bb_fitness.c b/src/bb_fitness/bb_fitness.c
new file mode 100644
index 0000000..9f67c74
--- /dev/null
+++ b/src/bb_fitness/bb_fitness.c
@@ -0,0 +1,241 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program implements the fitness model proposed by Bianconi and
+ * Barabasi, where the attachment probability is:
+ *
+ * \Pi_{i->j} \propto a_j * k_j
+ *
+ * where a_j is the actractiveness of node j.
+ *
+ *
+ * References:
+ *
+ * [1] G. Bianconi, A.-L. Barabasi, " Competition and multiscaling in
+ * evolving networks". EPL-Europhys. Lett. 54 (2001), 436.
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+#include "utils.h"
+#include "cum_distr.h"
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- bb_fitness -*- **\n"
+ "** **\n"
+ "** Grow a network of 'N' nodes using the fitness model proposed **\n"
+ "** by Bianconi and Barabasi. **\n"
+ "** **\n"
+ "** The initial network is a clique of 'n0' nodes, and each new **\n"
+ "** node creates 'm' edges. The attachment probability is of **\n"
+ "** the form: **\n"
+ "** **\n"
+ "** P(i->j) ~ a_j * k_j **\n"
+ "** **\n"
+ "** where a_j is the attractiveness of node j. The values of **\n"
+ "** node attractiveness are sampled uniformly at random in **\n"
+ "** [0,1]. **\n"
+ "** **\n"
+ "** The program prints on STDOUT the edge-list of the final **\n"
+ "** graph. **\n"
+ "** **\n"
+ "** If 'FIT' is specified as a fourth parameter, the values **\n"
+ "** of node attractiveness are printed on STDERR. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <N> <m> <n0> [SHOW]\n", argv[0]);
+}
+
+
+
+
+int init_network(unsigned int *I, unsigned int *J, int n0,
+ double *a, cum_distr_t *d){
+
+ unsigned int n, i, S_num;
+
+
+ S_num = 0;
+ for(n=0; n<n0; n++){
+ for(i=n+1; i<n0; i++){
+ I[S_num] = n;
+ J[S_num] = i % n0;
+ S_num += 1;
+ }
+ cum_distr_add(d, n, n0*a[n]);
+ }
+ return S_num;
+}
+
+int already_neighbour(unsigned int *J, int S_num, int j, int dest){
+
+ int i;
+
+ for(i=S_num; i< S_num + j; i ++){
+ if (J[i] == dest)
+ return 1;
+ }
+ return 0;
+}
+
+
+
+int bb_fitness(unsigned int *I, unsigned int *J, unsigned int N,
+ unsigned int m, unsigned int n0, double* a){
+
+ cum_distr_t *d = NULL;
+ unsigned int n, j, dest, S_num;
+
+ d = cum_distr_init(N * m);
+
+ S_num = init_network(I, J, n0, a, d);
+
+
+ n = n0;
+ while (n<N){
+ for(j=0; j<m; j++){
+ I[S_num+j] = n;
+ dest = cum_distr_sample(d);
+ while(already_neighbour(J, S_num, j, dest)){
+ dest = cum_distr_sample(d);
+ }
+ J[S_num + j] = dest;
+ }
+ cum_distr_add(d, n, m*a[n]);
+ for (j=0; j<m; j++){
+ cum_distr_add(d, J[S_num + j], a[ J[S_num + j] ]);
+ }
+ S_num += m;
+ n += 1;
+ }
+ cum_distr_destroy(d);
+ return S_num;
+}
+
+void dump_graph(unsigned int *I, unsigned int *J, unsigned int K){
+
+ unsigned int i;
+
+ for(i=0; i<K; i++){
+ printf("%d %d\n", J[i], I[i]);
+ }
+
+}
+
+
+void init_fitness_uniform(double *a, unsigned int N){
+
+ unsigned int i;
+
+ for(i=0; i<N; i++){
+ a[i] = 1.0 * rand() / RAND_MAX;
+ }
+
+}
+
+
+void dump_fitness(double *a, unsigned int N){
+
+ int i;
+
+ for(i=0; i<N; i++){
+ fprintf(stderr, "%g\n", a[i]);
+ }
+}
+
+
+int main(int argc, char *argv[]){
+
+ int N, m, n0, K;
+ unsigned int *I, *J;
+ double *a;
+
+ if (argc < 4){
+ usage(argv);
+ exit(1);
+ }
+
+ N = atoi(argv[1]);
+ m = atoi(argv[2]);
+ n0 = atoi(argv[3]);
+
+ a = malloc(N * sizeof(double));
+
+ srand(time(NULL));
+
+ if (N < 1){
+ fprintf(stderr, "N must be positive\n");
+ exit(1);
+ }
+ if(m > n0){
+ fprintf(stderr, "n0 cannot be smaller than m\n");
+ exit(1);
+
+ }
+ if (n0<1){
+ fprintf(stderr, "n0 must be positive\n");
+ exit(1);
+ }
+
+ if (m < 1){
+ fprintf(stderr, "m must be positive\n");
+ exit(1);
+ }
+
+ I = malloc(N * m * sizeof(unsigned int));
+ J = malloc(N * m * sizeof(unsigned int));
+ a = malloc(N * sizeof(double));
+
+ init_fitness_uniform(a, N);
+
+ K = bb_fitness(I, J, N, m, n0, a);
+
+ dump_graph(I, J, K);
+ if (argc > 4 && !my_strcasecmp(argv[4], "SHOW")){
+ dump_fitness(a, N);
+ }
+ free(a);
+ free(I);
+ free(J);
+
+}
diff --git a/src/bbv/Makefile.am b/src/bbv/Makefile.am
new file mode 100644
index 0000000..0ed1800
--- /dev/null
+++ b/src/bbv/Makefile.am
@@ -0,0 +1,4 @@
+include ../common.mk
+bin_PROGRAMS = bbv
+bbv_SOURCES = bbv.c ../utils/cum_distr.c ../include/cum_distr.h
+bbv_LDADD = -lm
diff --git a/src/bbv/Makefile.in b/src/bbv/Makefile.in
new file mode 100644
index 0000000..3f19d0c
--- /dev/null
+++ b/src/bbv/Makefile.in
@@ -0,0 +1,578 @@
+# 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 = :
+bin_PROGRAMS = bbv$(EXEEXT)
+subdir = src/bbv
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_bbv_OBJECTS = bbv.$(OBJEXT) ../utils/cum_distr.$(OBJEXT)
+bbv_OBJECTS = $(am_bbv_OBJECTS)
+bbv_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(bbv_SOURCES)
+DIST_SOURCES = $(bbv_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+bbv_SOURCES = bbv.c ../utils/cum_distr.c ../include/cum_distr.h
+bbv_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/bbv/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/bbv/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/cum_distr.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+bbv$(EXEEXT): $(bbv_OBJECTS) $(bbv_DEPENDENCIES) $(EXTRA_bbv_DEPENDENCIES)
+ @rm -f bbv$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(bbv_OBJECTS) $(bbv_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/cum_distr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bbv.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/bbv/bbv.c b/src/bbv/bbv.c
new file mode 100644
index 0000000..60ddd5c
--- /dev/null
+++ b/src/bbv/bbv.c
@@ -0,0 +1,335 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ *
+ * This program grows a weighted network using the model proposed by
+ * Barrat, Barthelemy, and Vespignani.
+ *
+ * References:
+ *
+ * [1] A. Barrat, M. Barthelemy, and A. Vespignani. "Weighted
+ * Evolving Networks: Coupling Topology and Weight
+ * Dynamics". Phys. Rev. Lett. 92 (2004), 228701.
+ *
+ * [2] A. Barrat, M. Barthelemy, and A. Vespignani. "Modeling the
+ * evolution of weighted networks". Phys. Rev. E 70 (2004),
+ * 066149.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <math.h>
+
+#include "cum_distr.h"
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- bbv -*- **\n"
+ "** **\n"
+ "** Grow a weighted network of 'N' nodes using the model **\n"
+ "** proposed by Barrat-Barthelemy-Vespignani. **\n"
+ "** **\n"
+ "** The initial network is a clique of 'n0' nodes, and each new **\n"
+ "** node creates 'm' edges. All edges have an initial weight **\n"
+ "** equal to 'w0', and the attachment probability in of the **\n"
+ "** form: **\n"
+ "** **\n"
+ "** P(i->j) ~ s_j **\n"
+ "** **\n"
+ "** where s_j is the strength of node j. The parameter 'delta' **\n"
+ "** tunes the rearrangement of edge weights due to the **\n"
+ "** addition of a new edge. The degree, strength, and weight **\n"
+ "** distributions of the created graphs are power-laws, **\n"
+ "** whose esponents depend on the values of 'w0' and 'delta'. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <N> <m> <n0> <w0> <delta>\n", argv[0]);
+}
+
+
+typedef struct{
+ int id;
+ double w;
+ double delta_w;
+} link_t;
+
+
+typedef struct {
+ int id;
+ int size;
+ int deg;
+ double s;
+ link_t *neighs;
+} node_t;
+
+
+/* create the initial graph as a clique of n0 nodes */
+void init_seed(node_t *G, int n0, double w0, cum_distr_t *d){
+
+ int i, j, n;
+
+ for(i=0; i< n0; i++){
+ G[i].neighs = malloc((n0-1) * sizeof(link_t));
+ G[i].size = n0-1;
+ G[i].deg = n0-1;
+ n= 0;
+ for (j=0; j<n0; j++){
+ if (i != j){
+ G[i].neighs[n].id = j;
+ G[i].neighs[n].w = w0;
+ n += 1;
+ }
+ }
+ G[i].s = (n0-1) * w0;
+ cum_distr_add(d, i, G[i].s);
+ }
+}
+
+/* add j to the neighbourhood of i with a weight w0, and update the
+ strength of i */
+void add_neigh(node_t *G, unsigned int i, unsigned int j, double w0){
+
+ if (G[i].deg == G[i].size){
+ G[i].size += 5;
+ G[i].neighs= realloc(G[i].neighs, G[i].size * sizeof(link_t));
+ }
+ G[i].neighs[G[i].deg].id = j;
+ G[i].neighs[G[i].deg].w = w0;
+ G[i].deg += 1;
+ G[i].s += w0;
+}
+
+/* Add w to the weight of the edge (i,j) */
+void add_weight(node_t *G, int i, int j, double w){
+
+ int k;
+ for(k=0; k<G[i].deg; k++){
+ if(G[i].neighs[k].id == j){
+ G[i].neighs[k].w += w;
+ }
+ }
+}
+
+/* Compute the weight increase for each edge connected to node i */
+void compute_delta_weights(node_t *G, int i, double delta){
+ int j;
+ double s;
+
+ s = G[i].s;
+
+ for(j=0; j< G[i].deg; j++){ /* for each neighbour of i */
+ /* compute the delta_weight */
+ G[i].neighs[j].delta_w = delta * G[i].neighs[j].w / s;
+ }
+}
+
+/* set the new weights on the edges connected to node i */
+void set_delta_weights(node_t *G, int i, cum_distr_t *distr){
+
+ int j, neigh;
+
+ double delta_w;
+
+ for(j=0; j<G[i].deg; j++){
+ neigh = G[i].neighs[j].id;
+ delta_w = G[i].neighs[j].delta_w;
+ /* add delta_w to the weight of (i, neigh) and of (neigh, i) */
+ add_weight(G, i, neigh, delta_w);
+ add_weight(G, neigh, i, delta_w);
+
+ /* update the strength of neigh */
+ G[neigh].s += delta_w;
+ /* add delta_w to the fraction of cum_distr associated to neigh */
+ cum_distr_add(distr, neigh, delta_w);
+ }
+}
+
+/* return 1 if i is in the array v */
+
+int is_neigh(int *v, int N, int i){
+
+ int j;
+
+ for(j=0; j<N; j++){
+ if (v[j] == i)
+ return 1;
+ }
+ return 0;
+}
+
+/*
+ * print the edges of the undirected graph G, with the corresponding
+ * weight. Each edge is printed only once
+ *
+ */
+void dump_net(node_t *G, int N){
+
+ int i, j;
+
+ double tot_w = 0.0;
+
+ for(i=0; i<N; i++){
+ for(j=0; j<G[i].deg; j++){
+ if(G[i].neighs[j].id > i){
+ tot_w += G[i].neighs[j].w;
+ printf("%d %d %g\n", i, G[i].neighs[j].id, G[i].neighs[j].w);
+ }
+ }
+ }
+}
+
+
+/* grow a weighted graph using the BBV model */
+node_t* bbv(unsigned int N, unsigned int n0, unsigned int m, double w0, double delta){
+
+ node_t *G;
+ int t, i, j;
+ cum_distr_t *distr = NULL;
+ int *tmp_neighs;
+
+ distr = cum_distr_init(N * m);
+
+
+ G = malloc(N * sizeof(node_t));
+ tmp_neighs = malloc(m * sizeof(int));
+
+ init_seed(G, n0, w0, distr);
+
+
+ for(t=n0; t<N; t++){
+ /* Initialize the new node */
+ G[t].neighs = malloc(m * sizeof(link_t));
+ G[t].size = m;
+ G[t].deg = 0;
+ /* Sample the m neighbours */
+ for(i=0; i<m; i++){
+ j = cum_distr_sample(distr);
+ while(is_neigh(tmp_neighs, i, j)){
+ j = cum_distr_sample(distr);
+ }
+ tmp_neighs[i] = j;
+ }
+ /* compute the weight increase for the neighbours of the
+ new node t */
+ for(i=0; i<m; i++){/* for each neighbour 'l' of the new node t */
+ /* compute the weight increase for the edges around 'l' */
+ compute_delta_weights(G, tmp_neighs[i], delta);
+ }
+ /* Now we update the weights */
+ for(i=0; i<m; i++){/* for each neighbour 'l' of the new node t */
+ set_delta_weights(G, tmp_neighs[i], distr);
+ add_neigh(G, t, tmp_neighs[i], w0);
+ add_neigh(G, tmp_neighs[i], t, w0);
+ /* We need to add delta to the strength of tmp_neighs[i] {notice
+ that w0 has been already added by the previous call to
+ add_neigh()}*/
+ G[tmp_neighs[i]].s += delta;
+ cum_distr_add(distr, tmp_neighs[i], delta + w0);
+ }
+
+ /* Finally, we update the strength of node t */
+ G[t].s = w0 * m;
+ cum_distr_add(distr, t, G[t].s);
+ }
+ free(tmp_neighs);
+ cum_distr_destroy(distr);
+ return G;
+}
+
+
+
+int main(int argc, char *argv[]){
+
+ int N, n0, m, i;
+ double w0, delta;
+
+ node_t *net;
+
+ if (argc < 6){
+ usage(argv);
+ exit(1);
+ }
+
+ N = atoi(argv[1]);
+ m = atoi(argv[2]);
+ n0 = atoi(argv[3]);
+ w0 = atof(argv[4]);
+ delta = atof(argv[5]);
+
+ srand(time(NULL));
+
+ if (N < 1){
+ fprintf(stderr, "N must be positive\n");
+ exit(1);
+ }
+ if(m > n0){
+ fprintf(stderr, "n0 cannot be smaller than m\n");
+ exit(1);
+
+ }
+ if (n0<1){
+ fprintf(stderr, "n0 must be positive\n");
+ exit(1);
+ }
+
+ if (m < 1){
+ fprintf(stderr, "m must be positive\n");
+ exit(1);
+ }
+
+ if (w0 <= 0.0){
+ fprintf(stderr, "w0 must be positive\n");
+ exit(1);
+ }
+
+ if (delta < 0.0){
+ fprintf(stderr, "delta must be positive\n");
+ exit(1);
+ }
+
+
+ net = bbv(N, n0, m, w0, delta);
+ dump_net(net, N);
+
+ for(i=0; i<N; i++){
+ free(net[i].neighs);
+ }
+
+ free(net);
+}
diff --git a/src/betweenness/Makefile.am b/src/betweenness/Makefile.am
new file mode 100644
index 0000000..6adf93f
--- /dev/null
+++ b/src/betweenness/Makefile.am
@@ -0,0 +1,7 @@
+include ../common.mk
+bin_PROGRAMS = betweenness bet_dependency
+betweenness_SOURCES = betweenness.c ../utils/utils.c ../include/utils.h
+betweenness_LDADD = -lm
+bet_dependency_SOURCES = bet_dependency.c ../utils/utils.c ../include/utils.h
+bet_dependency_LDADD = -lm
+
diff --git a/src/betweenness/Makefile.in b/src/betweenness/Makefile.in
new file mode 100644
index 0000000..776f7a1
--- /dev/null
+++ b/src/betweenness/Makefile.in
@@ -0,0 +1,590 @@
+# 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 = :
+bin_PROGRAMS = betweenness$(EXEEXT) bet_dependency$(EXEEXT)
+subdir = src/betweenness
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_bet_dependency_OBJECTS = bet_dependency.$(OBJEXT) \
+ ../utils/utils.$(OBJEXT)
+bet_dependency_OBJECTS = $(am_bet_dependency_OBJECTS)
+bet_dependency_DEPENDENCIES =
+am_betweenness_OBJECTS = betweenness.$(OBJEXT) \
+ ../utils/utils.$(OBJEXT)
+betweenness_OBJECTS = $(am_betweenness_OBJECTS)
+betweenness_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(bet_dependency_SOURCES) $(betweenness_SOURCES)
+DIST_SOURCES = $(bet_dependency_SOURCES) $(betweenness_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp README
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+betweenness_SOURCES = betweenness.c ../utils/utils.c ../include/utils.h
+betweenness_LDADD = -lm
+bet_dependency_SOURCES = bet_dependency.c ../utils/utils.c ../include/utils.h
+bet_dependency_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/betweenness/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/betweenness/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+bet_dependency$(EXEEXT): $(bet_dependency_OBJECTS) $(bet_dependency_DEPENDENCIES) $(EXTRA_bet_dependency_DEPENDENCIES)
+ @rm -f bet_dependency$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(bet_dependency_OBJECTS) $(bet_dependency_LDADD) $(LIBS)
+
+betweenness$(EXEEXT): $(betweenness_OBJECTS) $(betweenness_DEPENDENCIES) $(EXTRA_betweenness_DEPENDENCIES)
+ @rm -f betweenness$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(betweenness_OBJECTS) $(betweenness_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bet_dependency.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/betweenness.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/betweenness/README b/src/betweenness/README
new file mode 100644
index 0000000..c41e3d1
--- /dev/null
+++ b/src/betweenness/README
@@ -0,0 +1,8 @@
+- bet_dependency computes the contribution to betweenness of each node in the graph
+ restricted to shortest paths originating from a range of nodes
+
+ --- TODO ---
+
+- make a multi-threaded version
+- make an MPI implementation
+- make a version which considers only X% of the nodes, sampled at random
diff --git a/src/betweenness/bet_dependency.c b/src/betweenness/bet_dependency.c
new file mode 100644
index 0000000..2b55543
--- /dev/null
+++ b/src/betweenness/bet_dependency.c
@@ -0,0 +1,224 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program computes the betweenness dependency of all the nodes
+ * of a graph, using Brandes' algorithm, and counting all the
+ * shortest paths originating from a set of nodes (potentially the
+ * whole set of vertices).
+ *
+ * References:
+ * U. Brandes. "A Faster Algorithm for Betweenness
+ * Centrality". J. Math. Sociol. 25 (2001), 163-177.
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "utils.h"
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- bet_dependency -*- **\n"
+ "** **\n"
+ "** Compute the betweenness dependency of all the nodes of a **\n"
+ "** network due to the shortest paths originating from a set **\n"
+ "** of initial nodes. If no start node is specified, compute **\n"
+ "** the dependency due to all the nodes of the graph. If no end **\n"
+ "** node is specified, compute the dependency due to the nodes **\n"
+ "** between node_start and the last node of the graph. **\n"
+ "** **\n"
+ "** The dependency of each node is printed on standard output. **\n"
+ "** **\n"
+ "** **\n"
+ "********************************************************************\n"
+ "\n\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (katolaz@yahoo.it)\n\n");
+ printf("Usage: %s <graph_in> [<node_start> [<node_end>]]\n\n" , argv[0]);
+}
+
+void add_predecessor(unsigned int **pred, unsigned int k){
+
+ (*pred)[0] += 1;
+ *pred = realloc(*pred, ((*pred)[0] + 1) * sizeof(unsigned int));
+ (*pred)[ (*pred)[0] ] = k;
+}
+
+
+
+/*
+ * Returns a list of dependencies
+ */
+double* compute_bet_dependency(unsigned int N, unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int n_start, unsigned int n_end){
+
+ int i, j, k, w, idx, cur_node;
+ unsigned int *marked, **preds, *dist, *nj;
+ double *delta, *cB;
+ unsigned int d;
+ unsigned int n, nd, ndp;
+
+ dist = malloc(N * sizeof(unsigned int));
+ marked = malloc(N * sizeof(unsigned int));
+ preds = malloc(N * sizeof(unsigned int *));
+
+ nj = malloc(N * sizeof(unsigned int));
+ delta = malloc(N * sizeof(double));
+ cB = malloc(N * sizeof(double));
+
+ for (i=0; i<N; i++){
+ cB[i] = 0;
+ preds[i] = NULL;
+ }
+
+ for (j=n_start; j<=n_end && j<N; j++){
+ for(i=0; i<N; i ++){
+ dist[i] = N;
+ if (! preds[i]){
+ preds[i] = malloc(sizeof(unsigned int));
+ }
+ preds[i][0] = 0; /* The list of predecessors is now empty! */
+
+ nj[i] = 0;
+ delta[i]= 0;
+ }
+ dist[j] = 0;
+ nj[j] = 1;
+ marked[0] = j;
+ d = 0;
+ n = 0;
+ nd = 1;
+ ndp = 0;
+ while (d<N && nd > 0){
+ for(i = n; i< n+nd; i ++){
+ cur_node = marked[i];
+ for (k=r_slap[cur_node]; k<r_slap[cur_node +1] ; k++){
+ w = J_slap[k];
+ if ( dist[w] == d+1){
+ add_predecessor((unsigned int **)(preds + w), cur_node);
+ nj[w] += nj[cur_node];
+ }
+ if ( dist[w] == N){
+ dist[w] = d+1;
+ marked[n + nd + ndp] = w;
+ add_predecessor(preds + w, cur_node);
+ ndp +=1;
+ nj[w] += nj[cur_node];
+ }
+ }
+ }
+ n = n + nd;
+ nd = ndp;
+ ndp = 0;
+ d += 1;
+ }
+ for (k= n-1; k>=1; k--){
+ w = marked[k];
+ for (idx=1; idx <= preds[w][0]; idx ++ ){
+ i = preds[w][idx];
+ delta[i] += 1.0 * nj[i] / nj[w] * (1 + delta[w]);
+ }
+ cB[w] += delta[w];
+ }
+ }
+ free(dist);
+ free(marked);
+ for (i=0; i<N; i++){
+ free(preds[i]);
+ }
+ free(preds);
+ free(nj);
+ free(delta);
+
+ return cB;
+}
+
+
+
+void dump_cB(double *cB, unsigned int N){
+
+ unsigned int i;
+ for (i=0; i<N; i++){
+ printf("%g\n", cB[i]);
+ }
+}
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int *J_slap=NULL, *r_slap=NULL;
+ unsigned int K, N;
+ unsigned int n_start, n_end;
+ double *cB;
+ FILE *filein;
+
+ n_start = 0;
+ n_end = -1;
+
+ switch (argc){
+
+ case 4:
+ n_end = atoi(argv[3]);
+ case 3:
+ n_start = atoi(argv[2]);
+ case 2:
+ break;
+ default:
+ usage(argv);
+ exit(1);
+ break;
+ }
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ read_slap(filein, &K, &N, &J_slap, &r_slap);
+ if (n_end == -1)
+ n_end = N-1;
+ cB = compute_bet_dependency(N, J_slap, r_slap, n_start, n_end);
+ dump_cB(cB, N);
+
+ free(cB);
+ free(J_slap);
+ free(r_slap);
+
+}
diff --git a/src/betweenness/betweenness.c b/src/betweenness/betweenness.c
new file mode 100644
index 0000000..5e37747
--- /dev/null
+++ b/src/betweenness/betweenness.c
@@ -0,0 +1,316 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program computes the betweenness of all the nodes of a graph,
+ * using Brandes' algorithm, and counting all the shortest paths
+ * originating from a set of nodes (potentially the whole set of
+ * vertices).
+ *
+ * References:
+ * U. Brandes. "A Faster Algorithm for Betweenness
+ * Centrality". J. Math. Sociol. 25 (2001), 163-177.
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <time.h>
+
+#include "utils.h"
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- betweenness -*- **\n"
+ "** **\n"
+ "** Compute the betweenness of all the nodes and edges of a **\n"
+ "** network due to the shortest paths originating from a set **\n"
+ "** of initial nodes. The set can be either a sequence of **\n"
+ "** nodes (if the second argument is 'SEQ') or a random sample **\n"
+ "** from the set of all the nodes (if it is 'RND'). **\n"
+ "** **\n"
+ "** The input file is an edge-list (use '-' to read from STDIN). **\n"
+ "** **\n"
+ "** With 'SEQ': **\n"
+ "** If <node_start> is not specified, computes the betweenness **\n"
+ "** using shortest paths from *all* the nodes (WARNING: This can **\n"
+ "** be slow for large graphs!). If <node_end> is not specified, **\n"
+ "** use shortest paths from all the nodes between <node_start> **\n"
+ "** and the node with the largest label. **\n"
+ "** **\n"
+ "** With 'RND': **\n"
+ "** Compute the betweenness based on the shortest paths from **\n"
+ "** <num> nodes sampled uniformly at random. **\n"
+ "** **\n"
+ "** When called with just <graph_in>, use all the nodes. **\n"
+ "** **\n"
+ "** The betweenness of all the nodes is printed on standard **\n"
+ "** output (STDOUT), while the edge betweenness is printed on **\n"
+ "** standard error (STDERR) **\n"
+ "** **\n"
+ "********************************************************************\n"
+ "\n\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n\n");
+ printf("Usage: %s <graph_in> [SEQ <node_start> [<node_end>]]\n" , argv[0]);
+ printf("Usage: %s <graph_in> [RND <num>]\n" , argv[0]);
+
+}
+
+/*
+ * Add a node the a list of predecessors
+ */
+
+void add_predecessor(unsigned int **pred, unsigned int k){
+
+ (*pred)[0] += 1;
+ *pred = realloc(*pred, ((*pred)[0] + 1) * sizeof(unsigned int));
+ (*pred)[ (*pred)[0] ] = k;
+}
+
+
+
+/*
+ *
+ * Compute node and edge betweenness, based on shortest paths
+ * originating on the "num" nodes specified in "nlist". "edge_bet"
+ * should be an appropriately allocated (and initialised to zero!!!!)
+ * vector of length equal to J_slap, and will contain the values of
+ * edge betweenness.
+ *
+ */
+double* compute_bet_dependency(unsigned int N, unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int *nlist, unsigned int num, double *edge_bet){
+
+ int i, j, k, w, idx, cur_node, m;
+ unsigned int *marked, **preds, *dist, *nj;
+ double *delta, *cB, val;
+ unsigned int d;
+ unsigned int n, nd, ndp;
+ unsigned int edge_pos;
+
+ dist = malloc(N * sizeof(unsigned int));
+ marked = malloc(N * sizeof(unsigned int));
+ preds = malloc(N * sizeof(unsigned int *));
+
+ nj = malloc(N * sizeof(unsigned int));
+ delta = malloc(N * sizeof(double));
+ cB = malloc(N * sizeof(double));
+
+ for (i=0; i<N; i++){
+ cB[i] = 0;
+ preds[i] = NULL;
+ }
+
+ for (m=0; m<num; m++){
+ /* We start from the m-th node in nlist*/
+ j = nlist[m];
+
+ for(i=0; i<N; i ++){
+ dist[i] = N;
+ if (! preds[i]){
+ preds[i] = malloc(sizeof(unsigned int));
+ }
+ preds[i][0] = 0; /* The list of predecessors is now empty! */
+
+ nj[i] = 0;
+ delta[i]= 0;
+ }
+ dist[j] = 0;
+ nj[j] = 1;
+ marked[0] = j;
+ d = 0;
+ n = 0;
+ nd = 1;
+ ndp = 0;
+ while (d<N && nd > 0){
+ for(i = n; i< n+nd; i ++){
+ cur_node = marked[i];
+ for (k=r_slap[cur_node]; k<r_slap[cur_node +1] ; k++){
+ w = J_slap[k];
+ if ( dist[w] == d+1){
+ add_predecessor((unsigned int **)(preds + w), cur_node);
+ nj[w] += nj[cur_node];
+ }
+ if ( dist[w] == N){
+ dist[w] = d+1;
+ marked[n + nd + ndp] = w;
+ add_predecessor(preds + w, cur_node);
+ ndp +=1;
+ nj[w] += nj[cur_node];
+ }
+ }
+ }
+ n = n + nd;
+ nd = ndp;
+ ndp = 0;
+ d += 1;
+ }
+ for (k= n-1; k>=1; k--){
+ w = marked[k];
+ for (idx=1; idx <= preds[w][0]; idx ++ ){
+ i = preds[w][idx];
+ val = 1.0 * nj[i] / nj[w] * (1 + delta[w]);
+ delta[i] += val;
+ /* Now we should update the betweenness of the edge (i,w) in
+ the appropriate position of the vector edge_bet*/
+ find_neigh_in_Jslap(J_slap, r_slap, N, i, w, &edge_pos);
+ edge_bet[edge_pos] += val;
+ find_neigh_in_Jslap(J_slap, r_slap, N, w, i, &edge_pos);
+ edge_bet[edge_pos] += val;
+ }
+ cB[w] += delta[w];
+ }
+ }
+ free(dist);
+ free(marked);
+ for (i=0; i<N; i++){
+ free(preds[i]);
+ }
+ free(preds);
+ free(nj);
+ free(delta);
+ return cB;
+}
+
+
+
+/*
+ * print of STDOUT the betweenness of each node
+ */
+void dump_cB(double *cB, unsigned int N){
+
+ unsigned int i;
+ for (i=0; i<N; i++){
+ printf("%g\n", cB[i]);
+ }
+}
+
+/*
+ * print on STDERR the betweenness of each edge
+ */
+
+void dump_edge_bet(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ double *v, FILE *fout){
+
+ unsigned int i, j;
+
+ for(i=0; i<N; i++){
+ for (j=r_slap[i]; j<r_slap[i+1]; j++)
+ fprintf(fout, "%d %d %g\n", i, J_slap[j], v[j]);
+ }
+}
+
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int *J_slap=NULL, *r_slap=NULL;
+ unsigned int K, N, i;
+ unsigned int n_start, n_end;
+ unsigned int *nlist=NULL;
+ unsigned int num;
+ double *edge_bet = NULL;
+ double *cB;
+ FILE *filein;
+
+
+ if(argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+ srand(time(NULL));
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ read_slap(filein, &K, &N, &J_slap, &r_slap);
+
+ nlist = malloc(N * sizeof(unsigned int));
+
+ for(i=0; i<N; i++){
+ nlist[i] = i;
+ }
+
+ n_start = 0;
+ n_end = N-1;
+ num = N;
+
+
+ if (argc > 3){
+ if(!my_strcasecmp(argv[2], "SEQ")){
+ n_start = atoi(argv[3]);
+ if (n_start > N-1)
+ n_start = 0;
+ if (argc > 4){
+ n_end = atoi(argv[4]);
+ }
+ else{
+ n_end = N-1;
+ }
+ num = n_end - n_start + 1;
+ }
+ else if (!my_strcasecmp(argv[2], "RND")){
+ num = atoi(argv[3]);
+ n_start = 0;
+ n_end = num-1;
+ if (num > N || num < 1)
+ num = N;
+ shuffle_vector(nlist, N);
+ }
+ }
+
+ sort_neighbours(J_slap, r_slap, N);
+ edge_bet = malloc(K * sizeof(double));
+ memset(edge_bet, 0, K * sizeof(double));
+ cB = compute_bet_dependency(N, J_slap, r_slap, nlist+n_start, num, edge_bet);
+
+ dump_cB(cB, N);
+ dump_edge_bet(J_slap, r_slap, N, edge_bet, stderr);
+
+ free(cB);
+ free(J_slap);
+ free(r_slap);
+ free(edge_bet);
+ free(nlist);
+
+}
diff --git a/src/clust/Makefile.am b/src/clust/Makefile.am
new file mode 100644
index 0000000..676c6bf
--- /dev/null
+++ b/src/clust/Makefile.am
@@ -0,0 +1,6 @@
+include ../common.mk
+bin_PROGRAMS = clust clust_w
+clust_SOURCES = clust.c ../utils/utils.c ../include/utils.h
+clust_LDADD = -lm
+clust_w_SOURCES = clust_w.c ../utils/utils.c ../include/utils.h
+clust_w_LDADD = -lm
diff --git a/src/clust/Makefile.in b/src/clust/Makefile.in
new file mode 100644
index 0000000..3a891bb
--- /dev/null
+++ b/src/clust/Makefile.in
@@ -0,0 +1,588 @@
+# 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 = :
+bin_PROGRAMS = clust$(EXEEXT) clust_w$(EXEEXT)
+subdir = src/clust
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_clust_OBJECTS = clust.$(OBJEXT) ../utils/utils.$(OBJEXT)
+clust_OBJECTS = $(am_clust_OBJECTS)
+clust_DEPENDENCIES =
+am_clust_w_OBJECTS = clust_w.$(OBJEXT) ../utils/utils.$(OBJEXT)
+clust_w_OBJECTS = $(am_clust_w_OBJECTS)
+clust_w_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(clust_SOURCES) $(clust_w_SOURCES)
+DIST_SOURCES = $(clust_SOURCES) $(clust_w_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+clust_SOURCES = clust.c ../utils/utils.c ../include/utils.h
+clust_LDADD = -lm
+clust_w_SOURCES = clust_w.c ../utils/utils.c ../include/utils.h
+clust_w_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/clust/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/clust/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+clust$(EXEEXT): $(clust_OBJECTS) $(clust_DEPENDENCIES) $(EXTRA_clust_DEPENDENCIES)
+ @rm -f clust$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(clust_OBJECTS) $(clust_LDADD) $(LIBS)
+
+clust_w$(EXEEXT): $(clust_w_OBJECTS) $(clust_w_DEPENDENCIES) $(EXTRA_clust_w_DEPENDENCIES)
+ @rm -f clust_w$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(clust_w_OBJECTS) $(clust_w_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clust.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clust_w.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/clust/clust.c b/src/clust/clust.c
new file mode 100644
index 0000000..df62825
--- /dev/null
+++ b/src/clust/clust.c
@@ -0,0 +1,162 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program computes the clustering coefficient of a graph and of
+ * each node.
+ *
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "utils.h"
+
+
+void usage(char *argv[]){
+
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- clust -*- **\n"
+ "** **\n"
+ "** Compute the graph clustering coefficient and, optionally, **\n"
+ "** also the node clustering coefficient of all the nodes in **\n"
+ "** the graph 'graph_in'. **\n"
+ "** **\n"
+ "** The input file 'graph_in' is an edge-list: **\n"
+ "** **\n"
+ "** I_1 J_1 **\n"
+ "** I_2 J_2 **\n"
+ "** I_3 J_3 **\n"
+ "** ... ... **\n"
+ "** I_K J_K **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the file from **\n"
+ "** the standard input (STDIN). **\n"
+ "** **\n"
+ "** The output is a single line containing the value of the **\n"
+ "** graph clustering coefficient of 'graph_in'. **\n"
+ "** **\n"
+ "** If 'SHOW' is provided as second argument, the program **\n"
+ "** on the standard error (STDERR) the label, degree, and **\n"
+ "** node clustering coefficient of all the nodes of 'graph_in' **\n"
+ "** in the format: **\n"
+ "** **\n"
+ "** node_1 k_1 c_1 **\n"
+ "** node_2 k_2 c_2 **\n"
+ "** node_3 k_3 c_3 **\n"
+ "** node_4 k_4 c_4 **\n"
+ "** ..... **\n"
+ "** **\n"
+ "** where 'k_1' is the degree of 'node_1' and 'c_1' is its **\n"
+ "** node clustering coefficient. If a node has degree smaller **\n"
+ "** than 2, its clustering coefficient is equal to zero. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+
+ printf("Usage: %s <graph_in> [SHOW]\n", argv[0]);
+}
+
+
+
+double avg_clust(unsigned int *J_slap, unsigned int *r_slap, unsigned int N, int show){
+
+ double c = 0, ci=0;
+ unsigned int i, j, l, ki;
+
+ for(i=0; i<N; i ++){/* for each node i..*/
+ ci = 0;
+ ki = r_slap[i+1] - r_slap[i];
+ for(j=r_slap[i]; j<r_slap[i+1]; j++){/*... pick a neighbour...*/
+ for (l=r_slap[J_slap[j]]; l<r_slap[J_slap[j]+1]; l++){
+ if (J_slap[l] != i){
+ /*...and check how many times it has a link to a neighbour of i */
+ if(is_neigh(J_slap, r_slap, N, i, J_slap[l])){
+ ci += 1;
+ }
+ }
+ }
+ }
+ if(ki > 1)
+ ci /= ki * (ki-1);
+ else
+ ci = 0;
+ if (show)
+ fprintf(stderr, "%d %d %g\n", i, ki, ci);
+ c += ci;
+ }
+ c /= N;
+ return c;
+}
+
+
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int *J_slap=NULL, *r_slap=NULL;
+ unsigned int K, N;
+ FILE *filein;
+ double c;
+ int show = 0;
+
+ if (argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+ if (argc >2 && !my_strcasecmp("SHOW", argv[2])){
+ show = 1;
+ }
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ read_slap(filein, &K, &N, &J_slap, &r_slap);
+ fclose(filein);
+
+ c = avg_clust(J_slap, r_slap, N, show);
+ printf("%2.8lf\n", c);
+ free(J_slap);
+ free(r_slap);
+}
diff --git a/src/clust/clust_w.c b/src/clust/clust_w.c
new file mode 100644
index 0000000..dcf14ed
--- /dev/null
+++ b/src/clust/clust_w.c
@@ -0,0 +1,161 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program computes the weighted clustering coefficient as
+ * defined in Barrat, Barthelemy, Pastor-Satorras, Vespignani, PNAS
+ * 101, 3747 (2004).
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "utils.h"
+
+void usage(char *argv[]){
+
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- clust_w -*- **\n"
+ "** **\n"
+ "** Compute the weighted clustering coefficient of 'graph_in' **\n"
+ "** using the definition proposed by Barrayt, Barthelemy, **\n"
+ "** Pastor-Satorras and Vespignani. **\n"
+ "** **\n"
+ "** The input file 'graph_in' is an edge-list, in the format: **\n"
+ "** **\n"
+ "** I_1 J_1 W_1 **\n"
+ "** I_2 J_2 W_2 **\n"
+ "** **\n"
+ "** where W_i is the weight if the edge (I_i, J_i). **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the file from **\n"
+ "** the standard input (STDIN). **\n"
+ "** **\n"
+ "** The output is a single line containing the value of the **\n"
+ "** graph clustering coefficient of 'graph_in'. **\n"
+ "** **\n"
+ "** If 'SHOW' is provided as second argument, the program **\n"
+ "** on the standard error (STDERR) the label, degree, and **\n"
+ "** node clustering coefficient of all the nodes of 'graph_in' **\n"
+ "** in the format: **\n"
+ "** **\n"
+ "** node_1 k_1 c_1 **\n"
+ "** node_2 k_2 c_2 **\n"
+ "** node_3 k_3 c_3 **\n"
+ "** node_4 k_4 c_4 **\n"
+ "** ..... **\n"
+ "** **\n"
+ "** where 'k_1' is the degree of 'node_1' and 'c_1' is its **\n"
+ "** node clustering coefficient. If a node has degree smaller **\n"
+ "** than 2, its clustering coefficient is equal to zero. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+
+ printf("Usage: %s <graph_in> [SHOW]\n", argv[0]);
+}
+
+
+
+
+double avg_clust_w(unsigned int *J_slap, unsigned int *r_slap, double *W_slap,
+ unsigned int N, int show){
+
+ double c = 0, ci=0, w=0.0;
+ unsigned int i, j, l, ki;
+
+ for(i=0; i<N; i ++){/* for each node i..*/
+ ci = 0;
+ ki = r_slap[i+1] - r_slap[i];
+ for(j=r_slap[i]; j<r_slap[i+1]; j++){/*... pick a neighbour...*/
+ for (l=r_slap[J_slap[j]]; l<r_slap[J_slap[j]+1]; l++){
+ /*...and check how many times it has a link to a neighbour of i */
+ w = get_neigh_weight(J_slap, r_slap, W_slap, N, i, J_slap[l]);
+ if (J_slap[l] != i && w > 0.0){
+ ci += (W_slap[j] + w) / 2.0;
+ }
+ }
+ }
+ if(ki > 1)
+ ci /= strength(r_slap, W_slap, i) * (ki-1);
+ else
+ ci = 0;
+ if (show)
+ fprintf(stderr, "%d %d %0.14g\n", i, ki, ci);
+ c += ci;
+ }
+ c /= N;
+ return c;
+}
+
+
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int *J_slap=NULL, *r_slap=NULL;
+ double *W_slap = NULL;
+ unsigned int K, N;
+ FILE *filein;
+ double c;
+ int show = 0;
+
+ if (argc < 2){
+ printf("Usage: %s <filein> [SHOW]\n", argv[0]);
+ exit(1);
+ }
+ if (argc >2 ){
+ show = 1;
+ }
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+
+ read_slap_w(filein, &K, &N, &J_slap, &r_slap, &W_slap);
+ fclose(filein);
+ c = avg_clust_w(J_slap, r_slap, W_slap, N, show);
+ printf("%2.8lf\n", c);
+ free(J_slap);
+ free(r_slap);
+ free(W_slap);
+}
diff --git a/src/cnm/Makefile.am b/src/cnm/Makefile.am
new file mode 100644
index 0000000..b036fac
--- /dev/null
+++ b/src/cnm/Makefile.am
@@ -0,0 +1,7 @@
+include ../common.mk
+bin_PROGRAMS = cnm
+cnm_SOURCES = cnm.c bst_pq.c cnm_bst_pq.c bst_pq.h cnm_bst_pq.h \
+../utils/utils.c ../utils/gen_stack.c ../utils/dset.c \
+../include/utils.h ../include/gen_stack.h ../include/dset.h
+cnm_LDADD = -lm
+
diff --git a/src/cnm/Makefile.in b/src/cnm/Makefile.in
new file mode 100644
index 0000000..74cd719
--- /dev/null
+++ b/src/cnm/Makefile.in
@@ -0,0 +1,591 @@
+# 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 = :
+bin_PROGRAMS = cnm$(EXEEXT)
+subdir = src/cnm
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_cnm_OBJECTS = cnm.$(OBJEXT) bst_pq.$(OBJEXT) cnm_bst_pq.$(OBJEXT) \
+ ../utils/utils.$(OBJEXT) ../utils/gen_stack.$(OBJEXT) \
+ ../utils/dset.$(OBJEXT)
+cnm_OBJECTS = $(am_cnm_OBJECTS)
+cnm_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(cnm_SOURCES)
+DIST_SOURCES = $(cnm_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+cnm_SOURCES = cnm.c bst_pq.c cnm_bst_pq.c bst_pq.h cnm_bst_pq.h \
+../utils/utils.c ../utils/gen_stack.c ../utils/dset.c \
+../include/utils.h ../include/gen_stack.h ../include/dset.h
+
+cnm_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/cnm/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/cnm/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/gen_stack.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/dset.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+cnm$(EXEEXT): $(cnm_OBJECTS) $(cnm_DEPENDENCIES) $(EXTRA_cnm_DEPENDENCIES)
+ @rm -f cnm$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(cnm_OBJECTS) $(cnm_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/dset.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/gen_stack.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bst_pq.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnm.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnm_bst_pq.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/cnm/bst_pq.c b/src/cnm/bst_pq.c
new file mode 100644
index 0000000..9502f4e
--- /dev/null
+++ b/src/cnm/bst_pq.c
@@ -0,0 +1,808 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This is an implementation of a Binary Search Tree augmented by a
+ * Priority Queue. This data structure is central to the
+ * implementation of the Clauset-Newman-Moore greedy modularity
+ * optimisation algorithm
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <assert.h>
+
+#include "utils.h"
+#include "bst_pq.h"
+
+
+
+/* BST-related functions */
+
+
+void __recursive_preorder(node_t *cur, ilfunc_t *funs){
+
+ if(cur->left){
+ __recursive_preorder(cur->left, funs);
+ }
+ if(cur -> active)
+ funs->print(cur->info, funs->fileout);
+ if(cur->right){
+ __recursive_preorder(cur->right, funs);
+ }
+}
+
+/*
+ *
+ * Recursive push of nodes in the nodecache :-)
+ *
+ */
+
+void __recursive_destroy(node_t *cur, ilfunc_t *funs){
+ if(cur->left){
+ __recursive_destroy(cur->left, funs);
+ cur->left = NULL;
+ }
+ if(cur->right){
+ __recursive_destroy(cur->right, funs);
+ cur->right = NULL;
+ }
+}
+
+
+int __recursive_insert(node_t *cur, node_t *elem, ilfunc_t *f){
+
+ int res ;
+ res = f->compare(cur->info, elem->info);
+ /* printf("res: %d\n", res); */
+ assert(res != 0);
+ if ( res > 0){
+ if (cur->left){
+ return __recursive_insert(cur->left, elem, f);
+ }
+ else{
+ cur->left = elem;
+ elem->parent = cur;
+ return 0;
+ }
+ }
+ else if (res < 0){
+ if (cur->right){
+ return __recursive_insert(cur->right, elem, f);
+ }
+ else{
+ cur->right = elem;
+ elem->parent = cur;
+ return 0;
+ }
+ }
+ if (cur -> active){
+ printf("warning!!!!! duplicate entry!!!!!!\n\n");
+ exit(1);
+ }
+ else
+ cur->active = 1;
+ return -1;
+}
+
+
+
+void* __recursive_lookup(node_t *cur, int v, ilfunc_t *f){
+
+ int res;
+
+ res = f->compare(cur->info, v);
+
+ if (res > 0){
+ if(cur->left)
+ return __recursive_lookup(cur->left, v, f);
+ else
+ return NULL;
+
+ }
+ else if (res < 0){
+ if(cur->right)
+ return __recursive_lookup(cur->right, v, f);
+ else
+ return NULL;
+ }
+ else{ /* res == 0, we found the element we were looking for */
+ return cur;
+ }
+}
+
+
+
+node_t* __recursive_getmin(node_t *cur){
+
+ if(cur->left){
+ return __recursive_getmin(cur->left);
+ }
+ else{
+ return cur;
+ }
+
+}
+
+
+node_t* __tree_getmin(node_t *n){
+
+ if (!n){
+ return NULL;
+ }
+ else{
+ return __recursive_getmin(n);
+ }
+
+}
+
+
+/* This is used by __tree__delete to put another tree v in place of
+ the current node u */
+
+
+void __tree_transplant(bst_pq_t t, node_t *u, node_t * v){
+
+ if (u->parent == NULL){
+ t->root = v;
+ }
+ else if(u == u->parent->left){
+ u->parent->left = v;
+ }
+ else{
+ u->parent->right = v;
+ }
+ if (v != NULL){
+ v->parent = u->parent;
+ }
+
+}
+
+
+void __tree_delete(bst_pq_t t, node_t *z){
+
+ node_t *y;
+
+ if (z == NULL)
+ return;
+
+ if (z->left == NULL){
+ __tree_transplant(t, z, z->right);
+ }
+ else if(z->right == NULL){
+ __tree_transplant(t, z, z->left);
+ }
+ else{
+ y = __tree_getmin(z->right);
+ if (y->parent != z){
+ __tree_transplant(t, y, y->right);
+ y->right = z->right;
+ y->right->parent = y;
+ }
+ __tree_transplant(t, z, y);
+ y->left = z->left;
+ y->left->parent = y;
+ }
+}
+
+
+
+
+void bst_pq_tree_destroy(bst_pq_t t){
+
+ if(t->root)
+ __recursive_destroy(t->root, & (t->bst_funs));
+ free(t);
+}
+
+
+
+
+void __bst_pq_tree_view_pre(bst_pq_t t){
+
+ if (t->root){
+ printf("----\n");
+ __recursive_preorder(t->root, & (t->bst_funs));
+ printf("\n----\n");
+ }
+ else
+ printf("----- Empty tree!!!! -----\n");
+
+}
+
+
+
+void* __bst_pq_tree_lookup(bst_pq_t t , int elem){
+
+ if(t->root)
+ return __recursive_lookup(t->root, elem, & (t->bst_funs) );
+ else
+ return NULL;
+}
+
+
+
+
+
+/* void bst_pq_tree_map(bst_pq_t t, void (*func)(void*)){ */
+
+/* __recursive_map(t->root, func); */
+
+/* } */
+
+
+/* void bst_pq_tree_map_args(bst_pq_t t, void (*func)(void*, void*), void *args){ */
+
+/* __recursive_map_args(t->root, func, args); */
+
+/* } */
+
+void* bst_pq_tree_get_fileout(bst_pq_t t){
+
+ return t->bst_funs.fileout;
+}
+
+void bst_pq_tree_set_fileout(bst_pq_t t, void *f){
+
+ t->bst_funs.fileout = f;
+}
+
+
+
+node_t* __recursive_getmax(node_t *cur){
+
+ if(cur->right){
+ return __recursive_getmax(cur->right);
+ }
+ else{
+ return cur;
+ }
+
+}
+
+
+void* bst_pq_tree_getmax(bst_pq_t t){
+
+ if (!t){
+ return NULL;
+ }
+ else{
+ return __recursive_getmax(t->root);
+ }
+
+}
+
+
+/************************
+ * PQ-related functions *
+ ************************/
+
+void __update_handle(bst_pq_t q, int idx){
+
+ node_t *n;
+ n = (node_t*) q->v[idx];
+ n->index = idx;
+ //q->handles[q->pq_funs.get_id(q->v[idx])] = idx;
+}
+
+
+
+void __bst_pq_queue_sift_up(bst_pq_t q, int i){
+
+ int idx, parent;
+ void *tmp;
+
+ if ( q->last < 0)
+ return; /* no sifting if the PQ is empty!!! */
+
+ idx = i;
+ parent = PARENT(idx);
+
+ switch(q->qtype){
+ case MAX_QUEUE:
+ while ( idx >0 && q->pq_funs.compare(q->v[idx]->key, q->v[parent]->key) > 0){
+ tmp = q->v[idx];
+ q->v[idx] = q->v[parent];
+ q->v[parent] = tmp;
+ __update_handle(q, idx);
+ __update_handle(q, parent);
+ idx = parent;
+ parent = PARENT(idx);
+ }
+ break;
+ case MIN_QUEUE:
+ while ( idx >0 && q-> pq_funs.compare(q->v[idx]->key, q->v[parent]->key) < 0){
+ tmp = q->v[idx];
+ q->v[idx] = q->v[parent];
+ q->v[parent] = tmp;
+ __update_handle(q, idx);
+ __update_handle(q, parent);
+ idx = parent;
+ parent = PARENT(idx);
+ }
+ break;
+ }
+}
+
+
+void __bst_pq_queue_sift_down(bst_pq_t q, int i){
+
+ int left, right, largest, smallest;
+ void *tmp;
+
+ if ( q->last < 0)
+ return; /* no sifting if the PQ is empty!!! */
+ if( i > q->last)
+ return; /* no sifting if the index i is beyond the end of the PQ */
+
+ switch(q->qtype){
+ case MAX_QUEUE:
+ largest = i;
+ left = 2 * i + 1;
+ right = 2 * i + 2;
+
+ if (left <= q->last && q->pq_funs.compare(q->v[left]->key, q->v[largest]->key) > 0){
+ largest = left;
+ }
+ if (right <= q->last && q->pq_funs.compare(q->v[right]->key, q->v[largest]->key) > 0){
+ largest = right;
+ }
+ if (largest != i){
+ tmp = q->v[i];
+ q->v[i] = q->v[largest];
+ q->v[largest] = tmp;
+ __update_handle(q, i);
+ __update_handle(q, largest);
+ __bst_pq_queue_sift_down(q, largest);
+ }
+ else{
+ __update_handle(q, i);
+ }
+ break;
+
+ case MIN_QUEUE:
+ smallest = i;
+ left = 2 * i + 1;
+ right = 2 * i + 2;
+
+ if (left <= q->last && q->pq_funs.compare(q->v[left]->key, q->v[smallest]->key) < 0){
+ smallest = left;
+ }
+ if (right <= q->last && q->pq_funs.compare(q->v[right]->key, q->v[smallest]->key) < 0){
+ smallest = right;
+ }
+ if (smallest != i){
+ tmp = q->v[i];
+ q->v[i] = q->v[smallest];
+ q->v[smallest] = tmp;
+ __update_handle(q, i);
+ __update_handle(q, smallest);
+ __bst_pq_queue_sift_down(q, smallest);
+ }
+ else{
+ __update_handle(q, i);
+ }
+ break;
+ }
+}
+
+
+void __bst_pq_queue_insert(bst_pq_t q, void *elem){
+
+ //void *tmp;
+
+ if (q->last == q->N-1){
+ /* reallocate the array to arrange a few new elements */
+ q->N += 10;
+ q->v = realloc(q->v, (q->N) * sizeof(void*));
+ VALID_PTR_OR_EXIT(q->v, 17);
+ //q->v = tmp;
+ }
+
+ q->last += 1;
+ q->v[q->last] = elem;
+ __update_handle(q, q->last);
+ __bst_pq_queue_sift_up(q, q->last);
+
+}
+
+
+
+int __bst_pq_queue_delete_index(bst_pq_t q, int index){
+
+ if (q->last >=0 && index <= q->last){
+ //*val = q->v[0];
+ q->v[index] = q->v[q->last];
+ q->last -= 1;
+ __bst_pq_queue_sift_down(q, index);
+ return 0;
+ }
+ else{
+ return 1;
+ }
+}
+
+
+
+void* __bst_pq_queue_peek(bst_pq_t q){
+
+ if (q->last >= 0)
+ return q->v[0];
+ else
+ return NULL;
+}
+
+
+
+int __bst_pq_queue_force_key(bst_pq_t q, unsigned int idx, double key){
+
+ switch(q->qtype){
+ case MAX_QUEUE:
+ if (q->pq_funs.compare_to_key(q->v[idx], key) > 0){
+ //q->pq_funs.set_key(q->v[idx], key);
+ q->v[idx]->key = key;
+ __bst_pq_queue_sift_down(q, idx);
+ }
+ else{
+ //q->pq_funs.set_key(q->v[idx], key);
+ q->v[idx]->key = key;
+ __bst_pq_queue_sift_up(q, idx);
+ }
+ break;
+ case MIN_QUEUE:
+ if (q->pq_funs.compare_to_key(q->v[idx], key) < 0){
+ //q->pq_funs.set_key(q->v[idx], key);
+ q->v[idx]->key = key;
+ __bst_pq_queue_sift_down(q, idx);
+ }
+ else{
+ //q->pq_funs.set_key(q->v[idx], key);
+ q->v[idx]->key = key;
+ __bst_pq_queue_sift_up(q, idx);
+ }
+ break;
+ }
+ return 0;
+}
+
+
+
+void __bst_pq_queue_dump(bst_pq_t q){
+
+ int i;
+
+ unsigned int N;
+
+ N = q->last+1;
+
+ printf("N: %d last:%d root:", q->N, q->last);
+ if (q->last >=0)
+ q->pq_funs.print_elem(q->v[0]);
+ else
+ printf("NULL");
+ printf("\n");
+
+ for(i=0; i<N; i++){
+ if (i < (N+1)/2){
+ if (2*i+1 < N)
+ if (2*i + 2 < N){
+ printf("%d: ", i);
+ q->pq_funs.print_elem(q->v[i]);
+ printf(" (");
+ q->pq_funs.print_elem(q->v[2*i+1]);
+ printf(", ");
+ q->pq_funs.print_elem(q->v[2*i+2]);
+ printf(")\n");
+ }
+ else{
+ printf("%d: ", i);
+ q->pq_funs.print_elem(q->v[i]);
+ printf(" (");
+ q->pq_funs.print_elem(q->v[2*i+1]);
+ printf(", NULL)\n");
+ }
+ else{
+ printf("%d: ", i);
+ q->pq_funs.print_elem(q->v[i]);
+ printf(" (NULL, NULL)\n");
+ }
+ }
+ else{
+ printf("%d: ", i);
+ q->pq_funs.print_elem(q->v[i]);
+ printf(" (NULL, NULL)\n");
+ }
+ }
+ printf("\n");
+}
+
+
+
+
+/* bst_pq interface */
+
+/* init the BST_PQ -- TESTED --*/
+
+bst_pq_t bst_pq_create(ilfunc_t *bst_funs, gen_pqueue_func_t *pq_funs, char qtype,
+ unsigned int N, gen_stack_t *node_cache){
+
+ bst_pq_t b;
+
+ b = (bst_pq_t)malloc(sizeof(bst_pq_struct_t));
+ b->root = NULL;
+ b->bst_funs = *bst_funs;
+
+ b->bst_funs.fileout = stdout;
+ b->qtype = qtype;
+ b->N = N;
+ b->last = -1;
+ b->pq_funs = *pq_funs;
+ b->v = b->pq_funs.alloc_vector(N);
+ if (node_cache == NULL){
+ b->node_cache = malloc(sizeof(gen_stack_t));
+ gen_stack_create(b->node_cache);
+ }
+ else{
+ b->node_cache = node_cache;
+ }
+ return b;
+}
+
+
+
+
+
+
+
+/* insert a new element in the BST_PQ -- TESTED */
+void bst_pq_insert(bst_pq_t b, unsigned int elem_info, double elem_key){
+
+ /* insert the element in the tree first */
+ node_t *n;
+ int err;
+
+ n = __bst_pq_tree_lookup(b, elem_info);
+
+ /* The following assert should fail ONLY if there is an auto-loop */
+ assert(n == NULL);
+
+ if (gen_stack_empty(b->node_cache)){
+ n = (node_t*)malloc(sizeof(node_t));
+ //n->info = b->bst_funs.alloc();
+ //n->key = b->pq_funs.alloc_key();
+ }
+ else{
+ err = gen_stack_pop(b->node_cache, (void**) &n);
+ if (err){
+ n = malloc(sizeof(node_t));
+ //n->info = b->bst_funs.alloc();
+ //n->key = b->pq_funs.alloc_key();
+ }
+ }
+ //b->bst_funs.copy(elem_info, n->info);
+ n->info = elem_info;
+ n->left = n->right = NULL;
+ if (b->root == NULL){
+ b->root = n;
+ n->parent = NULL;
+ }
+ else{
+ err = __recursive_insert(b->root, n, & (b->bst_funs));
+ if(err){
+ fprintf(stderr, "Error during insert into BST!!! (%s: %d)\n",
+ __FILE__, __LINE__);
+ exit(23);
+ }
+ }
+ n->active = 1;
+ n->index = -1;
+ /* set the key as needed */
+ //b->pq_funs.copy_key(elem_key, n->key);
+ n->key = elem_key;
+
+ /* then, insert the pointer to the element in the PQ */
+ __bst_pq_queue_insert(b, n);
+
+}
+
+/* delete (or deactivate) the element associated to a given info -- TESTED --*/
+int bst_pq_delete(bst_pq_t b, unsigned int info){
+
+ node_t *n;
+
+ n = __bst_pq_tree_lookup(b, info);
+
+ if (n != NULL){
+ __tree_delete(b, n);
+ n->active = 0; /* deactivate the node */
+ /* After the node has been deleted from the tree, we add it to
+ the node cache */
+ gen_stack_push(b->node_cache, n);
+ __bst_pq_queue_delete_index(b, n->index); /* remove the reference form the PQ */
+ return 0; /* No problem */
+ }
+ return 1; /* the element does not exist */
+}
+
+/* change the key of an element in the BST_PQ -- TESTED --*/
+int bst_pq_change_key(bst_pq_t b, unsigned int info, double key){
+
+ node_t *n;
+ int idx;
+
+ n = __bst_pq_tree_lookup(b, info);
+ if (n != NULL){
+ /* the element exists. We should just force its key and sift as required */
+ idx = n->index;
+ __bst_pq_queue_force_key(b, idx, key);
+ return 0; /* No problem */
+ }
+ else{
+ return 1; /* The element does not exist */
+ }
+
+}
+
+/* return the head of the PQ -- TESTED --*/
+void* bst_pq_peek(bst_pq_t q){
+
+ return __bst_pq_queue_peek(q);
+}
+
+
+/* Read the key of a given node of the BST */
+double bst_pq_get_key(bst_pq_t b, unsigned int info){
+
+ node_t *n;
+
+ n = __bst_pq_tree_lookup(b, info);
+ if (n != NULL){
+ return n->key;
+ }
+ else{
+ return -100000;
+ }
+}
+
+
+/* Read the key of the element of index "index" in the PQ */
+double bst_pq_get_key_from_index(bst_pq_t b, int index){
+
+ node_t *n;
+
+ n = (node_t *)b->v[index];
+
+ return n->key;
+}
+
+
+/* Dump the BST -- TESTED -- */
+void bst_pq_dump_bst(bst_pq_t b){
+
+ __bst_pq_tree_view_pre(b);
+
+}
+
+/* Show the PQ -- TESTED -- */
+void bst_pq_dump_pq(bst_pq_t b){
+
+ __bst_pq_queue_dump(b);
+
+}
+
+/* Perform a lookup of an element in the BST_PQ -- TESTED-- */
+node_t* bst_pq_lookup(bst_pq_t b, unsigned int info){
+
+ return __bst_pq_tree_lookup(b, info);
+}
+
+
+node_t* bst_pq_lookup_active(bst_pq_t b, unsigned int info){
+
+ node_t *ptr;
+
+ ptr = __bst_pq_tree_lookup(b, info);
+
+ if(ptr)
+ assert(ptr->active != 0);
+
+ if (ptr != NULL && ptr->active){
+ return ptr;
+ }
+
+ return NULL;
+}
+
+
+/* void bst_pq_insert_existing(bst_pq_t b, node_t *n){ */
+
+/* /\* insert the element in the tree first *\/ */
+/* if (n == NULL){ */
+/* fprintf(stderr, "Error!!!! Attempt to insert a NULL existing element (%s: %d)\n", */
+/* __FILE__, __LINE__); */
+/* exit(37); */
+/* } */
+/* /\* n->info = b->bst_funs.alloc(); *\/ */
+/* /\* n->key = b->pq_funs.alloc_key(); *\/ */
+/* /\* b->bst_funs.copy(elem_info, n->info); *\/ */
+/* n->left = n->right = NULL; */
+/* if (b->root == NULL){ */
+/* b->root = n; */
+/* n->parent = NULL; */
+/* } */
+/* else{ */
+/* __recursive_insert(b->root, n, & (b->bst_funs)); */
+/* } */
+
+/* n->active = 1; */
+/* /\* set the key as needed *\/ */
+/* //b->pq_funs.copy_key(elem_key, n->key); */
+
+/* /\* then, insert the pointer to the element in the PQ *\/ */
+/* __bst_pq_queue_insert(b, n); */
+
+/* } */
+
+
+
+
+
+
+void bst_pq_destroy(bst_pq_t b, char destroy_cache){
+
+ int i;
+ node_t *n;
+
+ if (b == NULL)
+ return;
+
+ if(destroy_cache && b->node_cache != NULL ){
+ while(!gen_stack_pop(b->node_cache, (void**) &n)){
+ //b->bst_funs.dealloc(n->info);
+ //free(n->key);
+ free(n);
+ }
+ free(b->node_cache->v);
+ free(b->node_cache);
+ }
+
+ for(i=b->last; i>=0; i--){
+ __tree_delete(b, b->v[i]);
+ __bst_pq_queue_delete_index(b, i); /* remove the reference form the PQ */
+ //bst_pq_delete(b, b->v[i]->info);
+ //b->bst_funs.dealloc(b->v[i]->info);
+ //free(b->v[i]->key);
+ free(b->v[i]);
+ }
+ free(b->v);
+ free(b);
+}
diff --git a/src/cnm/bst_pq.h b/src/cnm/bst_pq.h
new file mode 100644
index 0000000..892eef0
--- /dev/null
+++ b/src/cnm/bst_pq.h
@@ -0,0 +1,159 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This is an implementation of a Binary Search Tree augmented by a
+ * Priority Queue. This data structure is central to the
+ * implementation of the Clauset-Newman-Moore greedy modularity
+ * optimisation algorithm
+ *
+ */
+
+#ifndef __BST_PQ_H__
+#define __BST_PQ_H__
+
+#include "gen_stack.h"
+
+
+/**
+ *
+ * This is an implementation of a Binary Search Tree augmented by a
+ * Priority Queue.
+ *
+ */
+
+#define PARENT(i) (int)(floor((i-1)/2))
+
+#define MIN_QUEUE 0x01
+#define MAX_QUEUE 0x02
+
+typedef struct node{
+ unsigned int info; /* This is the ID of the neighbour used in the BST */
+ double key; /* This is the \DeltaQ values used as a key in the
+ PQ */
+ struct node* left; /* left child of the current element in the BST */
+ struct node* right; /* right child of the current element in the BST */
+ int index; /* Index of the current node in the PQ */
+ struct node *parent; /* Parent of the current node in the BST */
+ char active; /* indicates whether the node is active or not */
+} node_t;
+
+
+typedef struct{
+ void* (*alloc)();
+ void (*dealloc)(void*);
+ //void (*copy)(void *src, void *dst);
+ int (*compare)(unsigned int e1, unsigned int e2);
+ void (*print)(unsigned int, void*);
+ void *fileout;
+} ilfunc_t;
+
+
+typedef struct{
+ int (*compare)(double e1, double e2); /* compare two elements (standard comparator) */
+ void* (*alloc_vector)(unsigned int N); /* */
+ void (*dealloc_vector)(void *v); /* */
+ void* (*alloc_key)(void); /* Allocate an element for the key */
+ void (*copy_key)(void *src, void *dst); /* copy into key */
+ void (*print_elem)(void *e); /* print an element */
+ void (*set_key)(void *e, double k); /* set a new key to element e */
+ int (*compare_to_key)(void *e, double key); /* compare a key with the one of element e */
+} gen_pqueue_func_t;
+
+
+typedef struct {
+ node_t* root; /* root of the BST */
+ int N; /* Maximum size of the PQ */
+ int last; /* last element in the PQ */
+ node_t **v; /* vector of pointers to the nodes of the BST */
+ char qtype; /* type of PQ, either MIN_QUEUE or MAX_QUEUE */
+ ilfunc_t bst_funs;
+ gen_pqueue_func_t pq_funs;
+ gen_stack_t *node_cache; /* this is a pointer to a cache of
+ allocated nodes, implemented as a stack */
+} bst_pq_struct_t;
+
+
+typedef bst_pq_struct_t* bst_pq_t;
+
+
+
+
+
+/* bst_pq interface */
+
+/* init the BST_PQ */
+
+bst_pq_t bst_pq_create(ilfunc_t* bst_funs, gen_pqueue_func_t* pq_funs, char qtype,
+ unsigned int N, gen_stack_t *node_cache);
+
+/* Destroy an existing BST_PQ */
+void bst_pq_destroy(bst_pq_t b, char clear_cache);
+
+/* lookup an element in the BST */
+node_t* bst_pq_lookup(bst_pq_t b, unsigned int info);
+
+/* insert a new element in the BST_PQ */
+void bst_pq_insert(bst_pq_t b, unsigned int info, double key);
+
+/* delete (or deactivate) an element in the BST_PQ */
+int bst_pq_delete(bst_pq_t b, unsigned int info);
+
+/* change the key of an element in the BST_PQ */
+int bst_pq_change_key(bst_pq_t b, unsigned int info, double key);
+
+/* return the head of the PQ */
+void* bst_pq_peek(bst_pq_t);
+
+/* Read the key of a given node of the BST */
+double bst_pq_get_key(bst_pq_t b, unsigned int info);
+
+/* Read the key of the element of index "index" in the PQ */
+double bst_pq_get_key_from_index(bst_pq_t b, int index);
+
+/* Dump the BST */
+void bst_pq_dump_bst(bst_pq_t b);
+
+/* Show the PQ */
+void bst_pq_dump_pq(bst_pq_t b);
+
+/* See if a node is in the BST, either active or inactive */
+node_t* bst_pq_lookup(bst_pq_t b, unsigned int info);
+
+/* See if a node is in the BST and is ACTIVE */
+node_t* bst_pq_lookup_active(bst_pq_t b, unsigned int info);
+
+
+/* Insert a pre-allocated node_t in the BST_PQ */
+//void bst_pq_insert_existing(bst_pq_t b, node_t *n);
+
+
+
+#endif /*__BST_PQ_H__*/
diff --git a/src/cnm/cnm.c b/src/cnm/cnm.c
new file mode 100644
index 0000000..d1afb3f
--- /dev/null
+++ b/src/cnm/cnm.c
@@ -0,0 +1,480 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program finds the communities in a graph using the greedy
+ * modularity optimisation algorithm proposed by Clauset, Newman, and
+ * Moore.
+ *
+ * References:
+ *
+ * [1] A. Clauset, M. E. J. Newman, and C. Moore. "Finding community
+ * structure in very large networks". Phys. Rev. E 70 (2004),
+ * 066111.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <math.h>
+
+#include "utils.h"
+#include "cnm_bst_pq.h"
+#include "dset.h"
+
+
+void usage(char *argv[]){
+
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- cnm -*- **\n"
+ "** **\n"
+ "** Find the communities of the input graph 'graph_in' using **\n"
+ "** the greedy modularity optimisation algorithm proposed by **\n"
+ "** Clauset, Newman, and Moore. **\n"
+ "** **\n"
+ "** The input file 'graph_in' is an edge-list. **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the file from **\n"
+ "** the standard input (STDIN). **\n"
+ "** **\n"
+ "** The program prints on STDOUT the partition corresponding **\n"
+ "** to the largest value of modularity, in the format: **\n"
+ "** **\n"
+ "** node_1 comm_1 **\n"
+ "** node_2 comm_2 **\n"
+ "** node_3 comm_3 **\n"
+ "** ..... **\n"
+ "** **\n"
+ "** where 'comm_1' is the community to which 'node_1' belongs. **\n"
+ "** **\n"
+ "** The program prints on STDERR the number of communities and **\n"
+ "** the value of modularity obtained at each step, in the **\n"
+ "** format: **\n"
+ "** **\n"
+ "** ## nc: NUM_COMM Q_max: Q_MAX **\n"
+ "** nc_1 Q_1 **\n"
+ "** nc_2 Q_2 **\n"
+ "** nc_3 Q_3 **\n"
+ "** ... **\n"
+ "** **\n"
+ "** where 'nc_1', 'nc_2', 'nc_3', etc. is the number of **\n"
+ "** communities at the 1st, 2nd, 3rd step etc., and 'Q_1', **\n"
+ "** 'Q_2', 'Q_3', etc. are the value of the modularity **\n"
+ "** function of the corresponding node partition. The first **\n"
+ "** output line reports the number of communities NUM_COMM **\n"
+ "** and corresponding value of modularity Q_MAX of the best **\n"
+ "** partition found. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in>\n", argv[0]);
+ exit(1);
+}
+
+
+/* shuffle a vector in-place */
+void shuffle_vector_ptr(unsigned int **v, unsigned int N){
+
+ int i, pos;
+ void *tmp;
+
+ for(i=N-1; i>=0; i--){
+ pos = rand() % N;
+ if (pos != i){
+ tmp = v[i];
+ v[i] = v[pos];
+ v[pos] = tmp;
+ }
+ }
+}
+
+
+
+
+/* initialise BST-related functions */
+void set_bst_funs(ilfunc_t *f){
+
+ f->alloc = cnm_bst_alloc;
+ f->dealloc = cnm_bst_dealloc;
+ f->compare = cnm_bst_compare;
+ f->print = cnm_bst_print;
+
+}
+
+/* Initialise priority-queue-related functions */
+void set_pq_funs(gen_pqueue_func_t *f){
+
+ f->compare = cnm_pq_compare;
+ f->alloc_vector = cnm_pq_alloc_vector;
+ f->dealloc_vector = cnm_pq_dealloc_vector;
+ f->alloc_key = cnm_pq_alloc_key;
+ f->copy_key = cnm_pq_copy_key;
+ f->print_elem = cnm_pq_print_elem;
+ f->set_key = cnm_pq_set_key;
+ f->compare_to_key = cnm_pq_compare_to_key;
+}
+
+
+
+void init_bsts(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ bst_pq_t *b, bst_pq_t *H, gen_stack_t *node_cache){
+
+ unsigned int i, j, n, m, deg_i, deg_j;
+ //struct_key_t dQ;
+ double dQ;
+ //struct_neigh_t ith, jth;
+ unsigned int K;
+ node_t *node_ptr;
+
+ ilfunc_t bst_funs;
+ gen_pqueue_func_t pq_funs;
+ unsigned int *nodes;
+
+ set_bst_funs(&bst_funs);
+ set_pq_funs(&pq_funs);
+
+ K = r_slap[N]/2;
+ *H = bst_pq_create(&bst_funs, &pq_funs, MAX_QUEUE, N, node_cache);
+ nodes = malloc(N * sizeof(unsigned int));
+ for (i=0; i<N; i++){
+ nodes[i] = i;
+ }
+ shuffle_vector(nodes, N);
+
+ for(n=0; n<N; n++){
+ i = nodes[n];
+ //ith.neigh = i;
+ deg_i = r_slap[i+1] - r_slap[i];
+ if (deg_i == 0){
+ b[i] = NULL;
+ continue;
+ }
+ /* create the BST_PQ for the current node i */
+ b[i] = bst_pq_create(&bst_funs, &pq_funs, MAX_QUEUE, deg_i, node_cache);
+ /* Let's shuffle the ids of the neighbours of i, to have a somehow
+ balanced BST on average */
+ shuffle_vector(J_slap + r_slap[i], deg_i);
+ /* Now we insert all the neighbours of i into b[i] */
+ for(m = r_slap[i]; m<r_slap[i+1]; m++){
+ j = J_slap[m];
+ if(i == j)
+ continue;
+ deg_j = r_slap[j + 1] - r_slap[j];
+ dQ = 2.0 * (1.0 / (2.0*K) - 1.0 * (deg_i * deg_j)/ (4.0 * K * K));
+ bst_pq_insert(b[i], j, dQ);
+ }
+ /* then we get the maximum value of modularity in the neighbourhood of i */
+ node_ptr = bst_pq_peek(b[i]);
+ if (node_ptr){
+ dQ = cnm_get_Q(node_ptr);
+ /* and insert it into H */
+ bst_pq_insert(*H, i, dQ);
+ }
+ }
+ free(nodes);
+}
+
+
+dset_t* cnm(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ bst_pq_t *b, bst_pq_t H){
+
+ double *a;
+ double Q;
+ double dQ_ik, dQ_jk, corr;
+ double dQ;
+ //struct_neigh_t ith, jth, kth;
+ int i, j, k;
+ node_t *best, *merge, *tmp;
+ unsigned int K;
+ node_t **neighs; /* pointers to the neighbours of a node */
+ int num_neighs;
+ double Q_max;
+ int l, m, N_max;
+ double Q_step;
+ char found_max;
+
+ dset_t *comms;
+
+ Q = 0;
+ K = r_slap[N]/2;
+
+
+ a = malloc(N * sizeof(double));
+ neighs = malloc(N * sizeof(node_t*));
+
+ comms = malloc(N * sizeof(dset_t));
+
+ for (l=0; l<N; l++){
+ a[l] = 1.0 * (r_slap[l+1] - r_slap[l]) / (2.0 * K);
+ Q -= a[l] * a[l];
+ comms[l] = NULL;
+ dset_makeset_id(comms + l, l);
+ }
+
+ Q_max = Q;
+ N_max = N;
+ found_max = 0;
+
+ for(l=0; l<N; l++){
+ fprintf(stderr, "%d %g\n", N-l, Q);
+ /* Get the maximum from H and remove the element */
+ best = bst_pq_peek(H);
+ if (!best)
+ break;
+ j = cnm_get_id(best);
+
+ //Q_step = cnm_get_Q(best);
+ merge = bst_pq_peek(b[j]);
+ if (!merge){
+ /* the node j does not have any neighbour, indeed... discard it
+ and continue */
+ bst_pq_delete(H, j);
+ continue;
+ }
+
+ i = cnm_get_id(merge);
+ /* So, we will merge community i into community j */
+ if (i == j){
+ /* This should never happen */
+ fprintf(stderr, "Error!!!! i and j are the same node!!!!\n");
+ exit(1);
+ }
+
+ Q_step = cnm_get_Q(best);
+ if (Q_step < 0){
+ found_max = 1;
+ }
+ Q += Q_step;
+
+
+ /* Let's go to the neighbours of i */
+ memcpy(neighs, b[i]->v, (b[i]->last + 1) * sizeof(node_t *));
+ num_neighs = b[i]->last + 1;
+ shuffle_vector_ptr((void*)neighs, num_neighs);
+
+ for(m=0; m<num_neighs; m++){
+ /* let's call this neighbour k */
+ k = cnm_get_id(neighs[m]);
+
+ if (k == j)
+ continue;
+ /* let's check whether k is also a neighbour of j already */
+ tmp = bst_pq_lookup_active(b[j], k);
+ if (tmp){ /* this is a closed triangle k-i-j */
+ dQ_ik = cnm_get_Q(neighs[m]); /* this is i-k*/
+ dQ_jk = cnm_get_Q(tmp); /* this is j-k */
+
+ dQ = dQ_ik + dQ_jk;
+
+ /* now we update Q_jk and Q_kj */
+ if (bst_pq_change_key(b[j], k, dQ)){
+ fprintf(stderr, "error changing key %d into %d-th tree!!! (%s: %d)\n",
+ k, j, __FILE__, __LINE__);
+ exit(1);
+ }
+ if (bst_pq_change_key(b[k], j, dQ)){
+ fprintf(stderr, "error changing key %d into %d-th tree!!! (%s: %d)\n",
+ j, k, __FILE__, __LINE__);
+ exit(1);
+ }
+ bst_pq_delete(b[k], i);
+ }
+ else{ /* this is a chain k-i-j */
+ dQ_ik = cnm_get_Q(neighs[m]);
+ corr = -2.0 * a[j] * a[k];
+ dQ = dQ_ik + corr;
+
+ /* we add Q_{jk} which did not exist before */
+ bst_pq_insert(b[j], k, dQ);
+ /* we add Q_{kj} which did not exist before */
+ bst_pq_insert(b[k], j, dQ);
+ bst_pq_delete(b[k], i);
+ }
+
+ /* now we update the maximum value associated to k in H */
+ tmp = bst_pq_peek(b[k]);
+ if (tmp){
+ dQ = cnm_get_Q(tmp);
+ bst_pq_change_key(H, k, dQ);
+ }
+ }
+
+ /* We delete the value associated to i in j */
+ bst_pq_delete(b[j], i);
+
+
+ /* Let's start with the neighbours of j */
+ memcpy(neighs, b[j]->v, (b[j]->last + 1) * sizeof(node_t *));
+ num_neighs = b[j]->last + 1;
+ shuffle_vector_ptr((void*)neighs, num_neighs);
+
+ for(m=0; m<num_neighs; m++){
+ k = cnm_get_id(neighs[m]);
+ if (k == i)
+ continue;
+ /* let's check whether k is also a neighbour of i */
+ tmp = bst_pq_lookup_active(b[i], k);
+ if(! tmp){ /* this is a chain i-j-k */
+ dQ_jk = cnm_get_Q(neighs[m]);
+ corr = -2.0 * a[i] * a[k];
+ dQ = dQ_jk + corr;
+
+ /* update Q_jk and Q_kj */
+ if (bst_pq_change_key(b[j], k, dQ)){
+ fprintf(stderr, "error changing key %d into %d-th tree!!! (%s: %d)\n",
+ k, j, __FILE__, __LINE__);
+ exit(1);
+
+ }
+ if (bst_pq_change_key(b[k], j, dQ)){
+ fprintf(stderr, "error changing key %d into %d-th tree!!! (%s: %d)\n",
+ j, k, __FILE__, __LINE__);
+ exit(1);
+ }
+ }
+
+ /* now we update the value associated to k in H */
+ tmp = bst_pq_peek(b[k]);
+ if (tmp){
+ dQ = cnm_get_Q(tmp);
+ bst_pq_change_key(H, k, dQ);
+ }
+ }
+
+ /* We can now free the BST_PQ associated to node i, since it will
+ not be used ever again...*/
+ bst_pq_destroy(b[i], 0);
+ b[i] = NULL;
+
+ /* We can now remove the value associated to i in H */
+ bst_pq_delete(H, i);
+
+ /* OK, now we should update the value associated to j in H */
+ tmp = bst_pq_peek(b[j]);
+ if (tmp){
+ dQ = cnm_get_Q(tmp);
+ bst_pq_change_key(H, j, dQ);
+ }
+ a[j]+= a[i];
+ a[i] = 0;
+ if (! found_max)
+ dset_union_opt(comms[j], comms[i]);
+
+ if (Q>Q_max){
+ Q_max = Q;
+ N_max = N-l-1;
+ }
+ }
+ fprintf(stdout, "### nc: %d Q_max: %g\n", N_max, Q_max);
+ free(a);
+ free(neighs);
+
+ return comms;
+}
+
+
+void dump_communities(dset_t *comms, unsigned int N){
+
+ int i;
+
+ for(i=0; i<N; i++){
+ fprintf(stdout, "%d %d\n", i, dset_find_id_opt(comms[i]));
+ }
+}
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int *J_slap = NULL, *r_slap = NULL;
+ unsigned int N, K;
+ bst_pq_t *b = NULL;
+ bst_pq_t H = NULL;
+ dset_t *comms;
+ int i;
+
+ gen_stack_t *node_cache = NULL;
+
+ FILE *filein;
+
+ if(argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+ srand(time(NULL));
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+
+ read_slap(filein, &K, &N, &J_slap, &r_slap);
+
+ b = malloc(N * sizeof(bst_pq_t));
+
+ node_cache = malloc(sizeof(gen_stack_t));
+ gen_stack_create(node_cache);
+
+
+ init_bsts(J_slap, r_slap, N, b, &H, node_cache);
+
+
+ comms = cnm(J_slap, r_slap, N, b, H);
+ dump_communities(comms, N);
+
+ free(J_slap);
+ free(r_slap);
+ for(i=0; i<N; i++){
+ if(b[i]){
+ bst_pq_destroy(b[i], 0);
+ }
+ if (comms[i])
+ free(comms[i]);
+ }
+ free(b);
+ bst_pq_destroy(H, 1);
+ free(comms);
+ fclose(filein);
+ return 0;
+}
+
+
+
diff --git a/src/cnm/cnm_bst_pq.c b/src/cnm/cnm_bst_pq.c
new file mode 100644
index 0000000..acbdfad
--- /dev/null
+++ b/src/cnm/cnm_bst_pq.c
@@ -0,0 +1,155 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Functions used to manage the special BST-augmented priority queue
+ * used in the Clauset-Newman-Moore greedy modularity optimisation
+ * algorithm.
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "cnm_bst_pq.h"
+
+
+/* Prototypes for BST-related functions */
+
+void* cnm_bst_alloc(){
+
+ /* nothing to be done, actually*/
+ return NULL; // malloc(sizeof(struct_neigh_t));
+}
+
+void cnm_bst_dealloc(void *info){
+
+ /* Nothing to be done, actually */
+ return;
+}
+
+
+int cnm_bst_compare(unsigned int e1, unsigned int e2){
+
+ //struct_neigh_t *i1, *i2;
+
+ /* i1 = (struct_neigh_t*)e1; */
+ /* i2 = (struct_neigh_t*)e2; */
+
+ //return (((struct_neigh_t*)e1)->neigh - ((struct_neigh_t*)e2)->neigh);
+ return e1 - e2;
+}
+
+void cnm_bst_print(unsigned int elem, void *fout){
+ fprintf(fout, " %d ", elem);
+}
+
+
+/* Prototypes for PQ-related functions */
+
+int cnm_pq_compare(double e1, double e2){
+
+ return (e1 - e2) > 0 ? 1 : (e1 - e2) < 0 ? -1 : 0;
+}
+
+void* cnm_pq_alloc_vector(unsigned int N){
+
+ return malloc(N * sizeof(node_t*));
+}
+
+void cnm_pq_dealloc_vector(void *v){
+
+ free (v);
+}
+
+void* cnm_pq_alloc_key(void){
+
+
+ //return malloc(sizeof(struct_key_t));
+ return NULL;
+}
+
+void cnm_pq_copy_key(void *src, void *dst){
+
+ struct_key_t *k1 = (struct_key_t *)src;
+ struct_key_t *k2 = (struct_key_t *)dst;
+
+ k2->deltaQ = k1->deltaQ;
+
+}
+
+void cnm_pq_print_elem(void *e){
+
+ node_t *n = (node_t*)e;
+ printf("%g{%d [%d]}", n->key, n->info, n->index);
+
+}
+
+
+double cnm_pq_get_key(void *e){
+
+ node_t *n;
+
+ n = (node_t *)e;
+ return n->key;
+}
+
+void cnm_pq_set_key(void *e, double k){
+
+ node_t *n;
+
+ n = (node_t *)e;
+ n->key = k;
+}
+
+int cnm_pq_compare_to_key(void *e, double key){
+
+ double d1;
+ d1 = ((node_t*)e)->key;
+
+ return (d1 - key) > 0 ? 1 : (d1 - key) < 0 ? -1 : 0;
+}
+
+
+
+unsigned int cnm_get_id(node_t *n){
+
+ return n->info;
+}
+
+
+double cnm_get_Q(node_t *n){
+
+ if (n)
+ return n->key;
+ else
+ return 0;
+}
diff --git a/src/cnm/cnm_bst_pq.h b/src/cnm/cnm_bst_pq.h
new file mode 100644
index 0000000..f49687a
--- /dev/null
+++ b/src/cnm/cnm_bst_pq.h
@@ -0,0 +1,105 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Functions used to manage the special BST-augmented priority queue
+ * used in the Clauset-Newman-Moore greedy modularity optimisation
+ * algorithm.
+ *
+ */
+
+#ifndef __CNM_BST_PQ_H__
+#define __CNM_BST_PQ_H__
+
+#include "bst_pq.h"
+
+/**
+ *
+ * Specific functions needed for the management of the BST_PQ used in
+ * the implementation of CNM
+ *
+ * (c) Vincenzo Nicosia (KatolaZ) -- 2016
+ */
+
+/* data structure for the id, to be used by the BST */
+typedef struct{
+ int neigh; /* This is the label of a neighbour */
+} struct_neigh_t;
+
+
+/* data structure for the key, to be used by the PQ */
+typedef struct{
+ double deltaQ; /* This is the variation in modularity associated to
+ the join with neighbour contained in info */
+} struct_key_t;
+
+
+/* Prototypes for BST-related functions */
+
+void* cnm_bst_alloc();
+
+void cnm_bst_dealloc(void*);
+
+//void cnm_bst_copy(unsigned int src, unsigned int dst);
+
+int cnm_bst_compare(unsigned int, unsigned int );
+
+void cnm_bst_print(unsigned int, void*);
+
+
+/* Prototypes for PQ-related functions */
+
+int cnm_pq_compare(double e1, double e2);
+
+void* cnm_pq_alloc_vector(unsigned int N);
+
+void cnm_pq_dealloc_vector(void *v);
+
+void* cnm_pq_alloc_key(void);
+
+void cnm_pq_copy_key(void *src, void *dst);
+
+void cnm_pq_print_elem(void *e);
+
+double cnm_pq_get_key(void *e);
+
+void cnm_pq_set_key(void *e, double k);
+
+int cnm_pq_compare_to_key(void *e, double key);
+
+unsigned int cnm_get_id(node_t *);
+
+double cnm_get_Q(node_t *);
+
+
+
+
+#endif /*__CNM_BST_PQ_H__*/
+
diff --git a/src/common.mk b/src/common.mk
new file mode 100644
index 0000000..69414e6
--- /dev/null
+++ b/src/common.mk
@@ -0,0 +1 @@
+AM_CFLAGS= -I../include -O2 -std=c99 -Wall
diff --git a/src/components/Makefile.am b/src/components/Makefile.am
new file mode 100644
index 0000000..df629ab
--- /dev/null
+++ b/src/components/Makefile.am
@@ -0,0 +1,10 @@
+include ../common.mk
+bin_PROGRAMS = components largest_component strong_conn node_components
+components_SOURCES = components.c ../utils/utils.c ../include/utils.h
+components_LDADD = -lm
+largest_component_SOURCES = largest_component.c ../utils/utils.c ../include/utils.h
+largest_component_LDADD = -lm
+strong_conn_SOURCES = strong_conn.c ../utils/utils.c ../include/utils.h
+strong_conn_LDADD = -lm
+node_components_SOURCES = node_components.c ../utils/utils.c ../include/utils.h
+node_components_LDADD = -lm
diff --git a/src/components/Makefile.in b/src/components/Makefile.in
new file mode 100644
index 0000000..a36407b
--- /dev/null
+++ b/src/components/Makefile.in
@@ -0,0 +1,614 @@
+# 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 = :
+bin_PROGRAMS = components$(EXEEXT) largest_component$(EXEEXT) \
+ strong_conn$(EXEEXT) node_components$(EXEEXT)
+subdir = src/components
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_components_OBJECTS = components.$(OBJEXT) ../utils/utils.$(OBJEXT)
+components_OBJECTS = $(am_components_OBJECTS)
+components_DEPENDENCIES =
+am_largest_component_OBJECTS = largest_component.$(OBJEXT) \
+ ../utils/utils.$(OBJEXT)
+largest_component_OBJECTS = $(am_largest_component_OBJECTS)
+largest_component_DEPENDENCIES =
+am_node_components_OBJECTS = node_components.$(OBJEXT) \
+ ../utils/utils.$(OBJEXT)
+node_components_OBJECTS = $(am_node_components_OBJECTS)
+node_components_DEPENDENCIES =
+am_strong_conn_OBJECTS = strong_conn.$(OBJEXT) \
+ ../utils/utils.$(OBJEXT)
+strong_conn_OBJECTS = $(am_strong_conn_OBJECTS)
+strong_conn_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(components_SOURCES) $(largest_component_SOURCES) \
+ $(node_components_SOURCES) $(strong_conn_SOURCES)
+DIST_SOURCES = $(components_SOURCES) $(largest_component_SOURCES) \
+ $(node_components_SOURCES) $(strong_conn_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+components_SOURCES = components.c ../utils/utils.c ../include/utils.h
+components_LDADD = -lm
+largest_component_SOURCES = largest_component.c ../utils/utils.c ../include/utils.h
+largest_component_LDADD = -lm
+strong_conn_SOURCES = strong_conn.c ../utils/utils.c ../include/utils.h
+strong_conn_LDADD = -lm
+node_components_SOURCES = node_components.c ../utils/utils.c ../include/utils.h
+node_components_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/components/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/components/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+components$(EXEEXT): $(components_OBJECTS) $(components_DEPENDENCIES) $(EXTRA_components_DEPENDENCIES)
+ @rm -f components$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(components_OBJECTS) $(components_LDADD) $(LIBS)
+
+largest_component$(EXEEXT): $(largest_component_OBJECTS) $(largest_component_DEPENDENCIES) $(EXTRA_largest_component_DEPENDENCIES)
+ @rm -f largest_component$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(largest_component_OBJECTS) $(largest_component_LDADD) $(LIBS)
+
+node_components$(EXEEXT): $(node_components_OBJECTS) $(node_components_DEPENDENCIES) $(EXTRA_node_components_DEPENDENCIES)
+ @rm -f node_components$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(node_components_OBJECTS) $(node_components_LDADD) $(LIBS)
+
+strong_conn$(EXEEXT): $(strong_conn_OBJECTS) $(strong_conn_DEPENDENCIES) $(EXTRA_strong_conn_DEPENDENCIES)
+ @rm -f strong_conn$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(strong_conn_OBJECTS) $(strong_conn_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/components.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/largest_component.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node_components.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strong_conn.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/components/components.c b/src/components/components.c
new file mode 100644
index 0000000..a5dc52d
--- /dev/null
+++ b/src/components/components.c
@@ -0,0 +1,207 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program implements the Depth-First Search algorithm to find
+ * the connected components of a graph provided as input.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "utils.h"
+
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- components -*- **\n"
+ "** **\n"
+ "** Find the connected components of an undirected graph **\n"
+ "** and print on output their size and/or the list of nodes **\n"
+ "** belonging to each component. The first parameter 'graph_in' **\n"
+ "** is the name of the file containing the edge list of the **\n"
+ "** graph. **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the edge list **\n"
+ "** from standard input (STDIN). **\n"
+ "** **\n"
+ "** The program prints on output the SIZE of each connected **\n"
+ "** component of the graph, one per line: **\n"
+ "** **\n"
+ "** size_1 **\n"
+ "** size_2 **\n"
+ "** size_3 **\n"
+ "** **\n"
+ "** The sizes are in no particular order. **\n"
+ "** **\n"
+ "** If 'SHOW' is given as second argument, the list of nodes **\n"
+ "** belonging to each component is printed as well, in the **\n"
+ "** format: **\n"
+ "** **\n"
+ "** size_1: node_1 node_2 node_3 .... **\n"
+ "** size_2: node_1 node_2 node_3 .... **\n"
+ "** size_3: node_1 node_2 node_3 .... **\n"
+ "** **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in> [SHOW]\n\n" , argv[0]);
+}
+
+
+
+/**
+ *
+ * Depth-First search on node i....
+ *
+ */
+int dfs(unsigned int i, unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int N, unsigned int nc,
+ unsigned int *ic, unsigned int *f,
+ char reset){
+
+ static unsigned int time;
+ unsigned int j, s;
+
+ if(reset){
+ time = 0;
+ }
+
+ ic[i] = nc;
+ s = 1;
+ time += 1;
+
+ for(j=r_slap[i]; j<r_slap[i+1]; j++){
+ if (ic[J_slap[j]] == 0){
+ s += dfs(J_slap[j], J_slap, r_slap, N, nc, ic, f, 0);
+ }
+ }
+ time += 1;
+ f[i] = time;
+ return s;
+}
+
+/**
+ *
+ * Find all the components of the given graph, using the Depth-First
+ * Search algorithm
+ *
+ */
+
+int components(unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int N, unsigned int **ic,
+ unsigned int **f, unsigned int **sizes){
+
+ unsigned int nc, s;
+ unsigned int i;
+
+ *ic = malloc(N * sizeof(unsigned int));
+ *f = malloc(N * sizeof(unsigned int));
+ *sizes = malloc((N+1) * sizeof(unsigned int));
+
+ for(i=0; i<N; i++){
+ (*ic)[i] = 0;
+ (*f)[i] = 0;
+ }
+ nc = 0;
+ for(i=0; i<N; i++){
+ while( i<N && (*ic) [i] != 0 )
+ i += 1;
+ if (i == N)
+ break;
+ nc += 1;
+ s = dfs(i, J_slap, r_slap, N, nc, *ic, *f, 1);
+ (*sizes)[nc] = s;
+ }
+ return nc;
+}
+
+
+int main(int argc, char *argv[]){
+
+
+ FILE *filein;
+ unsigned int N, K;
+ unsigned int *J_slap, *r_slap;
+ unsigned int *ic, *f, *sizes;
+ unsigned int nc, i, j;
+ char show = 0;
+
+
+ if (argc < 2){
+ usage(argv);
+ exit(1);
+ }
+ if (argc >2 && !my_strcasecmp("SHOW", argv[2])){
+ show = 1;
+ }
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ read_slap(filein, &K, &N, &J_slap, &r_slap);
+ fclose(filein);
+
+ nc = components(J_slap, r_slap, N, &ic, &f, &sizes);
+ for(i=1; i<=nc; i++){
+ printf("%d", sizes[i]);
+ if (show){
+ printf(":");
+ for(j=0; j<N; j++){
+ if (ic[j] == i){
+ printf(" %d", j);
+ }
+ }
+ printf("\n");
+ }
+ else{
+ printf("\n");
+ }
+ }
+ free(f);
+ free(ic);
+ free(sizes);
+ free(J_slap);
+ free(r_slap);
+}
diff --git a/src/components/largest_component.c b/src/components/largest_component.c
new file mode 100644
index 0000000..06a26eb
--- /dev/null
+++ b/src/components/largest_component.c
@@ -0,0 +1,191 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Compute the largest connected component of a graph (i.e., the
+ * connected component that contains the largest number of nodes).
+ *
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "utils.h"
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- largest_component -*- **\n"
+ "** **\n"
+ "** Find the largest connected component of 'graph_in'. **\n"
+ "** **\n"
+ "** The input file 'graph_in' is an edge-list: **\n"
+ "** **\n"
+ "** I_1 J_1 **\n"
+ "** I_2 J_2 **\n"
+ "** I_3 J_3 **\n"
+ "** ... ... **\n"
+ "** I_K J_K **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the file from **\n"
+ "** the standard input (STDIN). **\n"
+ "** **\n"
+ "** The program prints on STDOUT the edge list of the largest **\n"
+ "** connected component of 'graph_in'. **\n"
+ "** **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+
+ printf("Usage: %s <graph_in>\n", argv[0]);
+}
+
+
+
+/**
+ *
+ * Depth-First search on the node i....
+ *
+ */
+int dfs(unsigned int i, unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int N, unsigned int nc,
+ unsigned int *ic, unsigned int *f,
+ char reset){
+
+ static unsigned int time;
+ unsigned int j, s;
+
+ if(reset){
+ time = 0;
+ }
+
+ ic[i] = nc;
+ s = 1;
+ time += 1;
+
+ for(j=r_slap[i]; j<r_slap[i+1]; j++){
+ if (ic[J_slap[j]] == 0){
+ s += dfs(J_slap[j], J_slap, r_slap, N, nc, ic, f, 0);
+ }
+ }
+ time += 1;
+ f[i] = time;
+ return s;
+}
+
+/**
+ *
+ * Find all the components of the given graph
+ *
+ */
+int components(unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int N, unsigned int **ic,
+ unsigned int **f, unsigned int **sizes){
+
+ unsigned int nc, s;
+ unsigned int i;
+
+ *ic = malloc(N * sizeof(unsigned int));
+ *f = malloc(N * sizeof(unsigned int));
+ *sizes = malloc(N * sizeof(unsigned int));
+
+ for(i=0; i<N; i++){
+ (*ic)[i] = 0;
+ (*f)[i] = 0;
+ }
+ nc = 0;
+ for(i=0; i<N; i++){
+ while( (*ic) [i] != 0 && i < N)
+ i += 1;
+ if (i == N)
+ break;
+ nc += 1;
+ s = dfs(i, J_slap, r_slap, N, nc, *ic, *f, 1);
+ (*sizes)[nc] = s;
+ }
+ return nc;
+}
+
+
+int main(int argc, char *argv[]){
+
+
+ FILE *filein;
+ unsigned int N, K;
+ unsigned int *J_slap, *r_slap;
+ unsigned int *ic, *f, *sizes;
+ unsigned int nc, i, j, max_c;
+
+
+ if (argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ read_slap(filein, &K, &N, &J_slap, &r_slap);
+ fclose(filein);
+ nc = components(J_slap, r_slap, N, &ic, &f, &sizes);
+
+ max_c = 1;
+ for(i=2; i<=nc; i++){
+ if (sizes[i] > sizes[max_c])
+ max_c = i;
+ }
+ for(i=0; i<N; i++){
+ if(ic[i] == max_c){
+ for(j=r_slap[i]; j<r_slap[i+1]; j++){
+ if (J_slap[j] > i)
+ fprintf(stdout, "%d %d\n", i, J_slap[j]);
+ }
+ }
+ }
+ free(J_slap);
+ free(r_slap);
+ free(ic);
+ free(f);
+ free(sizes);
+}
diff --git a/src/components/node_components.c b/src/components/node_components.c
new file mode 100644
index 0000000..33477f6
--- /dev/null
+++ b/src/components/node_components.c
@@ -0,0 +1,442 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program computes (the size of) all the components associated
+ * to a node, namely the OUT-, IN-, SCC (strongly connected
+ * component), and the WCC (weekly connected component).
+ *
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "utils.h"
+
+#define COMP_IN 0x01
+#define COMP_OUT 0x02
+#define COMP_WCC 0x04
+#define COMP_SCC 0x08
+#define COMP_ALL (COMP_IN | COMP_OUT | COMP_WCC | COMP_SCC)
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- node_components -*- **\n"
+ "** **\n"
+ "** Find all the components associated to a node of a directed **\n"
+ "** graph, namely the IN-, OUT-, SCC, and WCC, and print on **\n"
+ "** output their size and/or the list of nodes belonging to **\n"
+ "** each component. The first parameter 'graph_in' is the name **\n"
+ "** of the file containing the edge list of the graph. **\n"
+ "** **\n"
+ "** The second parameter 'node' is the label of the node whose **\n"
+ "** components we are interested in. The (optional) third **\n"
+ "** parameter <component> can be one of 'IN', 'OUT', 'INOUT', **\n"
+ "** 'SCC', 'WCC', respectively corresponding to the IN-, OUT-, **\n"
+ "** IN- and OUT-, strongly connected and weakly connected **\n"
+ "** component to which 'node' belongs. If the <component> is **\n"
+ "** 'ALL', the program computes all the components to which **\n"
+ "** 'node' belongs. If no third parameter is provided, all **\n"
+ "** the components are computed by default. **\n"
+ "** **\n"
+ "** If SHOW is given as fourth argument, the list nodes in each **\n"
+ "** component is dumped on output as well. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in> <node> [<component> [SHOW]]\n\n" , argv[0]);
+}
+
+int dfs(unsigned int i, unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int N, unsigned int nc,
+ unsigned int *ic, unsigned int *f,
+ char reset){
+
+ static unsigned int time = 0;
+ unsigned int j, s;
+
+ if(reset){
+ time = 0;
+ }
+
+ ic[i] = nc;
+ s = 1;
+
+ for(j=r_slap[i]; j<r_slap[i+1]; j++){
+ if (ic[J_slap[j]] == 0){
+ s += dfs(J_slap[j], J_slap, r_slap, N, nc, ic, f, 0);
+ }
+ }
+ f[time] = i;
+ time += 1;
+ return s;
+}
+
+
+
+/**
+ *
+ * Find all the components of the given graph
+ *
+ */
+
+int components(unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int N, unsigned int **ic,
+ unsigned int **f, unsigned int **sizes){
+
+ unsigned int nc, s;
+ unsigned int i;
+
+ *ic = malloc(N * sizeof(unsigned int));
+ *f = malloc(N * sizeof(unsigned int));
+ *sizes = malloc((N+1) * sizeof(unsigned int));
+
+ for(i=0; i<N; i++){
+ (*ic)[i] = 0;
+ (*f)[i] = 0;
+ }
+ nc = 0;
+ for(i=0; i<N; i++){
+ while( i < N && (*ic) [i] != 0 )
+ i += 1;
+ if (i == N)
+ break;
+ nc += 1;
+ if (nc ==1){
+ s = dfs(i, J_slap, r_slap, N, nc, *ic, *f, 1);
+ }
+ else{
+ s = dfs(i, J_slap, r_slap, N, nc, *ic, *f, 0);
+ }
+
+ (*sizes)[nc] = s;
+ }
+ return nc;
+}
+
+
+
+int components_rev(unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int N, unsigned int **ic,
+ unsigned int *f, unsigned int **f_T, unsigned int **sizes){
+
+ unsigned int nc, s;
+ unsigned int idx;
+ int i;
+
+ *ic = malloc(N * sizeof(unsigned int));
+ *f_T = malloc(N * sizeof(unsigned int));
+ *sizes = malloc(N * sizeof(unsigned int));
+
+ for(i=0; i<N; i++){
+ (*ic)[i] = 0;
+ }
+ nc = 0;
+ for(i=N-1; i>=0; i--){
+ idx = f[i];
+ while( (*ic) [idx] != 0 && i > 0 ){
+ i -= 1;
+ idx = f[i];
+ }
+ if (i == 0)
+ break;
+ nc += 1;
+ if (nc == 1){
+ s = dfs(idx, J_slap, r_slap, N, nc, *ic, *f_T, 1);
+ }
+ else{
+ s = dfs(idx, J_slap, r_slap, N, nc, *ic, *f_T, 1);
+ }
+ (*sizes)[nc] = s;
+ }
+ return nc;
+}
+
+
+void compute_comp_out(FILE *filein, unsigned int node, char show){
+
+ unsigned int N, K, size, i;
+ unsigned int *J_slap, *r_slap, *ic, *f, *I, *J;
+
+ I = J = NULL;
+ K = read_ij(filein, &I, &J);
+ rewind(filein);
+
+ J_slap = NULL;
+ r_slap = NULL;
+ /* obtain the SLAP representation of the graph */
+ N = convert_ij2slap(I, J, K, &r_slap, &J_slap);
+
+ ic = malloc(N * sizeof(unsigned int));
+ f = malloc(N * sizeof(unsigned int));
+ for(i=0; i<N; i++){
+ ic[i] = 0;
+ }
+
+
+ size = dfs(node, J_slap, r_slap, N, 1, ic, f, 1);
+
+ printf("OUT: %d", size);
+ if (show){
+ for(i=0; i<N; i++){
+ if (ic[i] == 1){
+ printf(" %d", i);
+ }
+ }
+ }
+ printf("\n");
+ free(ic);
+ free(f);
+ free(I);
+ free(J);
+ free(J_slap);
+ free(r_slap);
+}
+
+void compute_comp_in(FILE *filein, unsigned int node, char show){
+
+ unsigned int N, K, size, i;
+ unsigned int *J_slap, *r_slap, *ic, *f, *I, *J;
+
+ I = J = NULL;
+
+ K = read_ij(filein, &I, &J);
+ rewind(filein);
+
+ J_slap = NULL;
+ r_slap = NULL;
+ /* obtain the SLAP representation of the graph */
+ N = convert_ij2slap(J, I, K, &r_slap, &J_slap);
+
+
+ ic = malloc(N * sizeof(unsigned int));
+ f = malloc(N * sizeof(unsigned int));
+ for(i=0; i<N; i++){
+ ic[i] = 0;
+ }
+
+
+ size = dfs(node, J_slap, r_slap, N, 1, ic, f, 1);
+
+ printf("IN: %d", size);
+ if (show){
+ for(i=0; i<N; i++){
+ if (ic[i] == 1){
+ printf(" %d", i);
+ }
+ }
+ }
+ printf("\n");
+ free(ic);
+ free(f);
+ free(I);
+ free(J);
+ free(J_slap);
+ free(r_slap);
+}
+
+
+
+
+void compute_wcc(FILE *filein, unsigned int node, char show){
+
+ unsigned int N, K;
+ unsigned int *J_slap, *r_slap;
+ unsigned int *ic, *f, *sizes;
+ unsigned int j, node_comp;
+
+
+ read_slap(filein, &K, &N, &J_slap, &r_slap);
+
+ rewind(filein);
+
+ components(J_slap, r_slap, N, &ic, &f, &sizes);
+
+ node_comp = ic[node];
+
+ printf("WCC: %d", sizes[node_comp]);
+ if (show){
+ //printf(": ");
+ for(j=0; j<N; j++){
+ if (ic[j] == node_comp){
+ printf(" %d", j);
+ }
+ }
+ printf("\n");
+ }
+ else{
+ printf("\n");
+ }
+ free(sizes);
+ free(J_slap);
+ free(r_slap);
+ free(ic);
+ free(f);
+}
+
+void compute_scc(FILE *filein, unsigned int node, char show){
+
+ unsigned int N, K, N1, N2;
+ unsigned int *I, *J, *J_slap, *r_slap, *J_slap_T, *r_slap_T;
+ unsigned int *ic, *f, *ic_T, *f_T, *sizes_T, *sizes;
+ unsigned int j;
+ unsigned int node_comp;
+
+
+
+ I = J = NULL;
+ K = read_ij(filein, &I, &J);
+
+ rewind(filein);
+
+
+ J_slap = J_slap_T = NULL;
+ r_slap = r_slap_T = NULL;
+ /* obtain the SLAP representation of the graph */
+ N1 = convert_ij2slap(I, J, K, &r_slap, &J_slap);
+ /* obtain the SLAP representation of the transposed graph */
+ N2 = convert_ij2slap(J, I, K, &r_slap_T, &J_slap_T);
+ N = N1 >= N2 ? N1 : N2;
+
+ components(J_slap, r_slap, N, &ic, &f, &sizes);
+ components_rev(J_slap_T, r_slap_T, N, &ic_T, f, &f_T, &sizes_T);
+
+ node_comp = ic_T[node];
+
+
+ printf("SCC: %d", sizes_T[node_comp]);
+ if (show){
+ for(j=0; j<N; j++){
+ if (ic_T[j] == node_comp){
+ printf(" %d", j);
+ }
+ }
+ printf("\n");
+ }
+ else{
+ printf("\n");
+ }
+ free(sizes);
+ free(sizes_T);
+ free(I);
+ free(J);
+ free(J_slap);
+ free(r_slap);
+ free(J_slap_T);
+ free(r_slap_T);
+ free(ic);
+ free(ic_T);
+ free(f);
+ free(f_T);
+}
+
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int mode=0, node;
+ FILE *filein;
+ char show = 0;
+
+
+ if (argc < 3){
+ usage(argv);
+ exit(1);
+ }
+
+ filein = openfile_or_exit(argv[1], "r", 2);
+
+ node = atoi(argv[2]);
+
+
+ if (argc < 4){
+ mode = COMP_ALL;
+ }
+ else{
+ if (!my_strcasecmp("IN", argv[3])){
+ mode |= COMP_IN;
+ }
+ else if (!my_strcasecmp("OUT", argv[3])){
+ mode |= COMP_OUT;
+ }
+ else if (!my_strcasecmp("INOUT", argv[3])){
+ mode |= COMP_OUT | COMP_IN;
+ }
+ else if (!my_strcasecmp("WCC", argv[3])){
+ mode |= COMP_WCC;
+ }
+ else if (!my_strcasecmp("SCC", argv[3])){
+ mode |= COMP_SCC;
+ }
+ else if (!my_strcasecmp("ALL", argv[3])){
+ mode |= COMP_ALL;
+ }
+ }
+
+ if (argc > 4 && !my_strcasecmp("SHOW", argv[4])){
+ show = 1;
+ }
+
+
+ switch(mode){
+ case COMP_IN:
+ compute_comp_in(filein, node, show);
+ break;
+ case COMP_OUT:
+ compute_comp_out(filein, node, show);
+ break;
+ case COMP_IN | COMP_OUT:
+ compute_comp_in(filein, node, show);
+ compute_comp_out(filein, node, show);
+ break;
+ case COMP_WCC:
+ compute_wcc(filein, node, show);
+ break;
+ case COMP_SCC:
+ compute_scc(filein, node, show);
+ break;
+ default:
+ compute_comp_in(filein, node, show);
+ compute_comp_out(filein, node, show);
+ compute_wcc(filein, node, show);
+ compute_scc(filein, node, show);
+ };
+ fclose(filein);
+
+}
diff --git a/src/components/strong_conn.c b/src/components/strong_conn.c
new file mode 100644
index 0000000..4c0f80d
--- /dev/null
+++ b/src/components/strong_conn.c
@@ -0,0 +1,277 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program finds the (size of the) strongly connected components
+ * of a directed graph given as input. We use the Kosaraju-Sharir
+ * algorithm, which performs two DFS scans of the graph, the first
+ * time using the original DFS algorithm on the graph, and the second
+ * time using the transposed graph and a slightly modified version of
+ * "components", which traverses the nodes of the graph in descending
+ * order of finishing time.
+ *
+ *
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "utils.h"
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- strong_conn -*- **\n"
+ "** **\n"
+ "** Find the strongly connected components of a directed graph **\n"
+ "** and print on output their size and/or the list of nodes **\n"
+ "** belonging to each component. The first parameter 'graph_in' **\n"
+ "** is the name of the file containing the edge list of the **\n"
+ "** graph. **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the edge list **\n"
+ "** from standard input (STDIN). **\n"
+ "** **\n"
+ "** The program prints on output the SIZE of each strongly **\n"
+ "** connected component of the graph, one per line: **\n"
+ "** **\n"
+ "** size_1 **\n"
+ "** size_2 **\n"
+ "** size_3 **\n"
+ "** **\n"
+ "** The sizes are in no particular order. **\n"
+ "** **\n"
+ "** If 'SHOW' is given as second argument, the list of nodes **\n"
+ "** belonging to each component is printed as well, in the **\n"
+ "** format: **\n"
+ "** **\n"
+ "** size_1: node_1 node_2 node_3 .... **\n"
+ "** size_2: node_1 node_2 node_3 .... **\n"
+ "** size_3: node_1 node_2 node_3 .... **\n"
+ "** **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in> [SHOW]\n\n" , argv[0]);
+}
+
+int dfs(unsigned int i, unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int N, unsigned int nc,
+ unsigned int *ic, unsigned int *f,
+ char reset){
+
+ static unsigned int time = 0;
+ unsigned int j, s;
+
+ if(reset){
+ time = 0;
+ }
+
+ ic[i] = nc;
+ s = 1;
+
+ for(j=r_slap[i]; j<r_slap[i+1]; j++){
+ if (ic[J_slap[j]] == 0){
+ s += dfs(J_slap[j], J_slap, r_slap, N, nc, ic, f, 0);
+ }
+ }
+ f[time] = i;
+ time += 1;
+ return s;
+}
+
+
+
+/**
+ *
+ * Find all the components of the given graph
+ *
+ */
+
+int components(unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int N, unsigned int **ic,
+ unsigned int **f, unsigned int **sizes){
+
+ unsigned int nc, s;
+ unsigned int i;
+
+ *ic = malloc(N * sizeof(unsigned int));
+ *f = malloc(N * sizeof(unsigned int));
+ *sizes = malloc(N * sizeof(unsigned int));
+
+ for(i=0; i<N; i++){
+ (*ic)[i] = 0;
+ (*f)[i] = 0;
+ }
+ nc = 0;
+ for(i=0; i<N; i++){
+ while( (*ic) [i] != 0 && i < N)
+ i += 1;
+ if (i == N)
+ break;
+ nc += 1;
+ if (nc ==1){
+ s = dfs(i, J_slap, r_slap, N, nc, *ic, *f, 1);
+ }
+ else{
+ s = dfs(i, J_slap, r_slap, N, nc, *ic, *f, 0);
+ }
+ //printf("s: %d\n", s);
+ (*sizes)[nc] = s;
+ }
+ return nc;
+}
+
+
+/**
+ *
+ * Find the components of the transposed graph, where the nodes are
+ * visited in descending order of their finishing time
+ *
+ */
+
+int components_rev(unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int N, unsigned int **ic,
+ unsigned int *f, unsigned int **f_T, unsigned int **sizes){
+
+ unsigned int nc, s;
+ unsigned int idx;
+ int i;
+
+ *ic = malloc(N * sizeof(unsigned int));
+ *f_T = malloc(N * sizeof(unsigned int));
+ *sizes = malloc((N+1) * sizeof(unsigned int));
+
+ for(i=0; i<N; i++){
+ (*ic)[i] = 0;
+ }
+ nc = 0;
+ for(i=N-1; i>=0; i--){
+ idx = f[i];
+ while( i >0 && (*ic) [idx] != 0 ){
+ i -= 1;
+ idx = f[i];
+ }
+ if (i < 0)
+ break;
+ nc += 1;
+ if (nc == 1){
+ s = dfs(idx, J_slap, r_slap, N, nc, *ic, *f_T, 1);
+ }
+ else{
+ s = dfs(idx, J_slap, r_slap, N, nc, *ic, *f_T, 1);
+ }
+ (*sizes)[nc] = s;
+ }
+ return nc;
+}
+
+
+
+int main(int argc, char *argv[]){
+
+
+ FILE *filein;
+ unsigned int N, K, N1, N2;
+ unsigned int *I, *J, *J_slap, *r_slap, *J_slap_T, *r_slap_T;
+ unsigned int *ic, *f, *sizes, *ic_T, *f_T, *sizes_T;
+ unsigned int i, j, nc_T;
+ char show = 0;
+
+ if (argc < 2){
+ usage(argv);
+ exit(1);
+ }
+ if (argc == 3 && !my_strcasecmp("SHOW", argv[2])){
+ show = 1;
+ }
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+
+ I = J = NULL;
+ K = read_ij(filein, &I, &J);
+ J_slap = J_slap_T = NULL;
+ r_slap = r_slap_T = NULL;
+ /* obtain the SLAP representation of the graph */
+ N1 = convert_ij2slap(I, J, K, &r_slap, &J_slap);
+ /* obtain the SLAP representation of the transposed graph */
+ N2 = convert_ij2slap(J, I, K, &r_slap_T, &J_slap_T);
+ N = N1 >= N2 ? N1 : N2;
+ components(J_slap, r_slap, N, &ic, &f, &sizes);
+
+ fclose(filein);
+
+
+ nc_T = components_rev(J_slap_T, r_slap_T, N, &ic_T, f, &f_T, &sizes_T);
+
+ for(i=1; i<=nc_T; i++){
+ printf("%d", sizes_T[i]);
+ if (show){
+ printf(":");
+ for(j=0; j<N; j++){
+ if (ic_T[j] == i){
+ printf(" %d", j);
+ }
+ }
+ printf("\n");
+ }
+ else{
+ printf("\n");
+ }
+ }
+ free(J_slap);
+ free(r_slap);
+ free(J_slap_T);
+ free(r_slap_T);
+ free(ic);
+ free(f);
+ free(sizes);
+ free(ic_T);
+ free(f_T);
+ free(sizes_T);
+ free(I);
+ free(J);
+}
diff --git a/src/conf/Makefile.am b/src/conf/Makefile.am
new file mode 100644
index 0000000..b70fa7c
--- /dev/null
+++ b/src/conf/Makefile.am
@@ -0,0 +1,10 @@
+include ../common.mk
+bin_PROGRAMS = conf_model_deg conf_model_deg_nocheck
+conf_model_deg_SOURCES = conf_model_deg.c ../utils/utils.c ../utils/iltree.c \
+ ../utils/iltree_double.c ../include/utils.h ../include/iltree.h \
+../include/iltree_double.h ../include/utils.h
+conf_model_deg_LDADD = -lm
+conf_model_deg_nocheck_SOURCES = conf_model_deg_nocheck.c ../utils/utils.c \
+ ../utils/iltree.c ../utils/iltree_double.c ../include/iltree.h \
+../include/iltree_double.h
+conf_model_deg_nocheck_LDADD = -lm
diff --git a/src/conf/Makefile.in b/src/conf/Makefile.in
new file mode 100644
index 0000000..eaec7dc
--- /dev/null
+++ b/src/conf/Makefile.in
@@ -0,0 +1,605 @@
+# 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 = :
+bin_PROGRAMS = conf_model_deg$(EXEEXT) conf_model_deg_nocheck$(EXEEXT)
+subdir = src/conf
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_conf_model_deg_OBJECTS = conf_model_deg.$(OBJEXT) \
+ ../utils/utils.$(OBJEXT) ../utils/iltree.$(OBJEXT) \
+ ../utils/iltree_double.$(OBJEXT)
+conf_model_deg_OBJECTS = $(am_conf_model_deg_OBJECTS)
+conf_model_deg_DEPENDENCIES =
+am_conf_model_deg_nocheck_OBJECTS = conf_model_deg_nocheck.$(OBJEXT) \
+ ../utils/utils.$(OBJEXT) ../utils/iltree.$(OBJEXT) \
+ ../utils/iltree_double.$(OBJEXT)
+conf_model_deg_nocheck_OBJECTS = $(am_conf_model_deg_nocheck_OBJECTS)
+conf_model_deg_nocheck_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(conf_model_deg_SOURCES) $(conf_model_deg_nocheck_SOURCES)
+DIST_SOURCES = $(conf_model_deg_SOURCES) \
+ $(conf_model_deg_nocheck_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+conf_model_deg_SOURCES = conf_model_deg.c ../utils/utils.c ../utils/iltree.c \
+ ../utils/iltree_double.c ../include/utils.h ../include/iltree.h \
+../include/iltree_double.h ../include/utils.h
+
+conf_model_deg_LDADD = -lm
+conf_model_deg_nocheck_SOURCES = conf_model_deg_nocheck.c ../utils/utils.c \
+ ../utils/iltree.c ../utils/iltree_double.c ../include/iltree.h \
+../include/iltree_double.h
+
+conf_model_deg_nocheck_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/conf/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/conf/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/iltree.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/iltree_double.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+conf_model_deg$(EXEEXT): $(conf_model_deg_OBJECTS) $(conf_model_deg_DEPENDENCIES) $(EXTRA_conf_model_deg_DEPENDENCIES)
+ @rm -f conf_model_deg$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(conf_model_deg_OBJECTS) $(conf_model_deg_LDADD) $(LIBS)
+
+conf_model_deg_nocheck$(EXEEXT): $(conf_model_deg_nocheck_OBJECTS) $(conf_model_deg_nocheck_DEPENDENCIES) $(EXTRA_conf_model_deg_nocheck_DEPENDENCIES)
+ @rm -f conf_model_deg_nocheck$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(conf_model_deg_nocheck_OBJECTS) $(conf_model_deg_nocheck_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/iltree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/iltree_double.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf_model_deg.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf_model_deg_nocheck.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/conf/conf_model_deg.c b/src/conf/conf_model_deg.c
new file mode 100644
index 0000000..70df8a9
--- /dev/null
+++ b/src/conf/conf_model_deg.c
@@ -0,0 +1,259 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program samples a simple graph (i.e., without self-loops
+ * and/or multiple edges) from the configuration model, using the
+ * degree sequence provided as input.
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include "utils.h"
+#include "iltree_double.h"
+
+
+#define MAXREJECTS 1000000
+
+
+/* Usage */
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- conf_model_deg -*- **\n"
+ "** **\n"
+ "** Sample a simple graph from the configuration model associated **\n"
+ "** to the degree sequence provided as input. **\n"
+ "** **\n"
+ "** The degree sequence is a file with format: **\n"
+ "** **\n"
+ "** k_1 **\n"
+ "** k_2 **\n"
+ "** k_3 **\n"
+ "** .... **\n"
+ "** k_N **\n"
+ "** **\n"
+ "** where 'k_i' is the degree of the i-th node. The program **\n"
+ "** prints on output the edge-list of the resulting graph. **\n"
+ "** **\n"
+ "** The second (optional) parameter 'threshold' indicates the **\n"
+ "** number of edge stubs that are allowed to remain unmatched **\n"
+ "** in the final graph. This parameter might be used to **\n"
+ "** obtain a graph from a too-constrained degree sequence, e.g., **\n"
+ "** a power-law sequence whose maximum degree is larger than **\n"
+ "** the structural cut-off. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <degs> [<threshold>]\n\n" , argv[0]);
+}
+
+
+unsigned int count_stubs(unsigned int *nodes, int N){
+
+ int i;
+ unsigned int cnt;
+
+ cnt = 0;
+ for (i=0; i<N; i ++){
+ cnt += nodes[i];
+ }
+ return cnt;
+}
+
+
+void sample_graph_conf(unsigned int *nodes, int N, iltree_t *t,
+ unsigned int thresh){
+
+ unsigned int S;
+ unsigned int i, j;
+ unsigned int n_stubs;
+ unsigned int *stubs;
+ unsigned int countreject;
+ unsigned int L1, L2, I1, I2, tmp;
+ long double k;
+ FILE *tmp_file;
+
+ n_stubs = count_stubs(nodes, N);
+
+ if (n_stubs %2){
+ fprintf(stderr, "The sequence is not even!\n");
+ exit(3);
+ }
+ /* ind = malloc(n_stubs * sizeof(unsigned int)); */
+ /* stub2node = malloc(n_stubs * sizeof(unsigned int)); */
+
+ stubs = malloc(n_stubs * sizeof(unsigned int));
+
+
+ do{
+ countreject = 0;
+ S = 0;
+ /*
+ * We first initialize the stubs
+ *
+ * This is needed only before the first iteration, indeed....
+ *
+ */
+ for(i=0; i<N; i ++){
+ for(j=0; j<nodes[i]; j ++){
+ stubs[S] = i;
+ S += 1;
+ }
+ }
+ while (S > 0 && countreject < MAXREJECTS){
+ /* sample the first stub */
+ L1 = rand() % S;
+ I1 = stubs[L1];
+ S -= 1;
+
+ /* sample the second stub */
+ L2 = rand() % S;
+ I2 = stubs[L2];
+ S -= 1;
+
+ if (L1 == L2){/* If L1 and L2 are the same element, discard the
+ sample */
+ /* reset S to the value it had before */
+ S += 2;
+ continue;
+ }
+
+ if (I1 == I2){
+ /* reject the pair: it's the same node! */
+ countreject += 1;
+ /* reset S to the value it had before */
+ S += 2;
+ continue;
+ }
+
+
+ if (I1 > I2){ /* we require that I1 < I2 */
+ tmp = I2;
+ I2 = I1;
+ I1 = tmp;
+ }
+ k = 1.0 * (I2)* (I2-1) / 2 + I1 + 1; /* This number represents the
+ couple I1, I2 (I1 < I2)*/
+ if (!iltree_lookup(*t, &k)){ /* The element "k" is not yet present in the BST*/
+ /* We can accept the new pair... */
+ /* ...so we insert it into the tree */
+ iltree_insert(*t, &k);
+ /* remove the two stubs */
+ tmp = stubs[L1];
+ stubs[L1] = stubs[S+1];
+ stubs[S+1] = tmp;
+
+ tmp = stubs[L2];
+ stubs[L2] = stubs[S];
+ stubs[S] = tmp;
+ }
+ else{/* reject the pair */
+ /* reset S to the value it had before */
+ countreject += 1;
+ S += 2;
+ }
+ }
+
+ /* Let's check if we got a graph....*/
+ if (countreject >= MAXREJECTS){
+ if (S <= thresh){
+ fprintf(stderr, "Found a graph (unmatched stubs: %d <= threshold: %d)\n",
+ S, thresh);
+ break;
+ }
+ else{
+ fprintf(stderr, "Graph not found (unmatched stubs: %d > threshold: %d)\n",
+ S, thresh);
+ S = 0;
+ countreject = 0;
+ tmp_file = iltree_get_fileout(*t);
+ iltree_destroy(*t);
+ *t = NULL;
+ *t = iltree_double_init(*t, tmp_file);
+ }
+ }
+ else{
+ fprintf(stderr, "Found a graph!\n");
+ break;
+ }
+ } while(1);
+ free(stubs);
+}
+
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int *nodes= NULL;
+ int N;
+ iltree_t t = NULL;
+ FILE *filein;
+ unsigned int thresh;
+
+ if (argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+ srand(time(NULL));
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ if (argc > 2) /* Set the threshold */
+ thresh = atoi(argv[2]);
+ else
+ thresh = 0;
+
+
+ t = iltree_double_init(t, stdout);
+
+ N = read_deg_seq(filein, &nodes);
+ sample_graph_conf(nodes, N, &t, thresh);
+ iltree_double_dump_edges(t);
+ fclose(filein);
+ free(nodes);
+ iltree_destroy(t);
+}
diff --git a/src/conf/conf_model_deg_nocheck.c b/src/conf/conf_model_deg_nocheck.c
new file mode 100644
index 0000000..26f89d1
--- /dev/null
+++ b/src/conf/conf_model_deg_nocheck.c
@@ -0,0 +1,182 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program samples a multigraph (i.e., a graph that might
+ * contain self-loops and/or multiple edges) from the configuration
+ * model, using the degree sequence provided as input.
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include "utils.h"
+#include "iltree.h"
+
+
+
+/* Usage*/
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- conf_model_deg_nocheck -*- **\n"
+ "** **\n"
+ "** Sample a multigraph from the configuration model associated **\n"
+ "** to the degree sequence provided as input. **\n"
+ "** **\n"
+ "** The degree sequence is a file with format: **\n"
+ "** **\n"
+ "** k_1 **\n"
+ "** k_2 **\n"
+ "** k_3 **\n"
+ "** .... **\n"
+ "** k_N **\n"
+ "** **\n"
+ "** where 'k_i' is the degree of the i-th node. The program **\n"
+ "** prints on output the edge-list of the resulting graph. The **\n"
+ "** final graph might contain self-loops and multiple edges. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <degs>\n\n" , argv[0]);
+}
+
+
+unsigned int count_stubs(unsigned int *nodes, int N){
+
+ int i;
+ unsigned int cnt;
+
+ cnt = 0;
+ for (i=0; i<N; i ++){
+ cnt += nodes[i];
+ }
+ return cnt;
+}
+
+
+/* sample a multigraph from the configuration model */
+
+void sample_graph_conf_nocheck(unsigned int *nodes, int N){
+
+ unsigned int S;
+ unsigned int i, j;
+ unsigned int n_stubs;
+ unsigned int *stubs;
+ unsigned int L1, L2, I1, I2, tmp;
+
+ n_stubs = count_stubs(nodes, N);
+
+ if (n_stubs %2){
+ fprintf(stderr, "The sequence is not even!\n");
+ exit(3);
+ }
+
+ stubs = malloc(n_stubs * sizeof(unsigned int));
+
+ /*
+ * We first initialize the stubs
+ */
+
+ S = 0;
+ for(i=0; i<N; i ++){
+ for(j=0; j<nodes[i]; j ++){
+ stubs[S] = i;
+ S += 1;
+ }
+ }
+ while (S > 0){
+ /* sample the first stub */
+ L1 = rand() % S;
+ I1 = stubs[L1];
+ S -= 1;
+
+ /* sample the second stub */
+ L2 = rand() % S;
+ I2 = stubs[L2];
+ S -= 1;
+
+ if (L1 == L2){/* If L1 and L2 are the same element, discard the
+ sample */
+ /* reset S to the value it had before */
+ S += 2;
+ continue;
+ }
+
+ if (I1 > I2){
+ tmp = I2;
+ I2 = I1;
+ I1 = tmp;
+ }
+
+ printf("%d %d\n", I1, I2);
+ /* And then we remove the two stubs */
+ stubs[L1] = stubs[S+1];
+ stubs[L2] = stubs[S];
+ }
+ free(stubs);
+}
+
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int *nodes= NULL;
+ int N;
+ FILE *filein;
+
+ if (argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+ srand(time(NULL));
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ N = read_deg_seq(filein, &nodes);
+ fclose(filein);
+ sample_graph_conf_nocheck(nodes, N);
+ free(nodes);
+}
diff --git a/src/deg_seq/Makefile.am b/src/deg_seq/Makefile.am
new file mode 100644
index 0000000..f8bbb07
--- /dev/null
+++ b/src/deg_seq/Makefile.am
@@ -0,0 +1,6 @@
+include ../common.mk
+bin_PROGRAMS = deg_seq deg_seq_w
+deg_seq_SOURCES = deg_seq.c ../utils/utils.c ../include/utils.h
+deg_seq_LDADD = -lm
+deg_seq_w_SOURCES = deg_seq_w.c ../utils/utils.c ../include/utils.h
+deg_seq_w_LDADD = -lm
diff --git a/src/deg_seq/Makefile.in b/src/deg_seq/Makefile.in
new file mode 100644
index 0000000..c8dfb25
--- /dev/null
+++ b/src/deg_seq/Makefile.in
@@ -0,0 +1,588 @@
+# 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 = :
+bin_PROGRAMS = deg_seq$(EXEEXT) deg_seq_w$(EXEEXT)
+subdir = src/deg_seq
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_deg_seq_OBJECTS = deg_seq.$(OBJEXT) ../utils/utils.$(OBJEXT)
+deg_seq_OBJECTS = $(am_deg_seq_OBJECTS)
+deg_seq_DEPENDENCIES =
+am_deg_seq_w_OBJECTS = deg_seq_w.$(OBJEXT) ../utils/utils.$(OBJEXT)
+deg_seq_w_OBJECTS = $(am_deg_seq_w_OBJECTS)
+deg_seq_w_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(deg_seq_SOURCES) $(deg_seq_w_SOURCES)
+DIST_SOURCES = $(deg_seq_SOURCES) $(deg_seq_w_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+deg_seq_SOURCES = deg_seq.c ../utils/utils.c ../include/utils.h
+deg_seq_LDADD = -lm
+deg_seq_w_SOURCES = deg_seq_w.c ../utils/utils.c ../include/utils.h
+deg_seq_w_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/deg_seq/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/deg_seq/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+deg_seq$(EXEEXT): $(deg_seq_OBJECTS) $(deg_seq_DEPENDENCIES) $(EXTRA_deg_seq_DEPENDENCIES)
+ @rm -f deg_seq$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(deg_seq_OBJECTS) $(deg_seq_LDADD) $(LIBS)
+
+deg_seq_w$(EXEEXT): $(deg_seq_w_OBJECTS) $(deg_seq_w_DEPENDENCIES) $(EXTRA_deg_seq_w_DEPENDENCIES)
+ @rm -f deg_seq_w$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(deg_seq_w_OBJECTS) $(deg_seq_w_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deg_seq.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deg_seq_w.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/deg_seq/deg_seq.c b/src/deg_seq/deg_seq.c
new file mode 100644
index 0000000..742f834
--- /dev/null
+++ b/src/deg_seq/deg_seq.c
@@ -0,0 +1,115 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program prints the degree sequence of a graph given as input
+ *
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "utils.h"
+
+
+#define DISTR_ONLY 0x01
+#define SEQ_ONLY 0x02
+#define BOTH 0x04
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- deg_seq -*- **\n"
+ "** **\n"
+ "** Compute the degree sequence of a graph given as input. **\n"
+ "** **\n"
+ "** The input file 'graph_in' is an edge-list: **\n"
+ "** **\n"
+ "** I_1 J_1 **\n"
+ "** I_2 J_2 **\n"
+ "** I_3 J_3 **\n"
+ "** ... ... **\n"
+ "** I_K J_K **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the file from **\n"
+ "** the standard input (STDIN). **\n"
+ "** **\n"
+ "** The program prints on output the degree of each node, one **\n"
+ "** on each line. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in>\n" , argv[0]);
+}
+
+
+void print_deg_seq(FILE *fileout, unsigned int *r, unsigned int N){
+
+ int i;
+
+ for(i=1; i<N +1; i ++)
+ fprintf(fileout, "%d\n", r[i] - r[i-1] );
+}
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int *J_slap=NULL, *r_slap=NULL;
+ unsigned int K, N;
+ FILE *filein;
+
+ if (argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+ if(!strcmp(argv[1], "-")){
+ filein = stdin;
+ }
+ else{
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ read_slap(filein, &K, &N, &J_slap, &r_slap);
+
+ fclose(filein);
+
+ print_deg_seq(stdout, r_slap, N);
+ free(J_slap);
+ free(r_slap);
+}
diff --git a/src/deg_seq/deg_seq_w.c b/src/deg_seq/deg_seq_w.c
new file mode 100644
index 0000000..d02906e
--- /dev/null
+++ b/src/deg_seq/deg_seq_w.c
@@ -0,0 +1,123 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program prints the degree and the strength sequence of a
+ * graph given as input.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "utils.h"
+
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- deg_seq_w -*- **\n"
+ "** **\n"
+ "** Compute the degree and the strength sequence of a graph. **\n"
+ "** **\n"
+ "** The input file 'graph_in' is an edge-list: **\n"
+ "** **\n"
+ "** I_1 J_1 W_1 **\n"
+ "** I_2 J_2 W_2 **\n"
+ "** I_3 J_3 W_3 **\n"
+ "** ... ... **\n"
+ "** I_K J_K W_K **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the file from **\n"
+ "** the standard input (STDIN). **\n"
+ "** **\n"
+ "** The program prints on output the degree and strength of **\n"
+ "** all the nodes, in the format: **\n"
+ "** **\n"
+ "** k_1 s_1 **\n"
+ "** k_2 s_2 **\n"
+ "** ..... **\n"
+ "** **\n"
+ "** where 'k_i' is the degree of the i-th node, and 's_i' is **\n"
+ "** its strength (sum of the weights of incident edges). **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in>\n" , argv[0]);
+}
+
+
+int main(int argc, char *argv[]){
+
+ FILE *filein;
+ unsigned int K, N, i, j, k;
+ double str;
+
+ unsigned int *J_slap = NULL, *r_slap=NULL;
+ double *W_slap = NULL;
+
+ if (argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+
+ if(!strcmp(argv[1], "-")){
+ filein = stdin;
+ }
+ else{
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ read_slap_w(filein, &K, &N, &J_slap, &r_slap, &W_slap);
+
+ fclose(filein);
+
+ for(i=0; i<N; i++){
+ k = r_slap[i+1] - r_slap[i];
+ str = 0;
+ for(j=r_slap[i]; j< r_slap[i+1]; j++){
+ str += W_slap[j];
+ }
+ fprintf(stdout, "%d %0.18g\n", k, str);
+ }
+
+ free(J_slap);
+ free(r_slap);
+ free(W_slap);
+
+}
diff --git a/src/dijkstra/Makefile.am b/src/dijkstra/Makefile.am
new file mode 100644
index 0000000..c43cf4f
--- /dev/null
+++ b/src/dijkstra/Makefile.am
@@ -0,0 +1,7 @@
+include ../common.mk
+bin_PROGRAMS = dijkstra
+dijkstra_SOURCES = dijkstra.c node_w_funs.c node_w_funs.h \
+../utils/utils.c ../utils/gen_pqueue.c \
+../include/utils.h ../include/gen_pqueue.h
+dijkstra_LDADD = -lm
+
diff --git a/src/dijkstra/Makefile.in b/src/dijkstra/Makefile.in
new file mode 100644
index 0000000..96a1988
--- /dev/null
+++ b/src/dijkstra/Makefile.in
@@ -0,0 +1,586 @@
+# 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 = :
+bin_PROGRAMS = dijkstra$(EXEEXT)
+subdir = src/dijkstra
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_dijkstra_OBJECTS = dijkstra.$(OBJEXT) node_w_funs.$(OBJEXT) \
+ ../utils/utils.$(OBJEXT) ../utils/gen_pqueue.$(OBJEXT)
+dijkstra_OBJECTS = $(am_dijkstra_OBJECTS)
+dijkstra_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(dijkstra_SOURCES)
+DIST_SOURCES = $(dijkstra_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+dijkstra_SOURCES = dijkstra.c node_w_funs.c node_w_funs.h \
+../utils/utils.c ../utils/gen_pqueue.c \
+../include/utils.h ../include/gen_pqueue.h
+
+dijkstra_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/dijkstra/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/dijkstra/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/gen_pqueue.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+dijkstra$(EXEEXT): $(dijkstra_OBJECTS) $(dijkstra_DEPENDENCIES) $(EXTRA_dijkstra_DEPENDENCIES)
+ @rm -f dijkstra$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(dijkstra_OBJECTS) $(dijkstra_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/gen_pqueue.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dijkstra.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node_w_funs.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/dijkstra/dijkstra.c b/src/dijkstra/dijkstra.c
new file mode 100644
index 0000000..4e8a63f
--- /dev/null
+++ b/src/dijkstra/dijkstra.c
@@ -0,0 +1,242 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ *
+ * This program implements the Dijkstra's algorithm to find the
+ * shortest paths from a given node (source) to all the other nodes
+ * of a weighted graph given as input.
+ *
+ * References:
+ *
+ * [1] E. W. Dijkstra. "A Note on Two Problems in Connexion with
+ * Graphs". Num. Math. 1 (1959), 269-271.
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <float.h>
+
+#include "utils.h"
+#include "gen_pqueue.h"
+
+#include "node_w_funs.h"
+
+#define INFINITY DBL_MAX
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- dijkstra -*- **\n"
+ "** **\n"
+ "** Compute the distance from the given 'node' to all the other **\n"
+ "** nodes of a weighted graph. The first parameter 'graph_in' **\n"
+ "** is the name of the file containing the edge list of the **\n"
+ "** graph. The second parameter 'node' is the label of the node **\n"
+ "** for which we want to compute the distances to all the other **\n"
+ "** nodes. **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the edge list **\n"
+ "** from standard input (STDIN) **\n"
+ "** **\n"
+ "** The program prints on output a row of values: **\n"
+ "** **\n"
+ "** d0 d1 d2 d3 d4...... **\n"
+ "** **\n"
+ "** where d0 is the distance between 'node' and '0', 'd1' is the **\n"
+ "** distance between 'node' and '1', and so on. If a node is **\n"
+ "** not reachable from <node>, the corresponding distance is set **\n"
+ "** to 'inf'. **\n"
+ "** **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in> <node>\n\n" , argv[0]);
+}
+
+
+
+void init_prio_queue(gen_pqueue_t **q, unsigned int N){
+
+ gen_pqueue_func_t *funs;
+
+ funs = malloc(sizeof(gen_pqueue_func_t));
+ (*funs).compare = compare_node_w;
+ (*funs).alloc_vector = alloc_vector_node_w;
+ (*funs).dealloc_vector = dealloc_vector_node_w;
+ (*funs).dealloc_elem = dealloc_elem_node_w;
+ (*funs).print_elem = print_elem_node_w;
+ (*funs).get_id = get_id_node_w;
+ (*funs).set_key = set_key_node_w;
+ (*funs).get_key = get_key_node_w;
+ (*funs).compare_to_key = compare_to_key_node_w;
+
+ *q = gen_pqueue_init(N, MIN_QUEUE, funs);
+ free(funs);
+}
+
+void flatten_pqueue_to_array(gen_pqueue_t *q, double *v, unsigned int N){
+
+ int i;
+ double *val;
+
+ for(i=0; i<N; i++){
+ val = gen_pqueue_get_key(q, gen_pqueue_get_handle(q, i));
+ v[i] = *val;
+ }
+}
+
+
+void dijkstra(unsigned int N, unsigned int K, unsigned int *r_slap, unsigned int *J_slap,
+ double *W_slap, int s, double *dist, int *prev){
+
+ int i, cur_node, n;
+ double dist_cur_node, dist_neigh_node, w;
+
+ gen_pqueue_t *qdist;
+ node_w_t *elem;
+
+
+ init_prio_queue(&qdist, N);
+
+ for (i=0; i<N; i++){
+ elem = malloc(sizeof(node_w_t));
+ elem->i = i;
+ if (i != s)
+ elem->w = INFINITY;
+ else
+ elem->w = 0.0;
+ gen_pqueue_insert(qdist, elem);
+ prev[i] = -1;
+ dist[i] = INFINITY;
+ }
+
+
+ while (!gen_pqueue_delete(qdist, (void**)&elem)){ /* get the node with minimum distance */
+ cur_node = qdist->funs.get_id(elem);
+ dist_cur_node = *((double*) qdist->funs.get_key(elem));
+ if (dist_cur_node == INFINITY){ /* No more nodes are reachable from the origin */
+ free(elem);
+ gen_pqueue_destroy(qdist);
+ return;
+ }
+ dist[cur_node] = dist_cur_node;
+ for(i=r_slap[cur_node]; i<r_slap[cur_node + 1]; i++){
+ n = J_slap[i];
+ w = W_slap[i];
+
+ dist_neigh_node = dist_cur_node + w;
+ if (dist[n] >= dist_neigh_node){
+ /* now we call gen_pqueue_change_key, which updates the key of node n */
+ gen_pqueue_change_key(qdist, gen_pqueue_get_handle(qdist, n), &dist_neigh_node);
+ prev[n] = cur_node;
+ }
+ }
+ free(elem);
+ }
+ gen_pqueue_destroy(qdist);
+}
+
+
+void dump_dists(double *v, unsigned int N){
+
+ int i;
+
+ for(i=0; i<N-1; i++){
+ if (v[i] == INFINITY){
+ printf("inf ");
+ }
+ else{
+ printf("%g ", v[i]);
+ }
+ }
+ if (v[N-1] == INFINITY){
+ printf("inf\n");
+ }
+ else{
+ printf("%g\n", v[N-1]);
+ }
+}
+
+int main(int argc, char *argv[]){
+
+
+ double *dists;
+ int *prev;
+ unsigned int N, K, s;
+ unsigned int *r_slap = NULL, *J_slap=NULL;
+ double *W_slap = NULL;
+ FILE *filein;
+
+
+ if (argc < 3){
+ usage(argv);
+ exit(1);
+ }
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ read_slap_w(filein, &K, &N, &J_slap, &r_slap, &W_slap);
+
+ fclose(filein);
+
+ s = atoi(argv[2]);
+ if (s >= N){
+ fprintf(stderr, "Error!!! Source node index should be in the range [0:%d]\n",
+ N-1);
+ exit(3);
+ }
+
+ dists = malloc(N * sizeof(double));
+ prev = malloc(N * sizeof(int));
+
+ dijkstra(N, K, r_slap, J_slap, W_slap, s, dists, prev);
+ dump_dists(dists, N);
+ free(J_slap);
+ free(r_slap);
+ free(W_slap);
+ free(dists);
+ free(prev);
+}
diff --git a/src/dijkstra/node_w_funs.c b/src/dijkstra/node_w_funs.c
new file mode 100644
index 0000000..112140f
--- /dev/null
+++ b/src/dijkstra/node_w_funs.c
@@ -0,0 +1,111 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Definition of the functions to be used with the Priority Queue
+ *
+ */
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "gen_pqueue.h"
+#include "node_w_funs.h"
+
+
+int compare_node_w(const void *e1, const void *e2){
+
+ node_w_t *n1, *n2;
+
+ n1 = (node_w_t*) e1;
+ n2 = (node_w_t*) e2;
+
+ return (n1->w == n2->w ? 0 : (n1->w < n2->w ? -1 : 1));
+}
+
+
+void* alloc_vector_node_w(unsigned int N){
+
+ return malloc(N * sizeof(node_w_t));
+}
+
+void dealloc_vector_node_w(void *v){
+ free(v);
+}
+
+
+void dealloc_elem_node_w(void *e){
+
+ free(e);
+}
+
+void print_elem_node_w(void *e){
+
+ node_w_t *elem;
+
+ elem = (node_w_t*)e;
+
+ printf("[%d, %2.8g]", elem->i, elem->w);
+}
+
+int get_id_node_w(void *e){
+
+ node_w_t *elem;
+
+ elem = (node_w_t*)e;
+ return elem->i;
+}
+
+void set_key_node_w(void *e, void *k){
+
+ node_w_t *elem;
+
+
+ elem = (node_w_t*)e;
+ elem-> w = *((double*)(k));
+}
+
+int compare_to_key_node_w(void *e, void *k){
+
+ node_w_t *elem;
+ double d;
+
+ elem = (node_w_t*)e;
+ d = *((double*)k);
+
+ return (elem->w == d ? 0 : (elem->w < d ? -1 : 1));
+}
+
+void* get_key_node_w(void *e){
+
+ node_w_t *n;
+
+ n = (node_w_t*)e;
+ return &(n->w);
+}
diff --git a/src/dijkstra/node_w_funs.h b/src/dijkstra/node_w_funs.h
new file mode 100644
index 0000000..3b670a1
--- /dev/null
+++ b/src/dijkstra/node_w_funs.h
@@ -0,0 +1,66 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Declaration of the functions to be used with the Priority Queue
+ *
+ */
+#ifndef __NODE_W_FUNS_H__
+#define __NODE_W_FUNS_H__
+
+
+
+typedef struct{
+ int i;
+ double w;
+} node_w_t;
+
+
+int compare_node_w(const void *e1, const void *e2);
+
+void* alloc_vector_node_w(unsigned int N);
+
+void dealloc_vector_node_w(void *v);
+
+void dealloc_elem_node_w(void *e);
+
+void print_elem_node_w(void *e);
+
+int get_id_node_w(void *e);
+
+void set_key_node_w(void *e, void *k);
+
+void* get_key_node_w(void *e);
+
+int compare_to_key_node_w(void *e, void *k);
+
+
+
+#endif //__NODE_W_FUNS_H__
diff --git a/src/dms/Makefile.am b/src/dms/Makefile.am
new file mode 100644
index 0000000..935680c
--- /dev/null
+++ b/src/dms/Makefile.am
@@ -0,0 +1,4 @@
+include ../common.mk
+bin_PROGRAMS = dms
+dms_SOURCES = dms.c ../utils/utils.c ../utils/cum_distr.c ../include/utils.h ../include/cum_distr.h
+dms_LDADD = -lm
diff --git a/src/dms/Makefile.in b/src/dms/Makefile.in
new file mode 100644
index 0000000..046e4c8
--- /dev/null
+++ b/src/dms/Makefile.in
@@ -0,0 +1,582 @@
+# 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 = :
+bin_PROGRAMS = dms$(EXEEXT)
+subdir = src/dms
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_dms_OBJECTS = dms.$(OBJEXT) ../utils/utils.$(OBJEXT) \
+ ../utils/cum_distr.$(OBJEXT)
+dms_OBJECTS = $(am_dms_OBJECTS)
+dms_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(dms_SOURCES)
+DIST_SOURCES = $(dms_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+dms_SOURCES = dms.c ../utils/utils.c ../utils/cum_distr.c ../include/utils.h ../include/cum_distr.h
+dms_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/dms/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/dms/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/cum_distr.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+dms$(EXEEXT): $(dms_OBJECTS) $(dms_DEPENDENCIES) $(EXTRA_dms_DEPENDENCIES)
+ @rm -f dms$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(dms_OBJECTS) $(dms_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/cum_distr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dms.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/dms/dms.c b/src/dms/dms.c
new file mode 100644
index 0000000..da3ab63
--- /dev/null
+++ b/src/dms/dms.c
@@ -0,0 +1,211 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program implements the Dorogovtsev-Samukhin-Mendes preferential
+ * attachment, where the attachment probability is:
+ *
+ * \Pi_{i->j} \propto k_j + a
+ *
+ * Here a > -m is a tunable parameter. The resulting network has a
+ * powerlaw degree distribution with exponent:
+ *
+ * \gamma = 3 + a/m
+ *
+ * References:
+ *
+ * [1] S. N. Dorogovtsev, J. F. F. Mendes, A. N. Samukhin. "Structure
+ * of Growing Networks with Preferential Linking".
+ * Phys. Rev. Lett. 85 (2000), 4633-4636.
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+#include "cum_distr.h"
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- dms -*- **\n"
+ "** **\n"
+ "** Grow a scale-free network of 'N' nodes using the modified **\n"
+ "** linear preferential attachment model proposed by **\n"
+ "** Dorogovtsev-Mendes-Samukhin. **\n"
+ "** **\n"
+ "** The initial network is a clique of 'n0' nodes, and each new **\n"
+ "** node creates 'm' edges. The attachment probability is of **\n"
+ "** the form: **\n"
+ "** **\n"
+ "** P(i->j) ~ k_j + a **\n"
+ "** **\n"
+ "** where a > -m is the fourth parameter. The resulting **\n"
+ "** network will have a power-law degree distribution with **\n"
+ "** exponent **\n"
+ "** **\n"
+ "** gamma = 3 + a/m **\n"
+ "** **\n"
+ "** The program prints on STDOUT the edge-list of the final **\n"
+ "** graph. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <N> <m> <n0> <a>\n", argv[0]);
+
+}
+
+
+
+int init_network(unsigned int *I, unsigned int *J, int n0,
+ double a, cum_distr_t *d){
+
+ unsigned int n, i, S_num;
+
+ S_num = 0;
+ for(n=0; n<n0; n++){
+ for(i=n+1; i<n0; i++){
+ I[S_num] = n;
+ J[S_num] = i % n0;
+ S_num += 1;
+ }
+ cum_distr_add(d, n, n0+a);
+ }
+ return S_num;
+}
+
+int already_neighbour(unsigned int *J, int S_num, int j, int dest){
+
+ int i;
+
+ for(i=S_num; i< S_num + j; i ++){
+ if (J[i] == dest)
+ return 1;
+ }
+ return 0;
+}
+
+
+
+int dms(unsigned int *I, unsigned int *J, unsigned int N,
+ unsigned int m, unsigned int n0, double a){
+
+ cum_distr_t *d = NULL;
+ unsigned int n, j, dest, S_num;
+
+ d = cum_distr_init(N * m);
+
+ S_num = init_network(I, J, n0, a, d);
+
+
+ n = n0;
+ while (n<N){
+ for(j=0; j<m; j++){
+ I[S_num+j] = n;
+ dest = cum_distr_sample(d);
+ while(already_neighbour(J, S_num, j, dest)){
+ dest = cum_distr_sample(d);
+ }
+ J[S_num + j] = dest;
+ }
+ cum_distr_add(d, n, m + a);
+ for (j=0; j<m; j++){
+ cum_distr_add(d, J[S_num + j], 1);
+ }
+ S_num += m;
+ n += 1;
+ }
+ cum_distr_destroy(d);
+ return S_num;
+}
+
+
+
+int main(int argc, char *argv[]){
+
+ int N, m, n0, K, i;
+ unsigned int *I, *J;
+ double a;
+
+ if (argc < 5){
+ usage(argv);
+ exit(1);
+ }
+
+ N = atoi(argv[1]);
+ m = atoi(argv[2]);
+ n0 = atoi(argv[3]);
+ a = atof(argv[4]);
+
+ srand(time(NULL));
+
+ if (N < 1){
+ fprintf(stderr, "N must be positive\n");
+ exit(1);
+ }
+ if(m > n0){
+ fprintf(stderr, "n0 cannot be smaller than m\n");
+ exit(1);
+
+ }
+ if (n0<1){
+ fprintf(stderr, "n0 must be positive\n");
+ exit(1);
+ }
+
+ if (m < 1){
+ fprintf(stderr, "m must be positive\n");
+ exit(1);
+ }
+
+ if (a < -m){
+ fprintf(stderr, "a must be larger than -m\n");
+ exit(1);
+ }
+
+
+ I = malloc(N * m * sizeof(unsigned int));
+ J = malloc(N * m * sizeof(unsigned int));
+
+ K = dms(I, J, N, m, n0, a);
+
+ for(i=0; i<K; i++){
+ printf("%d %d\n", J[i], I[i]);
+ }
+ free(I);
+ free(J);
+}
diff --git a/src/er/Makefile.am b/src/er/Makefile.am
new file mode 100644
index 0000000..c733770
--- /dev/null
+++ b/src/er/Makefile.am
@@ -0,0 +1,9 @@
+include ../common.mk
+bin_PROGRAMS = er_A er_B
+er_A_SOURCES = er_A.c ../utils/utils.c ../utils/iltree.c ../utils/iltree_double.c \
+../include/utils.h ../include/iltree.h ../include/iltree_double.h
+er_A_LDADD = -lm
+er_B_SOURCES = er_B.c ../utils/utils.c ../utils/iltree.c ../utils/iltree_double.c \
+../include/utils.h ../include/iltree.h ../include/iltree_double.h
+er_B_LDADD = -lm
+
diff --git a/src/er/Makefile.in b/src/er/Makefile.in
new file mode 100644
index 0000000..a3543ea
--- /dev/null
+++ b/src/er/Makefile.in
@@ -0,0 +1,600 @@
+# 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 = :
+bin_PROGRAMS = er_A$(EXEEXT) er_B$(EXEEXT)
+subdir = src/er
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_er_A_OBJECTS = er_A.$(OBJEXT) ../utils/utils.$(OBJEXT) \
+ ../utils/iltree.$(OBJEXT) ../utils/iltree_double.$(OBJEXT)
+er_A_OBJECTS = $(am_er_A_OBJECTS)
+er_A_DEPENDENCIES =
+am_er_B_OBJECTS = er_B.$(OBJEXT) ../utils/utils.$(OBJEXT) \
+ ../utils/iltree.$(OBJEXT) ../utils/iltree_double.$(OBJEXT)
+er_B_OBJECTS = $(am_er_B_OBJECTS)
+er_B_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(er_A_SOURCES) $(er_B_SOURCES)
+DIST_SOURCES = $(er_A_SOURCES) $(er_B_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+er_A_SOURCES = er_A.c ../utils/utils.c ../utils/iltree.c ../utils/iltree_double.c \
+../include/utils.h ../include/iltree.h ../include/iltree_double.h
+
+er_A_LDADD = -lm
+er_B_SOURCES = er_B.c ../utils/utils.c ../utils/iltree.c ../utils/iltree_double.c \
+../include/utils.h ../include/iltree.h ../include/iltree_double.h
+
+er_B_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/er/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/er/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/iltree.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/iltree_double.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+er_A$(EXEEXT): $(er_A_OBJECTS) $(er_A_DEPENDENCIES) $(EXTRA_er_A_DEPENDENCIES)
+ @rm -f er_A$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(er_A_OBJECTS) $(er_A_LDADD) $(LIBS)
+
+er_B$(EXEEXT): $(er_B_OBJECTS) $(er_B_DEPENDENCIES) $(EXTRA_er_B_DEPENDENCIES)
+ @rm -f er_B$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(er_B_OBJECTS) $(er_B_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/iltree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/iltree_double.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/er_A.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/er_B.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/er/er_A.c b/src/er/er_A.c
new file mode 100644
index 0000000..4f93af5
--- /dev/null
+++ b/src/er/er_A.c
@@ -0,0 +1,152 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program samples a graph from the Erdos-Renyi random graph
+ * model A, i.e., the ensemble of graphs with N nodes and K edges.
+ *
+ *
+ * References:
+ *
+ * [1] Erdős, P. & Rényi, A. On Random Graphs I Publ. Math. Debrecen,
+ * 6, 290 (1959)
+ *
+ * [2] Erdos, P. & Renyi, A. On the evolution of random graphs
+ * Publ. Math. Inst. Hungary. Acad. Sci., 5, 17-61 (1960)
+ *
+ */
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+#include "iltree_double.h"
+
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- er -*- **\n"
+ "** **\n"
+ "** sample an Erdos-Renyi graph of N nodes and K links **\n"
+ "** **\n"
+ "** the output is an I,J matrix: **\n"
+ "** I_1 J_1 **\n"
+ "** I_2 J_2 **\n"
+ "** I_3 J_3 **\n"
+ "** ... ... **\n"
+ "** I_K J_K **\n"
+ "** **\n"
+ "** (output is to stdout or to a file) **\n"
+ "** **\n"
+ "** If a filename is specified as fourth parameter then **\n"
+ "** the degree sequence is dumped out to that file **\n"
+ "** **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <N> <K> [<filout>]\n\n" , argv[0]);
+}
+
+
+void sample_edges(unsigned int N, double K, iltree_t t){
+
+ long double k;
+ double i, k1, k2, tmp;
+
+ for(i=0; i<K; ){
+ k1 = rand() % N +1; /* sample the first node uniformly in [0,N-1] */
+ k2 = rand() % N +1; /* sample the first node uniformly in [0,N-1] */
+ while (k1 == k2){ /* Avoid selfloops */
+ k1 = rand() % N +1; /* sample the first node uniformly in [0,N-1] */
+ k2 = rand() % N +1; /* sample the first node uniformly in [0,N-1] */
+ }
+ if (k1 > k2){
+ tmp = k2;
+ k2 = k1;
+ k1 = tmp;
+ }
+ k = 1.0 * (k2-1)* (k2-2) / 2 + k1; /* This number represents the couple k1, k2 (k1 < k2)*/
+ if (!iltree_lookup(t, &k)){ /* The element "k" is not yet present in the BST*/
+ /* So we insert into in the tree */
+ iltree_insert(t, &k);
+ /* and then we increment the counter of inserted edges */
+ i += 1;
+ }
+ }
+}
+
+
+
+int main(int argc, char *argv[]){
+
+ iltree_t t = NULL; /* This is the insert-lookup BST */
+ FILE *fileout;
+ char error_str [256];
+ unsigned int N;
+ double K;
+
+ if(argc < 3){
+ usage(argv);
+ exit(1);
+ }
+
+ N = atoi(argv[1]);
+ K = atof(argv[2]);
+
+
+ if (argc >3){
+ fileout = fopen(argv[3], "w+");
+ if (!fileout){
+ sprintf(error_str, "Error opening file %s", argv[3]);
+ perror(error_str);
+ exit(2);
+ }
+ }
+ else{
+ fileout = stdout;
+ }
+
+ t = iltree_double_init(t, fileout);
+
+ srand(time(NULL));
+ /* Now we sample K integers without repetition (using the BST)*/
+ sample_edges(N, K, t);
+ /* And then we dump out the edges in I,J format */
+ iltree_view_pre(t);
+ iltree_destroy(t);
+}
diff --git a/src/er/er_B.c b/src/er/er_B.c
new file mode 100644
index 0000000..84a0b4b
--- /dev/null
+++ b/src/er/er_B.c
@@ -0,0 +1,126 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program samples a graph from the Erdos-Renyi random graph
+ * model B, i.e., the ensemble of graphs with N nodes where each of
+ * the possible N(N-1)/2 edges is created with probability equal to
+ * p, and independently from all the other edges.
+ *
+ *
+ * References:
+ *
+ * [1] Erdős, P. & Rényi, A. On Random Graphs I Publ. Math. Debrecen,
+ * 6, 290 (1959)
+ *
+ * [2] Erdos, P. & Renyi, A. On the evolution of random graphs
+ * Publ. Math. Inst. Hungary. Acad. Sci., 5, 17-61 (1960)
+ *
+ */
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- er_B -*- **\n"
+ "** **\n"
+ "** sample an Erdos-Renyi graph of N nodes and edge probability p **\n"
+ "** **\n"
+ "** the output is an I,J matrix: **\n"
+ "** I_1 J_1 **\n"
+ "** I_2 J_2 **\n"
+ "** I_3 J_3 **\n"
+ "** ... ... **\n"
+ "** I_K J_K **\n"
+ "** **\n"
+ "** (output is to stdout or to a file) **\n"
+ "** **\n"
+ "** If a filename is specified as fourth parameter then **\n"
+ "** the degree sequence is dumped out to that file **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <N> <p> [<filout>]\n\n" , argv[0]);
+}
+
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int N, i, j;;
+ FILE *fileout;
+ double p, val;
+ char error_str [256];
+
+ if(argc < 3){
+ usage(argv);
+ exit(1);
+ }
+
+ N = atoi(argv[1]);
+ p = atof(argv[2]);
+
+
+ if (argc >3){
+ fileout = fopen(argv[3], "w+");
+ if (!fileout){
+ sprintf(error_str, "Error opening file %s", argv[3]);
+ perror(error_str);
+ exit(2);
+ }
+ }
+ else{
+ fileout = stdout;
+ }
+
+ srand(time(NULL));
+
+ /* Loop over all nodes...*/
+ for(i=0; i<N; i++){
+ /* Loop over the nodes with label larger than i...*/
+ for(j=i+1; j<N; j++){
+ val = rand() * 1.0 / RAND_MAX;
+ /* if the sample is smaller than p, create the edge */
+ if (val < p){
+ fprintf(fileout, "%d %d\n", i, j);
+ }
+ }
+ }
+ fclose(fileout);
+}
diff --git a/src/f3m/Makefile.am b/src/f3m/Makefile.am
new file mode 100644
index 0000000..8202556
--- /dev/null
+++ b/src/f3m/Makefile.am
@@ -0,0 +1,5 @@
+include ../common.mk
+bin_PROGRAMS = f3m
+f3m_SOURCES = f3m.c ../utils/utils.c ../include/utils.h
+f3m_LDADD = -lm
+
diff --git a/src/f3m/Makefile.in b/src/f3m/Makefile.in
new file mode 100644
index 0000000..8e1152b
--- /dev/null
+++ b/src/f3m/Makefile.in
@@ -0,0 +1,578 @@
+# 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 = :
+bin_PROGRAMS = f3m$(EXEEXT)
+subdir = src/f3m
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_f3m_OBJECTS = f3m.$(OBJEXT) ../utils/utils.$(OBJEXT)
+f3m_OBJECTS = $(am_f3m_OBJECTS)
+f3m_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(f3m_SOURCES)
+DIST_SOURCES = $(f3m_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+f3m_SOURCES = f3m.c ../utils/utils.c ../include/utils.h
+f3m_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/f3m/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/f3m/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+f3m$(EXEEXT): $(f3m_OBJECTS) $(f3m_DEPENDENCIES) $(EXTRA_f3m_DEPENDENCIES)
+ @rm -f f3m$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(f3m_OBJECTS) $(f3m_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/f3m.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/f3m/f3m.c b/src/f3m/f3m.c
new file mode 100644
index 0000000..cfe1146
--- /dev/null
+++ b/src/f3m/f3m.c
@@ -0,0 +1,657 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Enumerate all the three-nodes subgraphs in a directed network, and
+ * compute the significance of their number with respect to the
+ * corresponding configuration model ensemble.
+ *
+ * References:
+ *
+ * [1] R. Milo et al. "Network Motifs: Simple Building Blocks of
+ * Complex Networks". Science 298 (2002), 824-827.
+ *
+ * [2] R. Milo et al. "Superfamilies of evolved and designed
+ * networks." Science 303 (2004), 1538-1542
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <math.h>
+
+#include "utils.h"
+
+
+
+void usage(char *argv[]){
+
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- f3m -*- **\n"
+ "** **\n"
+ "** Count all the 3-node subgraphs of a directed graph given as **\n"
+ "** input, and compute the relevance (z-score) of each motif **\n"
+ "** with respect to the corresponding configuration model graph **\n"
+ "** ensemble. **\n"
+ "** **\n"
+ "** The file 'graph_in' contains the edge list of the graph. **\n"
+ "** **\n"
+ "** The program prints on STDOUT one line for each of the 13 **\n"
+ "** motifs, in the format **\n"
+ "** **\n"
+ "** motif count mean_rnd std_rnd z-score **\n"
+ "** **\n"
+ "** where 'motif' is the motif number (an integer between 1 and **\n"
+ "** 13), 'count' is the number of subgraphs of that type found **\n"
+ "** in 'graph_in', 'mean_rnd' is the average number of those **\n"
+ "** subgraphs found in the randomised realisations of the graph, **\n"
+ "** 'std_rnd' is the standard deviation associated to 'avg_rnd', **\n"
+ "** and 'z-score' is the normalised deviation of 'count' from **\n"
+ "** 'mean_rnd'. **\n"
+ "** **\n"
+ "** If the (optional) parameter 'num_random' is provided, use **\n"
+ "** that number of random realisations to compute the z-score. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in> [<num_random>]\n", argv[0]);
+}
+
+
+
+
+
+
+#define MIN(x, y) ((x) < (y) ? (x) : (y))
+
+
+typedef struct{
+ unsigned int N;
+ unsigned int K;
+ unsigned int *J_slap;
+ unsigned int *r_slap;
+} graph_t;
+
+
+typedef struct{
+ double f_count_real[13];
+ int num_rnd;
+ double **f_count_rnd;
+} mstats_t;
+
+
+char perm12[3][3] = {{0, 1, 0},
+ {1, 0, 0},
+ {0, 0, 1}};
+
+char perm13[3][3] = {{0, 0, 1},
+ {0, 1, 0},
+ {1, 0, 0}};
+
+char perm23[3][3] = {{1, 0, 0},
+ {0, 0, 1},
+ {0, 1, 0}};
+
+
+
+void shuffle_list(unsigned int *v, unsigned int K){
+
+ int i, pos;
+
+ for(i=K-1; i>=0; i--){
+ pos = rand() % K;
+ if (pos != i){
+ v[i] ^= v[pos];
+ v[pos] ^= v[i];
+ v[i] ^= v[pos];
+ }
+ }
+}
+
+int is_simple_graph(unsigned int *J_slap, unsigned int *r_slap, unsigned int K,
+ unsigned int N){
+
+ int i, j;
+ for(i=0; i<N; i++){
+ for(j=r_slap[i]; j<r_slap[i+1]; j++){
+ if (J_slap[j] == i) /* If there is a self-loop....*/
+ return 0;
+ if (j > r_slap[i] && J_slap[j] == J_slap[j-1]) /* or a double edge... */
+ return 0;
+ }
+ }
+ return 1;
+}
+
+int is_loop_free(unsigned int *J_slap, unsigned int *r_slap, unsigned int K,
+ unsigned int N){
+
+ int i, j;
+ for(i=0; i<N; i++){
+ for(j=r_slap[i]; j<r_slap[i+1]; j++){
+ if (J_slap[j] == i) /* There is a self-loop....*/
+ return 0;
+ }
+ }
+ return 1;
+}
+
+
+
+unsigned int* sample_conf_model_smart(unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int K, unsigned int N){
+
+ unsigned int *new_J;
+
+ new_J = malloc( K * sizeof(unsigned int));
+
+ memcpy(new_J, J_slap, K *sizeof(unsigned int));
+
+ while(1){
+ shuffle_list(new_J, K);
+ sort_neighbours(new_J, r_slap, N);
+ if(is_loop_free(new_J, r_slap, K, N))
+ break;
+ }
+ return new_J;
+}
+
+
+
+void apply_perm_3(char m[3][3], char p[3][3]){
+
+ char res[3][3];
+
+ int i, j, k;
+ for (i=0; i<3; i++){
+ for(j=0; j<3; j++){
+ res[i][j] = 0;
+ for(k=0; k<3; k++){
+ res[i][j] += p[i][k] * m[k][j];
+ }
+ }
+ }
+
+ for (i=0; i<3; i++){
+ for(j=0; j<3; j++){
+ m[i][j] = 0;
+ for(k=0; k<3; k++){
+ m[i][j] += res[i][k] * p[k][j];
+ }
+ }
+ }
+
+}
+
+int row_value(char r[3]){ /* The "value" of a row of bits is
+ equal to the binary representation
+ of the row, in big-endian (i.e.,
+ LSB is r[0], MSB is r[2])*/
+
+ return r[0] + (r[1]<<1) + (r[2]<<2);
+}
+
+int matrix_value(char m[3][3]){ /* The value of a matrix of
+ bits is equal to the binary
+ representation of the
+ matrix, in big endian,
+ starting from the first row
+ (LSB is m[0][0], MSB is
+ m[2][2])*/
+
+ return row_value(m[0]) + (row_value(m[1])<<3) + (row_value(m[2])<<6);
+}
+
+
+void permute_matrix_3(char m[3][3], int n1, int n2){
+
+ int perm;
+
+ if (n1 == n2){
+ return;
+ }
+ if (n1 > n2){
+ n1 ^= n2;
+ n2 ^= n1;
+ n1 ^= n2;
+ }
+
+ perm = n1 + (n2<<2);
+
+ switch(perm){
+ case (1 + (2<<2)): /* permute 1 with 2 */
+ apply_perm_3(m, perm12);
+ break;
+ case (1 + (3<<2)): /* permute 1 with 3 */
+ apply_perm_3(m, perm13);
+ break;
+ case (2 + (3<<2)): /* permute 2 with 3 */
+ apply_perm_3(m, perm23);
+ break;
+ }
+}
+
+
+
+/* Load the input graph. We construct two versions of the graph,
+ i.e. the directed versions G_out ( containing the list of
+ out-neighbours of each node) and the underlying undirected graph
+ G_u
+
+ N.B.: This is quite inefficient at the moment, since it reads the
+ file twice, and could be replaced by one call to read_ij and two
+ appropriate calls to convert_ij2slap.... */
+
+void load_graph(FILE *fin, graph_t *G_u, graph_t *G_out){
+
+ /*FIXME!!!! WE CANNOT REWIND THE STANDARD OUTPUT !!!!! */
+ read_slap(fin, &(G_u->K), &(G_u->N), &(G_u->J_slap), &(G_u->r_slap));
+ sort_neighbours(G_u->J_slap, G_u->r_slap, G_u->N);
+ rewind(fin);
+ read_slap_dir(fin, &(G_out->K), &(G_out->N), &(G_out->J_slap), &(G_out->r_slap));
+ sort_neighbours(G_out->J_slap, G_out->r_slap, G_out->N);
+ rewind(fin);
+
+}
+
+
+void dump_matrix_3(char m[3][3]){
+
+ int i, j;
+
+ for(i=0; i<3; i++){
+ for(j=0; j<3; j++){
+ printf("%d ", m[i][j]);
+ }
+ printf("\n");
+ }
+}
+
+
+int motif_number(char m[3][3]){
+
+ char m0[3][3];
+ char m1[3][3];
+ char m2[3][3];
+ char m3[3][3];
+
+ int v, v0, v1, v2, v3, v4, v5;
+ int i,j;
+
+ for(i=0; i<3; i++){
+ for(j=0; j<3; j++){
+ m0[i][j] = m[i][j];
+ }
+ }
+
+ if (row_value(m[0]) == 0){
+ permute_matrix_3(m0, 1, 2);
+ }
+ if (row_value(m0[1]) == 0){
+ permute_matrix_3(m0, 2, 3);
+ }
+
+
+ for(i=0; i<3; i++){
+ for(j=0; j<3; j++){
+ m1[i][j] = m0[i][j];
+ m2[i][j] = m0[i][j];
+ m3[i][j] = m0[i][j];
+ }
+ }
+
+ /* We consider here all the 6 possible permutations... */
+
+ /* {0, 1, 2} */
+ v0 = matrix_value(m0);
+ /* {1, 0, 2} */
+ permute_matrix_3(m1, 1, 2);
+ v1 = matrix_value(m1);
+ /* {2, 1, 0} */
+ permute_matrix_3(m2, 1, 3);
+ v2 = matrix_value(m2);
+ /* {0, 2, 1} */
+ permute_matrix_3(m3, 2, 3);
+ v3 = matrix_value(m3);
+ /* {1, 2, 0} */
+ permute_matrix_3(m2, 1, 2);
+ v4 = matrix_value(m2);
+ /* {2, 0, 1} */
+ permute_matrix_3(m3, 1, 2);
+ v5 = matrix_value(m3);
+
+ v = MIN (MIN( MIN( MIN( MIN( v0, v1), v2), v3), v4), v5);
+
+ switch(v){
+ case 6:
+ return 0;
+ case 12:
+ return 1;
+ case 14:
+ return 2;
+ case 36:
+ return 3;
+ case 38:
+ return 4;
+ case 46:
+ return 5;
+ case 74:
+ return 6;
+ case 78:
+ return 7;
+ case 98:
+ return 8;
+ case 102:
+ return 9;
+ case 108:
+ return 10;
+ case 110:
+ return 11;
+ case 238:
+ return 12;
+ default:
+ fprintf(stderr, "No motif with number %d! Exiting\n", v);
+ dump_matrix_3(m);
+ exit(5);
+ }
+}
+
+int get_motif_3(int n1, int n2, int n3, graph_t *G_out){
+
+ char m[3][3];
+ unsigned int n[3] = {n1, n2, n3};
+
+ int i, j, v;
+
+ for(i=0; i<3; i++){
+ for (j=0; j<3; j++){
+ if (is_neigh(G_out->J_slap, G_out->r_slap, G_out->N,
+ n[i], n[j])){
+ m[i][j] = 1;
+ }
+ else{
+ m[i][j] = 0;
+ }
+ }
+ }
+ v = motif_number(m);
+ return v;
+}
+
+
+
+void find_subgraphs_3(graph_t *G_u, graph_t *G_out, double *f_cnt){
+
+ int i, j, k, n1, n2;
+ int val;
+
+ for (i=0; i<G_u->N; i++){
+ for(n1 = G_u->r_slap[i]; n1<G_u->r_slap[i+1]; n1++){
+ /* j is a first-neighbour of i in G_u */
+ j = G_u->J_slap[n1];
+ /* avoid multiple entries in the J_slap vector */
+ if (n1 > G_u->r_slap[i] && j == G_u->J_slap[n1-1])
+ continue;
+ for(n2 = n1+1; n2 < G_u->r_slap[i+1]; n2++){
+ /* and k is another first neighbour of i in G_u */
+ k = G_u->J_slap[n2];
+ /* avoid multiple entries in the J_slap vector */
+ if (n2 > n1+1 && k == G_u->J_slap[n2-1])
+ continue;
+ /* now, if j and k are connected by an edge, we consider this
+ triangle only if i<j<k (in order to avoid multiple counts).
+ Otherwise, if i-j-k is an open triad, we have to consider
+ it now, because there is no other possibility to discover
+ it */
+ if((is_neigh(G_u->J_slap, G_u->r_slap, G_u->N, j, k) &&
+ (j < i || k < j || k < i)) || (j==k))
+ continue;
+ val = get_motif_3(i, j, k, G_out);
+ f_cnt[val] +=1;
+ }
+ }
+ }
+
+}
+
+void init_graph(graph_t *G1){
+ G1->J_slap = G1->r_slap = NULL;
+}
+
+void init_stats(mstats_t *st, int n_rand){
+ int i;
+
+ st->f_count_rnd = malloc(n_rand * sizeof(double*));
+
+ st->num_rnd = n_rand;
+
+ for(i=0; i<13; i++){
+ st->f_count_real[i] = 0;
+ }
+
+ for(i=0; i<n_rand; i++){
+ st->f_count_rnd[i] = malloc(13 * sizeof(double));
+ memset(st->f_count_rnd[i], 0, 13 * sizeof(double));
+ }
+}
+
+
+void compute_rnd_st_mean_std(mstats_t *st, double *mean, double *std){
+
+ double sum[13], sum2[13];
+ double val, n;
+
+ int i, j;
+
+
+ n = st->num_rnd;
+
+ for (i=0; i<13; i++){
+ sum[i] = sum2[i] = 0;
+ }
+
+ if (n == 0)
+ return;
+
+ for(i=0; i<n; i++){
+ for(j=0; j<13; j++){
+ val = st->f_count_rnd[i][j];
+ sum[j] += val;
+ sum2[j] += val*val;
+ }
+ }
+
+ for(i=0; i<13; i++){
+ mean[i] = sum[i] / n;
+ if (sum2[i] > 0)
+ std[i] = sqrt(sum2[i] * 1.0/(n-1) - 1.0/( n * (n-1)) * sum[i]*sum[i]);
+ else
+ std[i] = 0.0;
+ }
+}
+
+
+
+
+
+void dump_stats(mstats_t *st){
+
+ int i;
+ double v_mean[13], v_std[13], x;
+
+ memset(v_mean, 0, 13 * sizeof(double));
+ memset(v_std, 0, 13 * sizeof(double));
+
+ compute_rnd_st_mean_std(st, v_mean, v_std);
+ for(i=0; i<13; i++){
+ x = st->f_count_real[i];
+ if (v_std[i] > 0)
+ printf("%-2d %12.0f %15.2f %10.3f %+10.3f\n", i+1, x,
+ v_mean[i], v_std[i], 1.0 * (x - v_mean[i])/v_std[i] );
+ else
+ printf("%-2d %12.0f %15.2f %10.3f %+10.3f\n", i+1, x,
+ v_mean[i], v_std[i], 0.0);
+
+ }
+}
+
+void randomise_graph(graph_t *G_out, graph_t *RNDG_out, graph_t *RNDG_u){
+
+ static unsigned int *I, *J;
+ static unsigned int I_size, J_size;
+ unsigned int *tmp;
+
+ if (!I || I_size < 2*G_out->K){
+ tmp = realloc(I, G_out -> K * 2 * sizeof(unsigned int));
+ VALID_PTR_OR_EXIT(tmp, 3);
+ I = tmp;
+ I_size = 2*G_out->K;
+ }
+
+
+ if (!J || J_size < 2*G_out->K){
+ tmp = realloc(J, G_out -> K * 2 * sizeof(unsigned int));
+ VALID_PTR_OR_EXIT(tmp, 3);
+ J = tmp;
+ J_size = 2*G_out->K;
+ }
+
+ if (RNDG_out->J_slap){
+ free(RNDG_out->J_slap);
+ RNDG_out->J_slap = NULL;
+ }
+
+
+ RNDG_out->J_slap = sample_conf_model_smart(G_out->J_slap, G_out->r_slap, G_out->K, G_out->N);
+
+ tmp = realloc(RNDG_out->r_slap, (G_out->N + 1) * sizeof(unsigned int));
+ VALID_PTR_OR_EXIT(tmp, 19);
+ RNDG_out->r_slap = tmp;
+ memcpy(RNDG_out->r_slap, G_out->r_slap, (G_out->N + 1) * sizeof(unsigned int));
+ RNDG_out->N = G_out->N;
+ RNDG_out->K = G_out->K;
+
+
+ convert_slap2ij(RNDG_out->J_slap, RNDG_out->r_slap, RNDG_out->N, I, J);
+
+ /* copy J at the end of I */
+ memcpy(&(I[G_out->K]), J, G_out->K * sizeof(unsigned int));
+ /* copy I at the end of J */
+ memcpy(&(J[G_out->K]), I, G_out->K * sizeof(unsigned int));
+
+
+ RNDG_u->N = convert_ij2slap(I, J, 2*G_out->K, & (RNDG_u->r_slap), &(RNDG_u->J_slap));
+
+ RNDG_u->K = 2 * G_out->K;
+
+ sort_neighbours(RNDG_u->J_slap, RNDG_u->r_slap, RNDG_u->N);
+ sort_neighbours(RNDG_out->J_slap, RNDG_out->r_slap, RNDG_out->N);
+
+ if (!is_loop_free(RNDG_u->J_slap, RNDG_u->r_slap, RNDG_u->K, RNDG_u->N)){
+ fprintf(stderr, "Error!!!! The undirected version of the graph is not loop-free!!!!\n");
+ exit(23);
+ }
+
+}
+
+
+int main(int argc, char *argv[]){
+
+ graph_t G_u, G_out, RNDG_u, RNDG_out;
+ mstats_t st;
+ FILE *filein;
+ unsigned int nr;
+
+ int i;
+
+ if(argc < 2){
+ usage(argv);
+ exit(1);
+ }
+ filein = openfile_or_exit(argv[1], "r", 2);
+
+ if (argc > 2){
+ nr = atoi(argv[2]);
+ }
+ else{
+ nr = 0;
+ }
+
+ init_stats(&st, nr);
+ init_graph(&G_u);
+ init_graph(&G_out);
+
+ load_graph(filein, &G_u, &G_out);
+
+ fclose(filein);
+
+ find_subgraphs_3(&G_u, &G_out, st.f_count_real);
+
+ srand(time(NULL));
+
+ /* Now we create n_r random networks with the same degree
+ distribution, and we perform motifs analysis on each of them */
+
+ init_graph(&RNDG_out);
+ init_graph(&RNDG_u);
+
+ for(i=0; i<nr; i++){
+ /* Create the random graph */
+ randomise_graph(&G_out, &RNDG_out, &RNDG_u);
+ /* call find_subgraphs_3 in it */
+ find_subgraphs_3(&RNDG_u, &RNDG_out, st.f_count_rnd[i]);
+ //show_progress(stderr, "Randomised networks: ", i+1, nr);
+ }
+ //fprintf(stderr,"\n");
+
+ /* Now we should print the results on output */
+
+ dump_stats(&st);
+
+ free(G_u.J_slap);
+ free(G_u.r_slap);
+ free(G_out.J_slap);
+ free(G_out.r_slap);
+
+ free(RNDG_u.J_slap);
+ free(RNDG_u.r_slap);
+ free(RNDG_out.J_slap);
+ free(RNDG_out.r_slap);
+
+ return 0;
+}
diff --git a/src/fitmle/Makefile.am b/src/fitmle/Makefile.am
new file mode 100644
index 0000000..b70e6a2
--- /dev/null
+++ b/src/fitmle/Makefile.am
@@ -0,0 +1,5 @@
+include ../common.mk
+bin_PROGRAMS = fitmle
+fitmle_SOURCES = fitmle.c ../utils/utils.c ../include/utils.h
+fitmle_LDADD = -lm
+
diff --git a/src/fitmle/Makefile.in b/src/fitmle/Makefile.in
new file mode 100644
index 0000000..ecb8e90
--- /dev/null
+++ b/src/fitmle/Makefile.in
@@ -0,0 +1,578 @@
+# 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 = :
+bin_PROGRAMS = fitmle$(EXEEXT)
+subdir = src/fitmle
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_fitmle_OBJECTS = fitmle.$(OBJEXT) ../utils/utils.$(OBJEXT)
+fitmle_OBJECTS = $(am_fitmle_OBJECTS)
+fitmle_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(fitmle_SOURCES)
+DIST_SOURCES = $(fitmle_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+fitmle_SOURCES = fitmle.c ../utils/utils.c ../include/utils.h
+fitmle_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/fitmle/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/fitmle/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+fitmle$(EXEEXT): $(fitmle_OBJECTS) $(fitmle_DEPENDENCIES) $(EXTRA_fitmle_DEPENDENCIES)
+ @rm -f fitmle$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(fitmle_OBJECTS) $(fitmle_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fitmle.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/fitmle/fitmle.c b/src/fitmle/fitmle.c
new file mode 100644
index 0000000..53cf448
--- /dev/null
+++ b/src/fitmle/fitmle.c
@@ -0,0 +1,479 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program fits a set of values provided as input with a
+ * power-law function using the Maximum-Likelihood Estimator (MLE).
+ *
+ * References:
+ *
+ * [1] A. Clauset, C. R. Shalizi, and M. E. J. Newman. "Power-law
+ * distributions in empirical data". SIAM Rev. 51, (2007),
+ * 661-703.
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <time.h>
+
+#include "utils.h"
+
+void usage(char *argv[]){
+
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- fitmle -*- **\n"
+ "** **\n"
+ "** Fit a set of values with a power-law function using the **\n"
+ "** Maximum-Likelihood Estimator (MLE). The program implements **\n"
+ "** the MLE for both continuous and discrete values, and **\n"
+ "** selects the appropriate one automatically. **\n"
+ "** **\n"
+ "** The input file 'data_in' contains one value on each row. **\n"
+ "** If 'data_in' is '-' (dash), read the values from the **\n"
+ "** standard input (STDIN). **\n"
+ "** **\n"
+ "** The program prints on output a single row, in the format: **\n"
+ "** **\n"
+ "** gamma x_min ks **\n"
+ "** **\n"
+ "** where 'gamma' is the exponent of the best fit, 'x_min' is **\n"
+ "** the smallest of the input values after which the power-law **\n"
+ "** hypothesis hold, and 'ks' is the value of the KS statistics **\n"
+ "** for the best fit. **\n"
+ "** **\n"
+ "** The second (optional) parameter 'tol' sets the tolerance **\n"
+ "** on the acceptable statistical error of the fit (set to **\n"
+ "** 0.1 if no value is provided). **\n"
+ "** **\n"
+ "** If the third parameter is 'TEST', the program uses the **\n"
+ "** the Kolmogorov-Smirnov test on a series of bootstrapped **\n"
+ "** power-law sequences to estimate the p-value of the fit, and **\n"
+ "** the output is in the format: **\n"
+ "** **\n"
+ "** gamma x_min ks p_value **\n"
+ "** **\n"
+ "** Higher values of 'p_value' correspond to better fits. **\n"
+ "** **\n"
+ "** If 'num_test' is provided, use that number of bootstrapped **\n"
+ "** sequences to compute the p-value. Otherwise, use 100 **\n"
+ "** sequences. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <data_in> [<tol> [ TEST [<num_test>]]]\n", argv[0]);
+}
+
+
+void load_data(char *fname, double **data, unsigned int *N, char sort){
+
+ FILE *fin;
+ char error_str[256];
+ char buff[256];
+ char *ptr;
+ double x;
+ unsigned int size;
+
+ size = 10;
+
+ *data = malloc(size * sizeof(double));
+
+ *N=0;
+ if (!strcmp(fname, "-")){
+ fin = stdin;
+ }
+ else{
+ fin = fopen(fname, "r");
+ }
+ if (!fin){
+ sprintf(error_str, "Error opening file %s", fname);
+ perror(error_str);
+ exit(3);
+ }
+
+ while(fgets(buff, 256, fin)){
+ ptr = strtok(buff, " ");
+ if (ptr[0] == '#')
+ continue;
+ x = atof(ptr);
+ if (*N == size){
+ size += 10;
+ *data = realloc(*data, size*sizeof(double));
+ }
+ (*data)[*N] = x;
+ *N += 1;
+ }
+ *data = realloc(*data, (*N)*sizeof(double));
+ if (sort){
+ qsort(*data, *N, sizeof(double), compare_double);
+ }
+ fclose(fin);
+ return;
+}
+
+/**
+ * find the first position at which the element x appears in the
+ * "data" array using binary search (the array is sorted in
+ * increasing order of x)
+ */
+int find_pos_x(double x,double *data, unsigned int N){
+ int H, L, M;
+
+ L = 0;
+ H = N-1;
+
+ while(L<=H){
+ M = (H + L)/2;
+ if (x == data[M]){
+ while(M >=0 && x == data[M]) M--;
+ if (M==-1){
+ return 0;
+ }
+ return M+1; /* we return the index of the first appearance of element x*/
+ }
+ else if (x < data[M]){
+ H = M-1;
+ }
+ else if (x > data[M]){
+ L = M+1;
+ }
+ }
+ return -1; /* the value is not present */
+}
+
+double fit_alpha(double *data, unsigned int N, double xmin, unsigned int idx){
+
+ double alpha = 0;
+ int i;
+
+ for(i = idx; i < N; i++){
+ alpha += log(data[i]*1.0/(xmin-0.5));
+ }
+ alpha = 1 + (N - idx) * 1.0 / alpha;
+ return alpha;
+}
+
+
+double fit_alpha_continuous(double *data, unsigned int N, double xmin, unsigned int idx){
+
+ double alpha = 0;
+ int i;
+
+ for(i = idx; i < N; i++){
+ alpha += log(data[i]*1.0/(xmin));
+ }
+ alpha = 1 + (N - idx) * 1.0 / alpha;
+ return alpha;
+}
+
+
+/*
+ *
+ * Kolmogorov-Smirnov test
+ *
+ */
+
+double KS (double *data, unsigned int N, double alpha, int idx){
+
+ double c_data, c_theo, val;
+ double xmin, x;
+ double dist, max_dist = -1;
+ int i;
+
+ c_data = c_theo = 0.0;
+ xmin = data[idx];
+
+ for (i=idx; i<N;){
+ x = data[i];
+ while(i<N && data[i] == x){
+ val = xmin * 1.0 / data[i];
+ c_theo = 1.0 - pow(val, alpha-1.0);
+ dist = fabs(c_theo - c_data);
+
+ if (dist > max_dist){
+ max_dist = dist;
+ }
+ i++;
+ }
+ c_data = 1.0 * (i- idx)/(N-idx);
+ }
+ return max_dist;
+}
+
+void dump_data_double(double *v, unsigned int N){
+ int i;
+
+ if (N < 1){
+ return;
+ }
+ printf("%g",v[0]);
+ for(i=1; i<N; i++){
+ printf(" %g",v[i]);
+ }
+ printf("\n");
+}
+
+
+/* This is the same as best_fit, but for continuous-valued time-series */
+void best_fit_continuous(double *data, unsigned int N, double *alpha, double *xmin, double tol){
+
+ double min_x, max_x, x;
+ double cur_alpha, best_alpha, best_x, ks_test, best_ks;
+ int idx,i;
+
+
+
+
+ qsort(data, N, sizeof(double), compare_double);
+
+ min_x = data[0];
+ best_x = data[0];
+ max_x = data[N-1];
+ best_ks = 10000000;
+ cur_alpha = 0.0;
+ best_alpha = 0.0;
+ idx = 0;
+ for(x=min_x, i=0; x<=max_x && (cur_alpha)/sqrt(1.0 * (N-idx))< tol; ){
+ idx = find_pos_x(x, data, N);
+ if (idx <0){
+ i ++;
+ continue;
+ }
+ cur_alpha = fit_alpha_continuous(data, N, x, idx);
+ ks_test = KS(data, N, cur_alpha, idx);
+ if(ks_test < best_ks){
+ best_ks = ks_test;
+ best_alpha=cur_alpha;
+ best_x = data[idx];
+ }
+ while(data[i] == x && i <N){
+ i ++;
+ }
+ x = data[i];
+ }
+
+ *alpha = best_alpha;
+ *xmin = best_x;
+ return;
+}
+
+/* Fit a discrete power-law */
+
+void best_fit(double *data, unsigned int N, double *alpha, double *xmin, double tol){
+
+ double min_x, max_x, x;
+ double cur_alpha, best_alpha, best_x, ks_test, best_ks;
+ int idx, i;
+
+
+
+ qsort(data, N, sizeof(double), compare_double);
+ min_x = data[0];
+ best_x = data[0];
+ max_x = data[N-1];
+ best_ks = 10000000;
+ cur_alpha = 0.0;
+ best_alpha = 0.0;
+ idx = 0;
+ for(x=min_x, i = 0; x<=max_x && (cur_alpha)/sqrt(1.0 * (N-idx))< tol;){
+ idx = find_pos_x(x, data, N);
+
+ if (idx<0) {
+ i ++;
+ continue;
+ }
+ cur_alpha = fit_alpha(data, N, x, idx);
+
+ ks_test = KS(data, N, cur_alpha, idx);
+ if(ks_test < best_ks){
+ best_ks = ks_test;
+ best_alpha=cur_alpha;
+ best_x = data[idx];
+ }
+ while(data[i] == x && i<N){
+ i ++;
+ }
+ x = data[i];
+ }
+
+ *alpha = best_alpha;
+ *xmin = best_x;
+ return;
+}
+
+void sample_powerlaw(double *data, unsigned int N, double alpha, double xmin,double *v){
+ int i, last_idx, r;
+ double val;
+
+ i=0;
+ last_idx = 0;
+ while(data[i] < xmin){
+ last_idx ++;
+ i++;
+ }
+
+ i=0;
+ while(i <last_idx){
+ r = rand() % (last_idx + 1);
+ v[i] = data[r];
+ i++;
+ }
+
+ for(; i<N; i++){
+ val = 1.0 * rand()/RAND_MAX;
+ v[i] = floor(xmin * pow(1.0-val, -1.0/(alpha-1)));
+
+ }
+
+}
+
+
+double test_powerlaw(double *data, unsigned int N, double alpha, double xmin,
+ double ks, int num_test,
+ void (*f)(double *, unsigned int , double *, double *, double)){
+
+ int num = 0, i, idx;
+ double *v, cur_alpha, cur_xmin, cur_ks;
+
+
+ v = malloc(N * sizeof(double));
+
+ for(i=0; i<num_test; i++){
+ sample_powerlaw(data, N, alpha, xmin, v);
+ qsort(v, N, sizeof(double), compare_double);
+ f(v, N, &cur_alpha, &cur_xmin, 0.1);
+ idx = find_pos_x(cur_xmin, v, N);
+ cur_ks = KS(v, N, cur_alpha, idx);
+ if (cur_ks > ks){
+ num += 1;
+ }
+ }
+ free(v);
+ return 1.0 * num / num_test;
+}
+
+/* We assume that the data set has already been sorted in ascending
+ order */
+int is_continuous(double *data, int N){
+ int i;
+
+ for (i=0; i<N; i++){
+ if (data[i] - (double)(int)data[i] != 0.0)
+ return 1;
+ }
+ /* return 1 only if we need a real-valued fit....*/
+ return 0;
+}
+
+/* we assume that the data set has already been sorted in ascending
+ order */
+double renormalise(double *data, unsigned int N){
+
+ int i;
+ double scaling = 1.0;
+
+ if (data[0] < 1.0 ){
+ scaling = 1.0/data[0];
+ for (i=0; i<N; i++){
+ data[i] *= scaling;
+ }
+ }
+ return scaling;
+}
+
+
+int main(int argc, char *argv[]){
+
+ double *data=NULL;
+ unsigned int N, i;
+ double alpha, xmin, ks, tol, p_value, scaling_fact;
+ char test = 0;
+ int num_test;
+
+ void (*fit_func)(double *, unsigned int , double *, double *, double);
+
+
+ if (argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+ if (argc > 2)
+ tol = atof(argv[2]);
+ else
+ tol = 0.1;
+
+ if (argc > 3 && !my_strcasecmp(argv[3], "TEST")){
+ test = 1;
+ }
+
+ if(argc > 4){
+ num_test = atoi(argv[4]);
+ }
+ else
+ num_test = 100;
+
+ srand(time(NULL));
+
+
+
+ load_data(argv[1], &data, &N, 1);
+
+ if(is_continuous(data, N)){
+ fprintf(stderr, "Using continuous fit\n");
+ fit_func = best_fit_continuous;
+ }
+ else{
+ fprintf(stderr, "Using discrete fit\n");
+ fit_func = best_fit;
+ }
+
+ scaling_fact = 1.0;
+
+ fit_func(data, N, &alpha, &xmin, tol);
+ i = find_pos_x(xmin, data, N);
+ ks = KS(data, N, alpha, i);
+ if (test){
+ p_value = test_powerlaw(data, N, alpha, xmin, ks, num_test, fit_func);
+ printf("%g %g %g %g\n", alpha, xmin/scaling_fact, ks, p_value);
+ }
+ else{
+ printf("%g %g %g\n", alpha, xmin / scaling_fact, ks);
+ }
+ free(data);
+}
diff --git a/src/gn/Makefile.am b/src/gn/Makefile.am
new file mode 100644
index 0000000..77874be
--- /dev/null
+++ b/src/gn/Makefile.am
@@ -0,0 +1,5 @@
+include ../common.mk
+bin_PROGRAMS = gn
+gn_SOURCES = gn.c ../utils/utils.c ../include/utils.h
+gn_LDADD = -lm
+
diff --git a/src/gn/Makefile.in b/src/gn/Makefile.in
new file mode 100644
index 0000000..85ffa4c
--- /dev/null
+++ b/src/gn/Makefile.in
@@ -0,0 +1,578 @@
+# 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 = :
+bin_PROGRAMS = gn$(EXEEXT)
+subdir = src/gn
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_gn_OBJECTS = gn.$(OBJEXT) ../utils/utils.$(OBJEXT)
+gn_OBJECTS = $(am_gn_OBJECTS)
+gn_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(gn_SOURCES)
+DIST_SOURCES = $(gn_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+gn_SOURCES = gn.c ../utils/utils.c ../include/utils.h
+gn_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/gn/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/gn/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+gn$(EXEEXT): $(gn_OBJECTS) $(gn_DEPENDENCIES) $(EXTRA_gn_DEPENDENCIES)
+ @rm -f gn$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(gn_OBJECTS) $(gn_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gn.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/gn/gn.c b/src/gn/gn.c
new file mode 100644
index 0000000..d69008d
--- /dev/null
+++ b/src/gn/gn.c
@@ -0,0 +1,495 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program implements the Girvan-Newman algorithm for community
+ * detection, based on the removal of edges with largest betweenness.
+ *
+ *
+ * References:
+ *
+ * [1] M. Girvan and M. E. J. Newman. "Community structure in social
+ * and biological networks". P. Natl. Acad. Sci. USA 99 (2002),
+ * 7821--7826.
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <math.h>
+
+#include "utils.h"
+
+void usage(char *argv[]){
+
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- gn -*- **\n"
+ "** **\n"
+ "** Find the communities of the input graph 'graph_in' using **\n"
+ "** the Girvan-Newman algorithm (successive removal of edges **\n"
+ "** with high betweeneess). **\n"
+ "** **\n"
+ "** The input file 'graph_in' is an edge-list: **\n"
+ "** **\n"
+ "** I_1 J_1 **\n"
+ "** I_2 J_2 **\n"
+ "** I_3 J_3 **\n"
+ "** ... ... **\n"
+ "** I_K J_K **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the file from **\n"
+ "** the standard input (STDIN). **\n"
+ "** **\n"
+ "** The program prints on STDOUT the partition corresponding **\n"
+ "** to the largest value of modularity, in the format: **\n"
+ "** **\n"
+ "** node_1 comm_1 **\n"
+ "** node_2 comm_2 **\n"
+ "** node_3 comm_3 **\n"
+ "** ..... **\n"
+ "** **\n"
+ "** where 'comm_1' is the community to which 'node_1' belongs. **\n"
+ "** **\n"
+ "** The program prints on STDERR the number of communities and **\n"
+ "** the value of modularity obtained after the removal of each **\n"
+ "** edge, in the format: **\n"
+ "** **\n"
+ "** **\n"
+ "** ## nc: NUM_COMM Q_max: Q_MAX **\n"
+ "** nc_1 Q_1 **\n"
+ "** nc_2 Q_2 **\n"
+ "** nc_3 Q_3 **\n"
+ "** ... **\n"
+ "** **\n"
+ "** where 'nc_1', 'nc_2', 'nc_3', etc. is the number of **\n"
+ "** communities (connected components) remaining after the **\n"
+ "** 1st, 2nd, 3rd, etc. edge has been removed, and 'Q_1', **\n"
+ "** 'Q_2', 'Q_3', etc. are the value of the modularity **\n"
+ "** function of the corresponding node partition. The first **\n"
+ "** output line reports the number of communities NUM_COMM **\n"
+ "** and corresponding value of modularity Q_MAX of the best **\n"
+ "** partition found. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in>\n", argv[0]);
+ exit(1);
+}
+
+
+void add_predecessor(unsigned int **pred, unsigned int k){
+
+ (*pred)[0] += 1;
+ *pred = realloc(*pred, ((*pred)[0] + 1) * sizeof(unsigned int));
+ (*pred)[ (*pred)[0] ] = k;
+}
+
+
+
+/*
+ *
+ * Compute node and edge betweenness, based on shortest paths
+ * originating on the "num" nodes specified in "nlist". "edge_bet"
+ * should be an appropriately allocated (and initialised to zero!!!!)
+ * vector of length equal to J_slap, and will contain the values of
+ * edge betweenness.
+ *
+ */
+double* compute_bet_dependency_active(unsigned int N, unsigned int *J_slap, unsigned int *r_slap,
+ double *edge_bet, char *active){
+
+ static unsigned int *marked, **preds, *dist, *nj;
+ static double *delta, *cB;
+ int i, j, k, w, idx, cur_node;
+ double val;
+ unsigned int d;
+ unsigned int n, nd, ndp;
+ unsigned int edge_pos;
+
+ if (!dist)
+ dist = malloc(N * sizeof(unsigned int));
+ if (!marked)
+ marked = malloc(N * sizeof(unsigned int));
+ if (!preds)
+ preds = malloc(N * sizeof(unsigned int *));
+ if (!nj)
+ nj = malloc(N * sizeof(unsigned int));
+ if (!delta)
+ delta = malloc(N * sizeof(double));
+ if (!cB)
+ cB = malloc(N * sizeof(double));
+
+ for (i=0; i<N; i++){
+ cB[i] = 0;
+ preds[i] = NULL;
+ }
+
+ for (j=0; j<N; j++){
+ for(i=0; i<N; i++){
+ dist[i] = N;
+ if (preds[i] == NULL){
+ preds[i] = malloc(sizeof(unsigned int));
+ }
+ preds[i][0] = 0; /* The list of predecessors is now empty! */
+
+ nj[i] = 0;
+ delta[i]= 0;
+ }
+ dist[j] = 0;
+ nj[j] = 1;
+ marked[0] = j;
+ d = 0;
+ n = 0;
+ nd = 1;
+ ndp = 0;
+ while (d<N && nd > 0){
+ for(i = n; i< n+nd; i ++){
+ cur_node = marked[i];
+ for (k=r_slap[cur_node]; k<r_slap[cur_node +1] ; k++){
+ w = J_slap[k];
+ if (!active[k])
+ /* discard inactive links */
+ continue;
+
+ if ( dist[w] == d+1){
+ add_predecessor((unsigned int **)(preds + w), cur_node);
+ nj[w] += nj[cur_node];
+ }
+ if ( dist[w] == N){
+ dist[w] = d+1;
+ marked[n + nd + ndp] = w;
+ add_predecessor(preds + w, cur_node);
+ ndp +=1;
+ nj[w] += nj[cur_node];
+ }
+ }
+ }
+ n = n + nd;
+ nd = ndp;
+ ndp = 0;
+ d += 1;
+ }
+ for (k= n-1; k>=1; k--){
+ w = marked[k];
+ for (idx=1; idx <= preds[w][0]; idx ++ ){
+ i = preds[w][idx];
+ val = 1.0 * nj[i] / nj[w] * (1 + delta[w]);
+ delta[i] += val;
+ /* Now we should update the betweenness of the edge (i,w) in
+ the appropriate position of the vector edge_bet*/
+ find_neigh_in_Jslap(J_slap, r_slap, N, i, w, &edge_pos);
+ edge_bet[edge_pos] += val;
+ find_neigh_in_Jslap(J_slap, r_slap, N, w, i, &edge_pos);
+ edge_bet[edge_pos] += val;
+ }
+ cB[w] += delta[w];
+ }
+ }
+ //free(marked);
+ return cB;
+}
+
+
+
+/**
+ *
+ * Depth-First search on the node i....
+ *
+ */
+int dfs_active(unsigned int i, unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int N, unsigned int nc, unsigned int *ic, unsigned int *f,
+ char reset, char *active){
+
+ static unsigned int time;
+ unsigned int j, s;
+
+ if(reset){
+ time = 0;
+ }
+
+ ic[i] = nc;
+ s = 1;
+ time += 1;
+
+ for(j=r_slap[i]; j<r_slap[i+1]; j++){
+ if (ic[J_slap[j]] == 0 && active[j]){
+ s += dfs_active(J_slap[j], J_slap, r_slap, N, nc, ic, f, 0, active);
+ }
+ }
+ time += 1;
+ f[i] = time;
+ return s;
+}
+
+/**
+ *
+ * Find all the components of the given graph
+ *
+ */
+
+int components(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ unsigned int *ic, unsigned int *f, unsigned int *sizes,
+ char *active){
+
+ unsigned int nc, s;
+ unsigned int i;
+
+
+ for(i=0; i<N; i++){
+ ic[i] = 0;
+ f[i] = 0;
+ }
+ nc = 0;
+ for(i=0; i<N; i++){
+ while( i<N && ic[i] != 0)
+ i += 1;
+ if (i == N)
+ break;
+ nc += 1;
+ s = dfs_active(i, J_slap, r_slap, N, nc, ic, f, 1, active);
+ sizes[nc] = s;
+ }
+ return nc;
+}
+
+
+/**
+ * find the position of the element in v with maximal value. If there
+ * are more than one element with the same value, return the position
+ * of the last one found. In order to introduce randomness, the search
+ * starts from a position sampled uniformly at random
+ *
+ */
+unsigned int find_pos_max_rand(double *v, unsigned int K, char *active){
+
+ unsigned int i;
+ double max;
+ unsigned int base, pos_max;
+
+ base = rand() % K;
+ while(! active[base] )
+ base = (base + 1) % K;
+ max = v[base];
+ pos_max = base;
+
+ for(i=base; i<base + K; i++){
+ if (v[i % K] >= max && active[i % K]){
+ max = v[i % K];
+ pos_max = i % K;
+ }
+ }
+ return pos_max;
+}
+
+
+unsigned int find_pos_max(double *v, unsigned int K, char *active){
+
+ unsigned int i;
+ double max;
+ unsigned int base, pos_max;
+
+ base = 0;
+ while(! active[base] )
+ base = (base + 1) % K;
+ max = v[base];
+ pos_max = base;
+
+ for(i=base; i<base + K; i++){
+ if (v[i % K] >= max && active[i % K]){
+ max = v[i % K];
+ pos_max = i % K;
+ }
+ }
+ return pos_max;
+}
+
+
+/* This function compute the modularity function of the partition
+ 'part'...*/
+double compute_modularity(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ unsigned int *part, unsigned int nc){
+ static double *e, *a;
+
+ unsigned int i, j, n, K;
+ unsigned int ci, cj;
+ double Q;
+
+ if(!e)
+ e = malloc((N+1) * sizeof(double));
+ if(!a)
+ a = malloc((N+1) * sizeof(double));
+
+ memset(e, 0, (N+1) * sizeof(double));
+ memset(a, 0, (N+1) * sizeof(double));
+
+ K = r_slap[N];
+
+ for (i=0; i<N; i++){
+ ci = part[i];
+ a[ci] += (r_slap[i+1] - r_slap[i]);
+ for(j=r_slap[i]; j< r_slap[i+1]; j++){
+ cj = part[J_slap[j]];
+ if (ci == cj){
+ e[ci] += 1;
+ }
+ }
+ }
+
+ Q = 0.0;
+ for (n=1; n<=nc; n++){
+ Q += 1.0 * e[n]/(1.0 * K ) - pow(1.0 * a[n]/K, 2);
+ }
+ return Q;
+}
+
+
+unsigned int* girvan_newman(unsigned int *J_slap, unsigned int *r_slap, unsigned int N){
+
+ unsigned int K, nc, pos;
+ double *edge_bet = NULL;
+ char *active = NULL;
+ double Q, Q_max;
+
+ unsigned int *ic, *f, *sizes;
+ unsigned int *best_part;
+
+ int i, j, nc_max;
+
+ K = r_slap[N];
+
+ ic = malloc((N) * sizeof(unsigned int));
+ f = malloc(N * sizeof(unsigned int));
+ sizes = malloc((N+1) * sizeof(unsigned int));
+ best_part = malloc(N * sizeof(unsigned int));
+
+
+ /* We initialise the vector "active" which idicates active edges */
+
+ active = malloc(K * sizeof(char));
+ for (i=0; i<K; i++){
+ active[i] = 1;
+ }
+
+ edge_bet = malloc(K * sizeof(double));
+ nc_max = 0;
+ Q_max = -1000;
+
+ for(j=0; j<K; j++){
+ memset(edge_bet, 0, K * sizeof(double));
+ /* compute edge betweenness */
+ compute_bet_dependency_active(N, J_slap, r_slap, edge_bet, active);
+ /* find edge with maximal betweenness... */
+ pos = find_pos_max_rand(edge_bet, K, active);
+ /* and knock it down */
+ active[pos] = 0;
+ /* compute connected components */
+ nc = components(J_slap, r_slap, N, ic, f, sizes, active);
+ /* compute the modularity of the partition induced by components */
+ Q = compute_modularity(J_slap, r_slap, N, ic, nc);
+ fprintf(stderr, "%d %g\n", nc, Q);
+ /* if Q is maximal, save the current partition */
+ if (j > 0){
+ if (Q > Q_max){
+ Q_max = Q;
+ nc_max = nc;
+ memcpy (best_part, ic, N * sizeof(unsigned int));
+ }
+ }
+ else{
+ Q_max = Q;
+ memcpy(best_part, ic, N*sizeof(unsigned int));
+ }
+ }
+ /* Return the best partition */
+ fprintf(stdout, "### nc: %d Q_max: %g\n", nc_max, Q_max);
+ free(f);
+ free(ic);
+ free(sizes);
+ free(edge_bet);
+ free(active);
+ return best_part;
+}
+
+
+
+void dump_partition(unsigned int *p, unsigned int N){
+
+ unsigned int i;
+ for(i=0; i<N; i++){
+ fprintf(stdout, "%d %d\n", i, p[i]);
+ }
+}
+
+
+int main(int argc, char *argv[]){
+
+
+ unsigned int *J_slap=NULL, *r_slap=NULL;
+ unsigned int K, N;
+ FILE *filein;
+ unsigned int *part;
+
+
+ if(argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+
+ srand(time(NULL));
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ read_slap(filein, &K, &N, &J_slap, &r_slap);
+ sort_neighbours(J_slap, r_slap, N);
+ fclose(filein);
+
+ part = girvan_newman(J_slap, r_slap, N);
+ dump_partition(part, N);
+ free(J_slap);
+ free(r_slap);
+ free(part);
+
+}
diff --git a/src/graph_info/Makefile.am b/src/graph_info/Makefile.am
new file mode 100644
index 0000000..db68d93
--- /dev/null
+++ b/src/graph_info/Makefile.am
@@ -0,0 +1,4 @@
+include ../common.mk
+bin_PROGRAMS = graph_info
+graph_info_SOURCES = graph_info.c ../utils/utils.c ../include/utils.h
+graph_info_LDADD = -lm
diff --git a/src/graph_info/Makefile.in b/src/graph_info/Makefile.in
new file mode 100644
index 0000000..3e1b107
--- /dev/null
+++ b/src/graph_info/Makefile.in
@@ -0,0 +1,578 @@
+# 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 = :
+bin_PROGRAMS = graph_info$(EXEEXT)
+subdir = src/graph_info
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_graph_info_OBJECTS = graph_info.$(OBJEXT) ../utils/utils.$(OBJEXT)
+graph_info_OBJECTS = $(am_graph_info_OBJECTS)
+graph_info_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(graph_info_SOURCES)
+DIST_SOURCES = $(graph_info_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+graph_info_SOURCES = graph_info.c ../utils/utils.c ../include/utils.h
+graph_info_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/graph_info/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/graph_info/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+graph_info$(EXEEXT): $(graph_info_OBJECTS) $(graph_info_DEPENDENCIES) $(EXTRA_graph_info_DEPENDENCIES)
+ @rm -f graph_info$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(graph_info_OBJECTS) $(graph_info_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_info.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/graph_info/graph_info.c b/src/graph_info/graph_info.c
new file mode 100644
index 0000000..3fc0ec6
--- /dev/null
+++ b/src/graph_info/graph_info.c
@@ -0,0 +1,130 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Compute and print the basic properties of the undirected graph on
+ * input, i.e., the number of nodes, the number of edges, and the
+ * first two uncentered moments of the degree sequence (<k> and
+ * <k^2>).
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "utils.h"
+
+
+void usage(char *argv[]){
+
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- graph_info -*- **\n"
+ "** **\n"
+ "** Compute basic information about the 'graph_in', namely the **\n"
+ "** number of nodes, number of edges, average degree, and the **\n"
+ "** average squared degree. **\n"
+ "** **\n"
+ "** The input file 'graph_in' is an edge-list: **\n"
+ "** **\n"
+ "** I_1 J_1 **\n"
+ "** I_2 J_2 **\n"
+ "** I_3 J_3 **\n"
+ "** ... ... **\n"
+ "** I_K J_K **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the file from **\n"
+ "** the standard input (STDIN). **\n"
+ "** **\n"
+ "** The output is a single line containing in the format: **\n"
+ "** **\n"
+ "** N K avg_k avg_k2 **\n"
+ "** **\n"
+ "** where 'N' is the number of nodes, 'K' is the number of **\n"
+ "** edges, 'avg_k' is the average degree, and 'avg_k2' is the **\n"
+ "** average of the squared degree. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in>\n", argv[0]);
+}
+
+
+
+double ksquare_mean(unsigned int N, unsigned int *r_slap){
+
+ double sum = 0;
+ unsigned int i;
+ unsigned int k;
+ for(i=0; i<N; i++){
+ k = r_slap[i+1] - r_slap[i];
+ sum += k*k;
+ }
+ sum /= N;
+ return sum;
+}
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int N, K;
+ unsigned int *J_slap, *r_slap;
+ FILE *filein;
+ double k2mean;
+
+ if(argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ read_slap(filein, &K, &N, &J_slap, &r_slap);
+
+ fclose(filein);
+
+ k2mean = ksquare_mean(N, r_slap);
+ printf("%d %d %2.6f %2.6f\n", N, K/2, 1.0*K / N, k2mean);
+ free(J_slap);
+ free(r_slap);
+
+}
diff --git a/src/hidden/Makefile.am b/src/hidden/Makefile.am
new file mode 100644
index 0000000..5751f24
--- /dev/null
+++ b/src/hidden/Makefile.am
@@ -0,0 +1,7 @@
+include ../common.mk
+bin_PROGRAMS = hv_net
+hv_net_SOURCES = hv_net.c \
+../utils/utils.c ../utils/cum_distr.c \
+../include/utils.h ../include/cum_distr.h
+hv_net_LDADD = -lm
+
diff --git a/src/hidden/Makefile.in b/src/hidden/Makefile.in
new file mode 100644
index 0000000..fb0104b
--- /dev/null
+++ b/src/hidden/Makefile.in
@@ -0,0 +1,585 @@
+# 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 = :
+bin_PROGRAMS = hv_net$(EXEEXT)
+subdir = src/hidden
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_hv_net_OBJECTS = hv_net.$(OBJEXT) ../utils/utils.$(OBJEXT) \
+ ../utils/cum_distr.$(OBJEXT)
+hv_net_OBJECTS = $(am_hv_net_OBJECTS)
+hv_net_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(hv_net_SOURCES)
+DIST_SOURCES = $(hv_net_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+hv_net_SOURCES = hv_net.c \
+../utils/utils.c ../utils/cum_distr.c \
+../include/utils.h ../include/cum_distr.h
+
+hv_net_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/hidden/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/hidden/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/cum_distr.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+hv_net$(EXEEXT): $(hv_net_OBJECTS) $(hv_net_DEPENDENCIES) $(EXTRA_hv_net_DEPENDENCIES)
+ @rm -f hv_net$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(hv_net_OBJECTS) $(hv_net_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/cum_distr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hv_net.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/hidden/hv_net.c b/src/hidden/hv_net.c
new file mode 100644
index 0000000..cfba020
--- /dev/null
+++ b/src/hidden/hv_net.c
@@ -0,0 +1,337 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This in an implementation of the hidden-variable model by Bogunya'
+ * and Pastor-Satorras. The program creates a random graph whose
+ * joint degree distribution is identical to that of a network given
+ * as input.
+ *
+ * References:
+ *
+ * [1] M. Boguna and R. Pastor-Satorras. "Class of correlated random
+ * networks with hidden variables". Phys. Rev. E 68 (2003), 036112.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <math.h>
+
+#include "utils.h"
+#include "cum_distr.h"
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- hv_net -*- **\n"
+ "** **\n"
+ "** Create a random graph whose joint degree distribution is **\n"
+ "** identical to that of a network provided as input. **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the edge list **\n"
+ "** from STDIN. **\n"
+ "** **\n"
+ "** The program prints on STDOUT the edge-list of the sampled **\n"
+ "** graph. **\n"
+ "** **\n"
+ "** If 'SHOW' is specified as second parameter, the program **\n"
+ "** prints on STDERR the values of the hidden variable **\n"
+ "** associated to each node and of the actual degree they have **\n"
+ "** in the newly-created random graph, in the format: **\n"
+ "** **\n"
+ "** h_1 k_1 **\n"
+ "** h_2 k_2 **\n"
+ "** ... **\n"
+ "** h_N k_N **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in> [SHOW]\n", argv[0]);
+}
+
+
+
+typedef struct{
+ unsigned int N;
+ unsigned int K;
+ unsigned int *J_slap;
+ unsigned int *r_slap;
+ unsigned int k_min;
+ unsigned int k_max;
+ double *pk; /* degree distribution -- this is equal to rho!!!! */
+ double **pkk; /* joint degree distribution */
+ double **f; /* the linking function */
+ unsigned int *h; /* The array containing hidden variables for the N nodes */
+ unsigned int *new_degs; /* the new degrees of the sampled graph */
+} params_t;
+
+
+/**
+ *
+ * sample the hidden degrees of the nodes using the cumulative
+ * distribution P(k)
+ *
+ */
+void sample_node_variables(params_t *p, cum_distr_t *P){
+
+ unsigned int i;
+ unsigned int k;
+
+
+ for(i=0; i<p->N; i++){
+ k = cum_distr_sample(P);
+ p->h[i] = k;
+ }
+}
+
+/**
+ *
+ * Compute the function f(h,h') for each pair of degrees
+ *
+ */
+void compute_fhh(params_t *p){
+
+ unsigned int k1, k2;
+ double avg_k;
+
+ avg_k = 1.0 * p->K / p->N;
+
+ for(k1 = p->k_min; k1 <= p->k_max; k1++){
+ for(k2 = k1; k2 <= p->k_max; k2++){
+ p->f[k1][k2] = p->f[k2][k1] = avg_k * p->pkk[k1][k2] / (p->N * p->pk[k1] * p->pk[k2]);
+ }
+ }
+}
+
+
+
+/**
+ *
+ * Sample the edges of the graph
+ *
+ */
+void sample_edges(params_t *p){
+
+ unsigned int i, j, ki, kj;
+ double val;
+
+ for(i=0; i<p->N; i++){
+ ki = p->h[i];
+ for (j=i+1; j<p->N; j++){
+ kj = p->h[j];
+ val = 1.0 * rand() / RAND_MAX;
+ /* we create the edge (i,j) with proability f[ki][kj]*/
+ if (val < p->f[ki][kj]){
+ printf("%d %d\n", i, j);
+ p->new_degs[i] += 1;
+ p->new_degs[j] += 1;
+ }
+ }
+ }
+}
+
+
+void init_hv_params(params_t *p){
+
+ unsigned int i;
+
+ p->h = malloc(p->N * sizeof(unsigned int));
+ p->f = malloc((p->k_max + 1) * sizeof(double*));
+ p->new_degs = malloc(p->N * sizeof(unsigned int));
+
+ for(i=0; i<=p->k_max; i++){
+ p->f[i] = malloc((p->k_max + 1) * sizeof(double));
+ }
+ for (i=0; i<p->N; i++){
+ p->new_degs[i] = 0;
+ }
+}
+
+
+
+void compute_distributions(params_t *g){
+
+ unsigned int i,j, neigh, k1, k2;
+ double sumk, sumkk;
+
+ g->k_min = g->N;
+ g->k_max = 0;
+
+ g->pk = NULL;
+
+ /* Compute (and allocate on the fly) the degree distribution */
+
+ for(i=0; i< g->N; i ++){
+ k1 = g->r_slap [i+1] - g->r_slap[i];
+ if (k1 > g->k_max){
+ g->pk = realloc(g->pk, (k1 + 1) * sizeof(double));
+ for(j=g->k_max+1; j<=k1; j++){
+ g->pk[j] = 0;
+ }
+ g->k_max = k1;
+ }
+ else if(k1 < g->k_min){
+ g->k_min = k1;
+ }
+ g->pk[k1] += 1;
+ }
+
+ /* Allocate and initialise the joint degree distribution */
+ g->pkk = malloc((g->k_max + 1 ) * sizeof(double*));
+ for(i=0; i<=g->k_max ; i++){
+ g->pkk[i] = malloc((g->k_max + 1) * sizeof(double));
+ memset(g->pkk[i], 0, (g->k_max + 1) * sizeof(double));
+ }
+
+ for(i=0; i<g->N; i++){
+ k1 = g->r_slap[i+1] - g->r_slap[i];
+ for(j=g->r_slap[i]; j< g->r_slap[i+1]; j++){
+ neigh = g->J_slap[j];
+ k2 = g->r_slap[neigh+1] - g->r_slap[neigh];
+ g->pkk[k1][k2] += 1;
+ }
+ }
+
+ /* Now we normalise both pk and pkk...*/
+
+ sumk = sumkk = 0.0;
+
+ for(i=0; i<=g->k_max; i++){
+ g->pk[i] /= g->N;
+ sumk += g->pk[i];
+ g->pkk[i][i] /= (g->K);
+ sumkk += g->pkk[i][i];
+ for(j=i+1; j<=g->k_max; j++){
+ g->pkk[i][j] /= (g->K);
+ g->pkk[j][i] = g->pkk[i][j];
+ sumkk += 2* g->pkk[i][j];
+ }
+ }
+
+}
+
+
+void compute_rho(params_t *g, cum_distr_t *P){
+
+ unsigned int k;
+
+ for(k=g->k_min; k<= g->k_max; k++){
+
+ if(g->pk[k] > 0){
+ if (cum_distr_add(P, k, g->pk[k]) != 0){
+ fprintf(stderr, "Error in the computation of the cumulative degree distribution!!!!"
+ " Exiting!!!\n");
+ exit(3);
+ }
+ }
+ }
+}
+
+void dump_deg_h(params_t *p){
+
+ unsigned int i;
+
+ for(i=0; i<p->N; i++){
+ fprintf(stderr, "%d %d\n", p->h[i], p->new_degs[i]);
+ }
+}
+
+
+int main(int argc, char *argv[]){
+
+ params_t p;
+ cum_distr_t *P;
+ int i;
+
+ FILE *filein;
+
+
+ if (argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+ srand(time(NULL));
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ p.J_slap = p.r_slap = NULL;
+
+ read_slap(filein, &(p.K), &(p.N), &(p.J_slap), &(p.r_slap));
+
+ fclose(filein);
+
+ compute_distributions(&p);
+
+ init_hv_params(&p);
+
+ P = cum_distr_init(p.k_max + 1);
+ compute_rho(&p, P);
+ compute_fhh(&p);
+
+ sample_node_variables(&p, P);
+ sample_edges(&p);
+
+ /*
+ * If 'SHOW' is provided, print on STDERR the value of the hidden
+ * variable of each node
+ */
+ if (argc > 2 && !my_strcasecmp(argv[2], "SHOW")){
+ dump_deg_h(&p);
+ }
+
+ cum_distr_destroy(P);
+ free(p.J_slap);
+ free(p.r_slap);
+ free(p.pk);
+ free(p.h);
+ free(p.new_degs);
+ for(i=0; i<=p.k_max ; i++){
+ free(p.pkk[i]);
+ free(p.f[i]);
+ }
+ free(p.pkk);
+ free(p.f);
+}
+
diff --git a/src/include/cum_distr.h b/src/include/cum_distr.h
new file mode 100644
index 0000000..a06336a
--- /dev/null
+++ b/src/include/cum_distr.h
@@ -0,0 +1,60 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ */
+
+#ifndef __CUM_DISTR_H__
+#define __CUM_DISTR_H__
+
+typedef struct{
+ unsigned int id;
+ long double value;
+} idval_t;
+
+typedef struct{
+ unsigned int N;
+ unsigned int num;
+ idval_t *v;
+ long double sum;
+} cum_distr_t;
+
+cum_distr_t* cum_distr_init(unsigned int N);
+
+int cum_distr_add(cum_distr_t *d, unsigned int id, long double val);
+
+unsigned int cum_distr_sample(cum_distr_t *d);
+
+void cum_distr_dump(cum_distr_t *d);
+
+
+void cum_distr_destroy(cum_distr_t *d);
+
+
+#endif //__CUM_DISTR_H__
diff --git a/src/include/dset.h b/src/include/dset.h
new file mode 100644
index 0000000..0a072e5
--- /dev/null
+++ b/src/include/dset.h
@@ -0,0 +1,65 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ */
+
+#ifndef __DSET_H__
+#define __DSET_H__
+
+
+typedef struct dset{
+ int rank;
+ struct dset *parent;
+ int id;
+} dset_elem_t;
+
+typedef dset_elem_t* dset_t;
+
+void dset_makeset(dset_t *ds);
+
+void dset_destroy(dset_t ds);
+
+dset_t dset_find(dset_t ds);
+
+void dset_union(dset_t s1, dset_t s2);
+
+void dset_union_opt(dset_t d1, dset_t s2);
+
+dset_t dset_find_opt(dset_t ds);
+
+void dset_makeset_id(dset_t *ds, int id);
+
+int dset_find_id(dset_t ds);
+
+int dset_find_id_opt(dset_t ds);
+
+
+
+#endif /* __DSET_H__ */
diff --git a/src/include/gen_heap.h b/src/include/gen_heap.h
new file mode 100644
index 0000000..0d434bc
--- /dev/null
+++ b/src/include/gen_heap.h
@@ -0,0 +1,84 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ */
+
+
+#ifndef __GEN_HEAP__
+#define __GEN_HEAP__
+
+
+#define MAX_HEAP 0x01
+#define MIN_HEAP 0x02
+
+#define SORT_ASC 0x04
+#define SORT_DESC 0x08
+
+#define ERR_DELETE -0x04
+
+typedef struct{
+ int (*compare)(const void *e1, const void *e2);
+ void* (*alloc_vector)(unsigned int N);
+ void (*dealloc_vector)(void *v);
+ void (*dealloc_elem)(void *e);
+ void (*print_elem)(void *e);
+} gen_heap_func_t;
+
+
+typedef struct{
+ int N;
+ int last;
+ void **v;
+ gen_heap_func_t funs;
+ char htype;
+} gen_heap_t;
+
+
+#define PARENT(i) (int)(floor((i-1)/2))
+
+gen_heap_t * gen_heap_init(unsigned int N, char htype, gen_heap_func_t *funs);
+
+void gen_heap_insert(gen_heap_t *h, void *elem);
+
+int gen_heap_delete(gen_heap_t *h, void **val);
+
+void* gen_heap_peek(gen_heap_t *h);
+
+gen_heap_t* gen_heap_from_array(void **v, unsigned int N, unsigned int last, char htype,
+ gen_heap_func_t *funs);
+
+void gen_heap_dump(gen_heap_t *h);
+
+void gen_heap_destroy(gen_heap_t *h);
+
+int gen_heap_sort(void *v, unsigned int N, size_t size,
+ char dir, int (*compar)(const void*, const void*));
+
+#endif // __GEN_HEAP__
diff --git a/src/include/gen_pqueue.h b/src/include/gen_pqueue.h
new file mode 100644
index 0000000..4dec23b
--- /dev/null
+++ b/src/include/gen_pqueue.h
@@ -0,0 +1,108 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ */
+
+
+#ifndef __GEN_PQUEUE_H__
+#define __GEN_PQUEUE_H__
+
+#include "gen_heap.h"
+
+#define KEY_ERROR -1
+#define ID_ERROR -2
+
+/*
+ *
+ * This implementation of the priority queue is based on gen_heap, but
+ * requires some additional code to work, since we need to maintain an
+ * array of "handles", i.e. a mapping between elements and their
+ * current positions in the heap
+ *
+ */
+
+typedef struct{
+ int (*compare)(const void *e1, const void *e2); /* compare two elements (standard comparator) */
+ void* (*alloc_vector)(unsigned int N); /* */
+ void (*dealloc_vector)(void *v); /* */
+ void (*dealloc_elem)(void *e); /* deallocate an element */
+ void (*print_elem)(void *e); /* print an element */
+ int (*get_id)(void *e); /* get the id associated to an element
+ (used for handles management) */
+ void* (*get_key)(void *e);/* get the current key of element e */
+ void (*set_key)(void *e, void *k); /* set a new key to element e */
+ int (*compare_to_key)(void *e, void *key); /* compare a key with the one of element e */
+} gen_pqueue_func_t;
+
+
+
+typedef struct{
+ int N;
+ int last;
+ void **v;
+ gen_pqueue_func_t funs;
+ char qtype;
+ int *handles;
+} gen_pqueue_t;
+
+
+
+#define MIN_QUEUE 0x01
+#define MAX_QUEUE 0x02
+
+
+
+gen_pqueue_t * gen_pqueue_init(unsigned int N, char htype, gen_pqueue_func_t *funs);
+
+void gen_pqueue_insert(gen_pqueue_t *h, void *elem);
+
+int gen_pqueue_delete(gen_pqueue_t *h, void **val);
+
+void* gen_pqueue_peek(gen_pqueue_t *h);
+
+gen_pqueue_t* gen_pqueue_from_array(void **v, unsigned int N, unsigned int last, char htype,
+ gen_pqueue_func_t *funs);
+
+int gen_pqueue_change_key(gen_pqueue_t *q, unsigned int i, void *key);
+
+int gen_pqueue_force_key(gen_pqueue_t *q, unsigned int idx, void *key);
+
+void gen_pqueue_dump(gen_pqueue_t *h);
+
+void gen_pqueue_destroy(gen_pqueue_t *h);
+
+int gen_pqueue_get_handle(gen_pqueue_t *q, int id);
+
+void* gen_pqueue_get_key(gen_pqueue_t *q, int idx);
+
+
+
+
+#endif // __GEN_PQUEUE_H__
diff --git a/src/include/gen_stack.h b/src/include/gen_stack.h
new file mode 100644
index 0000000..2dc46c5
--- /dev/null
+++ b/src/include/gen_stack.h
@@ -0,0 +1,54 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN:
+ *
+ ***********************************************************************
+ */
+
+#ifndef __GEN_STACK_H__
+#define __GEN_STACK_H__
+
+typedef struct{
+ unsigned int size;
+ int head;
+ void **v;
+} gen_stack_t;
+
+
+void gen_stack_create(gen_stack_t *s);
+
+void gen_stack_push(gen_stack_t *s, void *elem);
+
+int gen_stack_pop(gen_stack_t *s, void **res);
+
+int gen_stack_empty(gen_stack_t *s);
+
+int gen_stack_size(gen_stack_t *s);
+
+
+#endif //__GEN_STACK_H__
diff --git a/src/include/iltree.h b/src/include/iltree.h
new file mode 100644
index 0000000..d30dc83
--- /dev/null
+++ b/src/include/iltree.h
@@ -0,0 +1,93 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ */
+
+#ifndef __ILTREE_H__
+#define __ILTREE_H__
+
+
+typedef struct node{
+ void* info;
+ struct node* left;
+ struct node* right;
+} node_t;
+
+typedef struct{
+ void* (*alloc)();
+ void (*dealloc)(void*);
+ void (*copy)(void *src, void *dst);
+ int (*compare)(void*, void*);
+ void (*print)(void*, void*);
+ void *fileout;
+} ilfunc_t;
+
+
+typedef struct {
+ node_t* root;
+ ilfunc_t funs;
+} iltree_struct_t;
+
+
+
+typedef iltree_struct_t* iltree_t;
+
+
+void iltree_set_funs(iltree_t, ilfunc_t *);
+
+void iltree_destroy(iltree_t);
+
+void iltree_empty(iltree_t);
+
+void iltree_insert(iltree_t, void*);
+
+void* iltree_lookup(iltree_t, void*);
+
+void iltree_view_pre(iltree_t);
+
+iltree_t iltree_create(iltree_t);
+
+void iltree_empty_cache(iltree_t);
+
+void iltree_map(iltree_t, void (*func)(void*));
+
+void iltree_map_args(iltree_t, void (*func)(void*, void*), void*);
+
+void* iltree_get_fileout(iltree_t t);
+
+void iltree_set_fileout(iltree_t t, void *f);
+
+void* iltree_getmin(iltree_t t);
+
+void* iltree_getmax(iltree_t t);
+
+
+
+#endif /* __ILTREE_H__*/
diff --git a/src/include/iltree_double.h b/src/include/iltree_double.h
new file mode 100644
index 0000000..f294aae
--- /dev/null
+++ b/src/include/iltree_double.h
@@ -0,0 +1,62 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Implementation of the iltree data structure with keys of type
+ * "long double"
+ *
+ */
+
+#ifndef __ILTREE_DOUBLE_H__
+#define __ILTREE_DOUBLE_H__
+
+
+
+#include "iltree.h"
+
+iltree_t iltree_double_init(iltree_t t, void *fileout);
+
+
+void* alloc_double();
+
+void dealloc_double(void *elem);
+
+void copy_double(void *elem1, void *elem2);
+
+int compare_long_double(void *elem1, void *elem2);
+
+void print_long_double(void *elem, void *fileout);
+
+
+
+void iltree_double_dump_edges(iltree_t t);
+
+
+#endif // __ILTREE_DOUBLE_H__
diff --git a/src/include/utils.h b/src/include/utils.h
new file mode 100644
index 0000000..599a287
--- /dev/null
+++ b/src/include/utils.h
@@ -0,0 +1,138 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ */
+
+#ifndef __UTILS_H__
+#define __UTILS_H__
+
+#define VALID_PTR_OR_EXIT(ptr, status) \
+ if (!ptr){\
+ fprintf(stderr, "Error in %s at line %d -- Exiting!!!\n", \
+ __FILE__, __LINE__);\
+ exit(status);\
+ }
+
+
+int read_deg_distr(FILE *filein, unsigned int **degs, unsigned int **Nk, double **p);
+
+int read_deg_seq(FILE *filein, unsigned int **nodes);
+
+int read_stubs(FILE *filein, unsigned int **S);
+
+int read_ij(FILE *filein, unsigned int **i, unsigned int **j);
+
+int read_ij_w(FILE *filein, unsigned int **i, unsigned int **j, double **w);
+
+void read_slap(FILE *filein, unsigned int *K, unsigned int *N,
+ unsigned int **J_slap, unsigned int **r_slap);
+
+void read_slap_w(FILE *filein, unsigned int *K, unsigned int *N,
+ unsigned int **J_slap, unsigned int **r_slap, double **W_slap);
+
+void read_slap_dir(FILE *filein, unsigned int *K, unsigned int *N,
+ unsigned int **J_slap, unsigned int **r_slap);
+
+void read_slap_dir_incoming(FILE *filein, unsigned int *K, unsigned int *N,
+ unsigned int **J_slap, unsigned int **r_slap);
+
+
+int convert_ij2slap(unsigned int *I, unsigned int *J, unsigned int K,
+ unsigned int ** r_slap, unsigned int **J_slap);
+
+int convert_ij2slap_N(unsigned int *I, unsigned int *J, unsigned int K,
+ unsigned int N, unsigned int ** r_slap,
+ unsigned int **J_slap);
+
+int convert_ij2slap_w(unsigned int *I, unsigned int *J, double *W, unsigned int K,
+ unsigned int ** r_slap, unsigned int **J_slap,
+ double **W_slap);
+
+
+void write_edges(FILE *fileout, unsigned int *J_slap,
+ unsigned int *r_slap, unsigned int N);
+
+void write_edges_dir(FILE *fileout, unsigned int *J_slap,
+ unsigned int *r_slap, unsigned int N);
+
+
+void dump_deg_distr(unsigned int *degs, double *p, int n);
+
+void dump_deg_seq(unsigned int *nodes, int N);
+
+
+FILE* openfile_or_exit(char *filename, char *mode, int exitcode);
+
+int compare_int(const void *x1, const void *x2);
+
+int compare_double(const void *x1, const void *x2);
+
+void print_int(void *elem);
+
+void print_double(void *elem);
+
+unsigned int find_max(unsigned int *, unsigned int);
+
+int is_neigh(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ unsigned int i, unsigned int j);
+
+int is_neigh_bs(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ unsigned int i, unsigned int j);
+
+double get_neigh_weight(unsigned int *J_slap, unsigned int *r_slap, double *W_slap,
+ unsigned int N, unsigned int i, unsigned int j);
+
+/* sort the adjacency list of neighbours of each node in ascending order */
+void sort_neighbours(unsigned int *J_slap, unsigned int *r_slap, unsigned int N);
+
+double strength(unsigned int *r_slap, double *W_slap, int i);
+
+void convert_slap2ij(unsigned int *J_slap, unsigned int *r_slap, int N, unsigned int *I, unsigned int *J);
+
+/* Show a simple progress message */
+void show_progress(FILE *fout, char *s, unsigned int progress, unsigned int total);
+
+
+/* find the position of a neghbour of i (node j) in J_slap */
+int find_neigh_in_Jslap(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ unsigned int i, unsigned int j, unsigned int *ret);
+
+
+/* shuffle a vector of integers in-place */
+void shuffle_vector(unsigned int *v, unsigned int N);
+
+
+unsigned int read_partition(FILE *fin, unsigned int N, unsigned int *part);
+
+int degree (unsigned int *r_slap, unsigned int i);
+
+int my_strcasecmp(const char *s1, const char *s2);
+
+#endif /*__UTILS_H__*/
diff --git a/src/johnson/Makefile.am b/src/johnson/Makefile.am
new file mode 100644
index 0000000..01b8c7a
--- /dev/null
+++ b/src/johnson/Makefile.am
@@ -0,0 +1,6 @@
+include ../common.mk
+bin_PROGRAMS = johnson_cycles
+johnson_cycles_SOURCES = johnson_cycles.c stack.c stack.h \
+../utils/utils.c ../include/utils.h
+johnson_cycles_LDADD = -lm
+
diff --git a/src/johnson/Makefile.in b/src/johnson/Makefile.in
new file mode 100644
index 0000000..9f29478
--- /dev/null
+++ b/src/johnson/Makefile.in
@@ -0,0 +1,582 @@
+# 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 = :
+bin_PROGRAMS = johnson_cycles$(EXEEXT)
+subdir = src/johnson
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_johnson_cycles_OBJECTS = johnson_cycles.$(OBJEXT) stack.$(OBJEXT) \
+ ../utils/utils.$(OBJEXT)
+johnson_cycles_OBJECTS = $(am_johnson_cycles_OBJECTS)
+johnson_cycles_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(johnson_cycles_SOURCES)
+DIST_SOURCES = $(johnson_cycles_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+johnson_cycles_SOURCES = johnson_cycles.c stack.c stack.h \
+../utils/utils.c ../include/utils.h
+
+johnson_cycles_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/johnson/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/johnson/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+johnson_cycles$(EXEEXT): $(johnson_cycles_OBJECTS) $(johnson_cycles_DEPENDENCIES) $(EXTRA_johnson_cycles_DEPENDENCIES)
+ @rm -f johnson_cycles$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(johnson_cycles_OBJECTS) $(johnson_cycles_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/johnson_cycles.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/johnson/johnson_cycles.c b/src/johnson/johnson_cycles.c
new file mode 100644
index 0000000..5135b20
--- /dev/null
+++ b/src/johnson/johnson_cycles.c
@@ -0,0 +1,328 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Compute all the simple cycles of an undirected graph provided as
+ * input (optionally, only up to a certain length) using the Johnson
+ * algorithm.
+ *
+ * References:
+ *
+ * [1] D. B. Johnson. "Finding All the Elementary Circuits of a
+ * Directed Graph". SIAM J. Comput. 4 (1975), 77-84.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "utils.h"
+#include "stack.h"
+
+
+#define FALSE 0
+#define TRUE 1
+
+
+void usage(char *argv[]){
+
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- johnson_cycles -*- **\n"
+ "** **\n"
+ "** Enumerates all the elementary cycles of a graph on input. **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the edge list **\n"
+ "** from standard input (STDIN). **\n"
+ "** **\n"
+ "** If 'max_length' is provided, ignore all cycles whose length **\n"
+ "** is larger than 'max_length' **\n"
+ "** **\n"
+ "** The program prints on output a row for each cycle length, **\n"
+ "** in the format: **\n"
+ "** **\n"
+ "** 2 N_2 **\n"
+ "** 3 N_3 **\n"
+ "** 4 N_4 **\n"
+ "** 5 N_5 **\n"
+ "** .... **\n"
+ "** **\n"
+ "** where 2, 3, 4, 5, ... is the length of the cycle, and N_2, **\n"
+ "** N_3, N_4, N_5, ... is the number of cycles of that length. **\n"
+ "** Notice that in undirected graphs each cycle is reported **\n"
+ "** (and counted) twice, once for each possible direction in **\n"
+ "** which the cycle can be traversed. **\n"
+ "** **\n"
+ "** If the third parameter is equal to 'SHOW', the program will **\n"
+ "** dump all the found cycles on STDERR, using the format: **\n"
+ "** **\n"
+ "** N_(l-1) N_(l-2)... N_0 **\n"
+ "** **\n"
+ "** where N_(l-i) is the i-th node in the cycle starting at node **\n"
+ "** N_0. Notice that according to this notation we report only **\n"
+ "** 'l' nodes belonging to the cycle, in reversed traversal **\n"
+ "** order, avoiding to report the starting node (N_0) twice. **\n"
+ "** **\n"
+ "** The program shows also cycles of length '2', that in **\n"
+ "** undirected graphs correspond to the degenerate cycle obtained **\n"
+ "** by traversing the same edge in the two directions. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in> [<max_length> [SHOW]]\n", argv[0]);
+
+}
+
+
+typedef struct{
+ unsigned int num;
+ double *c;
+} count_t;
+
+
+/**
+ *
+ * This structure contains all the information needed by the algorithm
+ * to run:
+ *
+ * - N is the number of nodes
+ *
+ * - K is twice the number of edges
+ *
+ * - J_slap and r_slap are the usual SLAP representation of the
+ * adjacency matrix
+ *
+ * - B_len is an array with the length of the set B(u) for each node u
+ *
+ * - B is a vector of character of the same size of J_slap, which
+ * stores the values of the indicator vector B(u) for each node u
+ *
+ * - blocked is an indicator vector of size N
+ *
+ * - v is the stack of nodes
+ *
+ * - stats maintains the counts for all the cycle lengths
+ *
+ */
+typedef struct{
+ unsigned int N;
+ unsigned int K;
+ unsigned int *J_slap;
+ unsigned int *r_slap;
+ my_stack_t *stack;
+ int max_depth;
+ count_t stats;
+ unsigned int *B_len;
+ unsigned int *B;
+ char *blocked;
+ char show;
+} algo_info_t;
+
+
+
+
+void unblock(algo_info_t *info, unsigned int u){
+
+ unsigned int w, idx;
+
+ info->blocked[u] = FALSE;
+
+ while(info->B_len[u] >0){
+ info->B_len[u] -= 1;
+ idx = info->r_slap[u] + info->B_len[u];
+ w = info->B[idx];
+ if (info->blocked[w] == TRUE){
+ unblock(info, w);
+ }
+ }
+}
+
+
+
+
+/* add v to B(w) */
+void set_B(algo_info_t *info, unsigned int v, unsigned int w){
+
+ unsigned int idx, i;
+
+ idx = info->r_slap[w];
+
+
+ for(i=0; i <info->B_len[w]; i ++){
+ if (info->B[idx + i] == v)
+ return;
+ }
+ info->B[idx + info->B_len[w]] = v;
+ info->B_len[w] += 1;
+
+}
+
+char circuit(algo_info_t *info, unsigned int s, unsigned int v){
+
+ unsigned int i, w;
+ char f = FALSE;
+
+ if (v < s)
+ return FALSE;
+
+ /* check if maximum depth has been reached */
+ if(stack_size(info->stack) == info->max_depth){
+ return TRUE;
+ }
+
+ stack_push(info->stack, v);
+
+ info->blocked[v] = TRUE;
+ for(i=info->r_slap[v]; i< info->r_slap[v+1]; i++){
+ w = info->J_slap[i];
+ if (w == s){
+ /* output a cycle here */
+ if (info->show)
+ stack_dump(info->stack, stderr);
+ info->stats.c[stack_size(info->stack)] += 1;
+ f = TRUE;
+ }
+ if (w < s)
+ continue; /* We only consider nodes with higher IDs */
+ else
+ if (! (info->blocked[w])){
+ if (circuit(info, s, w) == TRUE)
+ f = TRUE;
+ }
+ }
+ if (f == TRUE) {
+ unblock(info, v);
+ }
+ else{
+ for(i=info->r_slap[v]; i < info->r_slap[v+1]; i++){
+ w = info->J_slap[i];
+ if (w > s)
+ set_B(info, v, w); /* add v to B(w) only if v is not already in B(w) */
+ }
+ }
+ stack_pop(info->stack, &w);
+ return f;
+}
+
+
+void johnson_cycles(algo_info_t *info){
+
+ unsigned int i, N;
+
+ N = info->N;
+
+
+ for(i=0; i<N; i++){
+ /* clear the vector of blocked nodes */
+ memset(info->blocked, 0, N * sizeof(char));
+
+ /* clear the indicator vector B */
+
+ /* we reset the length of each set B*/
+ memset(info->B_len, 0, N * sizeof(unsigned int));
+ circuit(info, i, i);
+ }
+
+
+}
+
+
+int main(int argc, char *argv[]){
+
+ algo_info_t info;
+ FILE *filein;
+ unsigned int i;
+
+ if (argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+ info.J_slap = NULL;
+ info.r_slap = NULL;
+
+
+ if(!strcmp(argv[1], "-")){
+ filein = stdin;
+ }
+ else{
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ read_slap(filein, &(info.K), &(info.N), &(info.J_slap), &(info.r_slap));
+
+ fclose(filein);
+
+ info.B = malloc(info.r_slap[info.N] * sizeof(unsigned int)); /* This is the indicator vector B(u) */
+ info.B_len = malloc(info.N * sizeof(unsigned int)); /* lengths of the B(u) */
+ info.blocked = malloc(info.N * sizeof(char)); /* This is the indicator vector
+ of blocked nodes */
+
+ info.stack = malloc(sizeof(my_stack_t));
+ stack_create(info.stack);
+
+ info.show = FALSE;
+ if (argc > 2){
+ info.max_depth = atoi(argv[2]);
+ if (argc > 3){
+ if (!my_strcasecmp(argv[3], "show")){
+ info.show = TRUE;
+ }
+ }
+ }
+ else{
+ info.max_depth = info.N;
+ }
+
+ /* Here we initialise the counters */
+ info.stats.num = info.max_depth + 1;
+ info.stats.c = malloc(info.stats.num * sizeof(double));
+ /* Here we set the counters to zero */
+ memset(info.stats.c, 0, info.stats.num * sizeof(double));
+ johnson_cycles(&info);
+
+ for(i=2; i<info.stats.num ; i ++){
+ printf("%d %1.20g\n", i, info.stats.c[i]);
+ }
+ free(info.B);
+ free(info.B_len);
+ free(info.blocked);
+ free(info.stack->v);
+ free(info.stack);
+ free(info.stats.c);
+ free(info.r_slap);
+ free(info.J_slap);
+}
diff --git a/src/johnson/stack.c b/src/johnson/stack.c
new file mode 100644
index 0000000..daee722
--- /dev/null
+++ b/src/johnson/stack.c
@@ -0,0 +1,96 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Implementation of a stack data structure (for unsigned integers)
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "stack.h"
+
+void stack_create(my_stack_t *s){
+
+ s->size = 10;
+ s->head = -1;
+ s->v = malloc(s->size * sizeof(int));
+
+}
+
+void stack_push(my_stack_t *s, unsigned int n){
+
+ if (s->head == s->size - 1){
+ s->size += 10;
+ s->v = realloc(s->v, s->size * sizeof(unsigned int));
+ if (!s->v){
+ fprintf(stderr, "Unable to allocate more memory in stack.c:stack_push... Exiting!\n");
+ exit(17);
+ }
+ }
+
+ s->head++;
+ s->v[s->head] = n;
+}
+
+int stack_pop(my_stack_t *s, unsigned int *res){
+
+ if (!stack_empty(s)){
+ *res = s->v[s->head];
+ s->head--;
+ return 0;
+ }
+ else{
+ return -1;
+ }
+
+}
+
+int stack_empty(my_stack_t *s){
+
+ return (s->head < 0 ? 1 : 0);
+}
+
+
+void stack_dump(my_stack_t *s, FILE *fileout){
+
+ int i;
+
+ for(i=s->head; i>=0; i--){
+ fprintf(fileout, "%d ", s->v[i]);
+ }
+ fprintf(fileout, "\n");
+}
+
+
+int stack_size(my_stack_t *s){
+ return s->head + 1;
+}
diff --git a/src/johnson/stack.h b/src/johnson/stack.h
new file mode 100644
index 0000000..cc05cea
--- /dev/null
+++ b/src/johnson/stack.h
@@ -0,0 +1,59 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Implementation of a stack data structure (for unsigned integers)
+ *
+ */
+
+#ifndef __MY_STACK_H__
+#define __MY_STACK_H__
+
+typedef struct{
+ unsigned int size;
+ int head;
+ unsigned int *v;
+} my_stack_t;
+
+
+void stack_create(my_stack_t *s);
+
+void stack_push(my_stack_t *s, unsigned int n);
+
+int stack_pop(my_stack_t *s, unsigned int *res);
+
+int stack_empty(my_stack_t *s);
+
+void stack_dump(my_stack_t *s, FILE *f);
+
+int stack_size(my_stack_t *s);
+
+
+#endif //__MY_STACK_H__
diff --git a/src/knn/Makefile.am b/src/knn/Makefile.am
new file mode 100644
index 0000000..e9059ad
--- /dev/null
+++ b/src/knn/Makefile.am
@@ -0,0 +1,11 @@
+include ../common.mk
+bin_PROGRAMS = knn knn_w
+knn_SOURCES = knn.c knntree.c knntree.h \
+../utils/utils.c ../utils/iltree.c \
+../include/utils.h ../include/iltree.h
+knn_LDADD = -lm
+knn_w_SOURCES = knn_w.c knntree.c knntree.h \
+../utils/utils.c ../utils/iltree.c \
+../include/utils.h ../include/iltree.h
+knn_w_LDADD = -lm
+
diff --git a/src/knn/Makefile.in b/src/knn/Makefile.in
new file mode 100644
index 0000000..baefe62
--- /dev/null
+++ b/src/knn/Makefile.in
@@ -0,0 +1,600 @@
+# 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 = :
+bin_PROGRAMS = knn$(EXEEXT) knn_w$(EXEEXT)
+subdir = src/knn
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_knn_OBJECTS = knn.$(OBJEXT) knntree.$(OBJEXT) \
+ ../utils/utils.$(OBJEXT) ../utils/iltree.$(OBJEXT)
+knn_OBJECTS = $(am_knn_OBJECTS)
+knn_DEPENDENCIES =
+am_knn_w_OBJECTS = knn_w.$(OBJEXT) knntree.$(OBJEXT) \
+ ../utils/utils.$(OBJEXT) ../utils/iltree.$(OBJEXT)
+knn_w_OBJECTS = $(am_knn_w_OBJECTS)
+knn_w_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(knn_SOURCES) $(knn_w_SOURCES)
+DIST_SOURCES = $(knn_SOURCES) $(knn_w_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+knn_SOURCES = knn.c knntree.c knntree.h \
+../utils/utils.c ../utils/iltree.c \
+../include/utils.h ../include/iltree.h
+
+knn_LDADD = -lm
+knn_w_SOURCES = knn_w.c knntree.c knntree.h \
+../utils/utils.c ../utils/iltree.c \
+../include/utils.h ../include/iltree.h
+
+knn_w_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/knn/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/knn/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/iltree.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+knn$(EXEEXT): $(knn_OBJECTS) $(knn_DEPENDENCIES) $(EXTRA_knn_DEPENDENCIES)
+ @rm -f knn$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(knn_OBJECTS) $(knn_LDADD) $(LIBS)
+
+knn_w$(EXEEXT): $(knn_w_OBJECTS) $(knn_w_DEPENDENCIES) $(EXTRA_knn_w_DEPENDENCIES)
+ @rm -f knn_w$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(knn_w_OBJECTS) $(knn_w_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/iltree.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/knn.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/knn_w.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/knntree.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/knn/knn.c b/src/knn/knn.c
new file mode 100644
index 0000000..a79486f
--- /dev/null
+++ b/src/knn/knn.c
@@ -0,0 +1,349 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Compute knn(k) for a given unweighted graph. If requested, the
+ * average is computed for ranges of degrees falling into a number of
+ * equal bins or into bins or exponentially increasing width.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+#include "utils.h"
+#include "knntree.h"
+
+#define NO_BIN 0x01
+#define BIN_LIN 0x02
+#define BIN_EXP 0x04
+
+void usage(char *argv[]){
+
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- knn -*- **\n"
+ "** **\n"
+ "** Compute the average nearest-neighbour degree function knn(k) **\n"
+ "** of the unweighted graph provided as input. **\n"
+ "** **\n"
+ "** The input file 'graph_in' is an edge-list: **\n"
+ "** **\n"
+ "** I_1 J_1 **\n"
+ "** I_2 J_2 **\n"
+ "** I_3 J_3 **\n"
+ "** ... ... **\n"
+ "** I_K J_K **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the file from **\n"
+ "** the standard input (STDIN). **\n"
+ "** **\n"
+ "** If no second parameter is given (or the second parameter **\n"
+ "** is equal to 'NO'), the program prints on output the value **\n"
+ "** of knn(k) for each degree in the graph, in the format: **\n"
+ "** **\n"
+ "** k1 knn(k1) **\n"
+ "** k2 knn(k2) **\n"
+ "** ..... **\n"
+ "** **\n"
+ "** If the second parameter is 'LIN', the values of knn(k) **\n"
+ "** will be grouped into 'bin_param' equal bins. **\n"
+ "** **\n"
+ "** If the second parameter is 'EXP;, the values of knn(k) **\n"
+ "** will be grouped into bins whose width increases **\n"
+ "** exponentially with exponent 'bin_param' (also known as **\n"
+ "** 'logarithmic binning'). **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in> [<NO|LIN|EXP> <bin_param>]\n", argv[0]);
+}
+
+
+
+typedef struct{
+ unsigned int num_bins;
+ unsigned int *degs;
+ unsigned int *num;
+ double *values;
+} knn_hist_t;
+
+
+/* compute the sum of the degrees of the neighbours of the node with
+ label 'idx' */
+double neigh_degs_sum(unsigned int *J_slap, unsigned int *r_slap, unsigned int idx){
+
+ double sum = 0;
+ unsigned j, k;
+
+ for(j=r_slap[idx]; j < r_slap[idx+1]; j++){
+ k = J_slap[j];
+ sum += r_slap[k+1] - r_slap[k];
+ }
+ return sum;
+}
+
+/* compute knn(k) for each degree k */
+void compute_knn(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ knntree_t t){
+
+ knnsum_t elem, *ptr;
+ unsigned int i;
+
+ for(i=0; i<N; i++){
+ elem.k = r_slap[i+1] - r_slap[i];
+ elem.knnsum = neigh_degs_sum(J_slap, r_slap, i);
+ ptr = iltree_lookup(t, &elem);
+ if (!ptr){
+ elem.Nk = 1;
+ iltree_insert(t, &elem);
+ }
+ else{
+ ptr->Nk +=1;
+ ptr->knnsum += elem.knnsum;
+ }
+ }
+}
+
+/* aggregate all the values of knn(k) for the degrees falling in a
+ certain bin */
+void aggregate_knn(void *elem, void *h){
+
+ knn_hist_t *hist;
+ knnsum_t *s;
+ unsigned int cur, low, high;
+
+ hist = (knn_hist_t*)h;
+ s = (knnsum_t*)elem;
+
+
+ cur = hist->num_bins / 2;
+
+ low = 0;
+ high = hist->num_bins - 1;
+
+ while (low < high){
+ if (hist->degs[cur] < s->k){
+ low = cur+1;
+ }
+ else if(hist->degs[cur] >= s->k){
+ high = cur;
+ }
+ cur = (high + low) / 2;
+ }
+
+ hist->num[cur] += s->Nk * s->k;
+ hist->values[cur] += s->knnsum;
+}
+
+
+/* print knn(k) for each value of k in the graph (i.e., without any
+ binning) */
+void print_knn_nobin(knntree_t t){
+
+ iltree_view_pre(t);
+}
+
+
+
+/* print the values of knn(k) averaging over num_bins of equal size */
+void print_knn_lin(knntree_t t, unsigned int num_bins){
+
+ unsigned int kmin, kmax, step, i;
+ knn_hist_t hist;
+
+ if (!t){
+ return;
+ }
+
+
+ kmin = ((knnsum_t*)iltree_getmin(t))->k;
+ kmax = ((knnsum_t*)iltree_getmax(t))->k;
+
+ hist.num_bins = num_bins;
+
+ step = (kmax - kmin)/num_bins + 1;
+
+ hist.degs = malloc(num_bins * sizeof(unsigned int));
+ hist.num = malloc(num_bins * sizeof(unsigned int));
+ hist.values = malloc(num_bins * sizeof(double));
+
+
+ hist.degs[0] = kmin + step;
+ hist.values[0] = 0;
+ hist.num[0] = 0;
+
+ for(i=1; i<num_bins; i++){
+ hist.degs[i] = hist.degs[i-1] + step;
+ hist.values[i] = 0;
+ hist.num[i] = 0;
+ }
+
+ iltree_map_args(t, aggregate_knn, &hist);
+
+ for(i=0; i<hist.num_bins; i++){
+ if (hist.num[i])
+ printf("%d %2.8g\n", hist.degs[i], hist.values[i] / hist.num[i] );
+ }
+
+ free(hist.degs);
+ free(hist.num);
+ free(hist.values);
+
+}
+
+
+/* print knn(k) using exponential (a.k.a. logarithmic) binning */
+
+void print_knn_exp(knntree_t t, double alpha){
+
+ unsigned int kmin, kmax, i;
+ double width;
+ knn_hist_t hist;
+
+ if (!t){
+ return;
+ }
+
+
+ kmin = ((knnsum_t*)iltree_getmin(t))->k;
+ kmax = ((knnsum_t*)iltree_getmax(t))->k;
+
+
+ hist.num_bins = (int)ceil(log(kmax)/log(alpha)) + 1;
+
+
+ hist.degs = malloc(hist.num_bins * sizeof(unsigned int));
+ hist.num = malloc(hist.num_bins * sizeof(unsigned int));
+ hist.values = malloc(hist.num_bins * sizeof(double));
+
+ width = 2;
+
+ hist.degs[0] = kmin + width;
+ hist.values[0] = 0;
+ hist.num[0] = 0;
+
+ for(i=1; i<hist.num_bins; i++){
+ hist.values[i] = 0;
+ hist.num[i] = 0;
+ width *= alpha;
+ hist.degs[i] = (int)ceil(hist.degs[i-1] + width);
+ }
+
+ iltree_map_args(t, aggregate_knn, &hist);
+
+ for(i=0; i<hist.num_bins; i++){
+ if(hist.num[i])
+ printf("%d %2.8g\n", hist.degs[i], hist.values[i] / hist.num[i] );
+ }
+
+ free(hist.degs);
+ free(hist.num);
+ free(hist.values);
+
+}
+
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int N, K;
+ unsigned int *J_slap=NULL, *r_slap=NULL;
+ FILE *filein;
+ char bin_type;
+ unsigned int num_bins;
+ double alpha;
+ knntree_t t = NULL;
+
+
+
+ if(argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+ if(!strcmp(argv[1], "-")){
+ filein = stdin;
+ }
+ else{
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ t = iltree_create(t);
+
+ bin_type = NO_BIN;
+ if (argc > 2){ /* the user has specified a binning type */
+ if (!my_strcasecmp(argv[2], "lin")){
+ bin_type = BIN_LIN;
+ if(argc < 4){
+ fprintf(stderr, "you must provide a number of bins for linear binning\n");
+ exit(3);
+ }
+ num_bins = atoi(argv[3]);
+ }
+ else if (!my_strcasecmp(argv[2], "exp")){
+ bin_type = BIN_EXP;
+ if(argc < 4){
+ fprintf(stderr, "you must provide an exponent for exponential binning\n");
+ exit(4);
+ }
+ alpha = atof(argv[3]);
+ }
+ }
+
+ read_slap(filein, &K, &N, &J_slap, &r_slap);
+ fclose(filein);
+
+ t = knntree_init(t, stdout);
+ compute_knn(J_slap, r_slap, N, t);
+
+
+ switch(bin_type){
+ case BIN_LIN:
+ print_knn_lin(t, num_bins);
+ break;
+ case BIN_EXP:
+ print_knn_exp(t, alpha);
+ break;
+ default:
+ print_knn_nobin(t);
+ break;
+ }
+ iltree_destroy(t);
+ free(J_slap);
+ free(r_slap);
+}
diff --git a/src/knn/knn_w.c b/src/knn/knn_w.c
new file mode 100644
index 0000000..53c2671
--- /dev/null
+++ b/src/knn/knn_w.c
@@ -0,0 +1,355 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Compute knn(k) for a given weighted graph. If requested, the
+ * average is computed for ranges of degrees falling into bins of
+ * exponentially increasing width.
+ *
+ * References:
+ *
+ * [1] A. Barrat et al. "The architecture of complex weighted
+ * networks". P. Natl. Acad. Sci USA 101 (2004), 3747-3752.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+#include "utils.h"
+#include "knntree.h"
+
+#define NO_BIN 0x01
+#define BIN_LIN 0x02
+#define BIN_EXP 0x04
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- knn_w -*- **\n"
+ "** **\n"
+ "** Compute the average nearest-neighbour degree function knn(k) **\n"
+ "** of the weighted graph provided as input. **\n"
+ "** **\n"
+ "** The input file 'graph_in' is an edge-list: **\n"
+ "** **\n"
+ "** I_1 J_1 W_1 **\n"
+ "** I_2 J_2 W_2 **\n"
+ "** I_3 J_3 W_3 **\n"
+ "** ... ... **\n"
+ "** I_K J_K W_K **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the file from **\n"
+ "** the standard input (STDIN). **\n"
+ "** **\n"
+ "** If no second parameter is given (or the second parameter **\n"
+ "** is equal to 'NO'), the program prints on output the value **\n"
+ "** of knn_w(k) for each degree in the graph, in the format: **\n"
+ "** **\n"
+ "** k1 knn_w(k1) **\n"
+ "** k2 knn_w(k2) **\n"
+ "** ..... **\n"
+ "** **\n"
+ "** If the second parameter is 'LIN', the values of knn_w(k) **\n"
+ "** will be grouped into 'bin_param' equal bins. **\n"
+ "** **\n"
+ "** If the second parameter is 'EXP;, the values of knn_w(k) **\n"
+ "** will be grouped into bins whose width increases **\n"
+ "** exponentially with exponent 'bin_param' (also known as **\n"
+ "** 'logarithmic binning'). **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in> [<NO|LIN|EXP> <bin_param>]\n", argv[0]);
+}
+
+
+
+typedef struct{
+ unsigned int num_bins;
+ unsigned int *degs;
+ double *num;
+ double *values;
+} knn_hist_t;
+
+
+double neigh_degs_wsum(unsigned int *J_slap, unsigned int *r_slap, double *W_slap,
+ unsigned int idx){
+
+ double sum = 0;
+ unsigned j, k;
+
+ for(j=r_slap[idx]; j < r_slap[idx+1]; j++){
+ k = J_slap[j];
+ sum += W_slap[j] * (r_slap[k+1] - r_slap[k]);
+ }
+ return sum;
+}
+
+
+
+void compute_knn_w(unsigned int *J_slap, unsigned int *r_slap, double *W_slap,
+ unsigned int N, knntree_t t){
+
+ knnsum_t elem, *ptr;
+ unsigned int i;
+
+ for(i=0; i<N; i++){
+ elem.k = r_slap[i+1] - r_slap[i];
+ elem.knnsum = 1.0 * neigh_degs_wsum(J_slap, r_slap, W_slap, i) / strength(r_slap, W_slap, i);
+ ptr = iltree_lookup(t, &elem);
+ if (!ptr){
+ elem.Nk = 1;
+ iltree_insert(t, &elem);
+ }
+ else{
+ ptr->Nk +=1;
+ ptr->knnsum += elem.knnsum;
+ }
+ }
+}
+
+
+void aggregate_knn(void *elem, void *h){
+
+ knn_hist_t *hist;
+ knnsum_t *s;
+ unsigned int cur, low, high;
+
+ hist = (knn_hist_t*)h;
+ s = (knnsum_t*)elem;
+
+ cur = hist->num_bins / 2;
+
+ low = 0;
+ high = hist->num_bins - 1;
+
+ while (low < high){
+ if (hist->degs[cur] < s->k){
+ low = cur+1;
+ }
+ else if(hist->degs[cur] >= s->k){
+ high = cur;
+ }
+ cur = (high + low) / 2;
+ }
+
+
+ hist->num[cur] += s->Nk;
+ hist->values[cur] += s->knnsum;
+}
+
+
+void print_knn_nobin(knntree_t t){
+
+ iltree_view_pre(t);
+}
+
+
+
+
+void print_knn_lin(knntree_t t, unsigned int num_bins){
+
+ unsigned int kmin, kmax, step, i;
+ knn_hist_t hist;
+
+ if (!t){
+ return;
+ }
+
+
+ kmin = ((knnsum_t*)iltree_getmin(t))->k;
+ kmax = ((knnsum_t*)iltree_getmax(t))->k;
+
+ hist.num_bins = num_bins;
+
+ step = (kmax - kmin)/num_bins + 1;
+
+ hist.degs = malloc(num_bins * sizeof(unsigned int));
+ hist.num = malloc(num_bins * sizeof(double));
+ hist.values = malloc(num_bins * sizeof(double));
+
+
+ hist.degs[0] = kmin + step;
+ hist.values[0] = 0;
+ hist.num[0] = 0;
+
+ for(i=1; i<num_bins; i++){
+ hist.degs[i] = hist.degs[i-1] + step;
+ hist.values[i] = 0;
+ hist.num[i] = 0;
+ }
+
+ iltree_map_args(t, aggregate_knn, &hist);
+
+ for(i=0; i<hist.num_bins; i++){
+ if (hist.num[i])
+ printf("%d %2.8g\n", hist.degs[i], hist.values[i] / hist.num[i] );
+ }
+
+ free(hist.degs);
+ free(hist.num);
+ free(hist.values);
+
+}
+
+
+
+void print_knn_exp(knntree_t t, double alpha){
+
+ unsigned int kmin, kmax, i;
+ double width;
+ knn_hist_t hist;
+
+ if (!t){
+ return;
+ }
+
+
+ kmin = ((knnsum_t*)iltree_getmin(t))->k;
+ kmax = ((knnsum_t*)iltree_getmax(t))->k;
+
+
+ hist.num_bins = (int)ceil(log(kmax)/log(alpha)) + 1;
+
+
+ hist.degs = malloc(hist.num_bins * sizeof(unsigned int));
+ hist.num = malloc(hist.num_bins * sizeof(double));
+ hist.values = malloc(hist.num_bins * sizeof(double));
+
+ width = 2;
+
+ hist.degs[0] = kmin + width;
+ hist.values[0] = 0;
+ hist.num[0] = 0;
+
+ for(i=1; i<hist.num_bins; i++){
+ hist.values[i] = 0;
+ hist.num[i] = 0;
+ width *= alpha;
+ hist.degs[i] = (int)ceil(hist.degs[i-1] + width);
+ }
+
+ iltree_map_args(t, aggregate_knn, &hist);
+
+ for(i=0; i<hist.num_bins; i++){
+ if(hist.num[i])
+ printf("%d %2.8g\n", hist.degs[i], hist.values[i] / hist.num[i] );
+ }
+
+ free(hist.degs);
+ free(hist.num);
+ free(hist.values);
+
+}
+
+
+
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int N, K;
+ unsigned int *J_slap=NULL, *r_slap=NULL;
+ double *W_slap = NULL;
+ FILE *filein;
+ char bin_type;
+ unsigned int num_bins;
+ double alpha;
+ knntree_t t = NULL;
+
+
+
+ if(argc < 2){
+ usage(argv);
+ exit(1);
+ }
+
+ if(!strcmp(argv[1], "-")){
+ filein = stdin;
+ }
+ else{
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ t = iltree_create(t);
+
+ bin_type = NO_BIN;
+ if (argc > 2){ /* the user has specified a binning type */
+ if (!my_strcasecmp(argv[2], "lin")){
+ bin_type = BIN_LIN;
+ if(argc < 4){
+ fprintf(stderr, "you must provide a number of bins for linear binning\n");
+ exit(3);
+ }
+ num_bins = atoi(argv[3]);
+ }
+ else if (!my_strcasecmp(argv[2], "exp")){
+ bin_type = BIN_EXP;
+ if(argc < 4){
+ fprintf(stderr, "you must provide an exponent for exponential binning\n");
+ exit(4);
+ }
+ alpha = atof(argv[3]);
+ }
+ }
+
+ read_slap_w(filein, &K, &N, &J_slap, &r_slap, &W_slap);
+
+ fclose(filein);
+
+ t = knntree_init(t, stdout);
+ compute_knn_w(J_slap, r_slap, W_slap, N, t);
+
+
+ switch(bin_type){
+ case BIN_LIN:
+ print_knn_lin(t, num_bins);
+ break;
+ case BIN_EXP:
+ print_knn_exp(t, alpha);
+ break;
+ default:
+ print_knn_nobin(t);
+ break;
+ }
+ iltree_destroy(t);
+ free(J_slap);
+ free(r_slap);
+ free(W_slap);
+}
+
diff --git a/src/knn/knntree.c b/src/knn/knntree.c
new file mode 100644
index 0000000..edcbfcc
--- /dev/null
+++ b/src/knn/knntree.c
@@ -0,0 +1,95 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Functions needed to manage the BST.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "knntree.h"
+
+
+void* __alloc_knnsum(){
+ knnsum_t *t;
+
+ t = malloc(sizeof(knnsum_t));
+ return t;
+}
+
+void __dealloc_knnsum(void *elem){
+
+ free(elem);
+
+}
+
+void __copy_knnsum(void *elem1, void *elem2){
+ *((knnsum_t*)elem2) = *((knnsum_t*)elem1);
+}
+
+int __compare_knnsum(void *elem1, void *elem2){
+
+ knnsum_t *t1, *t2;
+
+ t1 = (knnsum_t*)elem1;
+ t2 = (knnsum_t*)elem2;
+
+ return (t1->k < t2->k ? -1 : (t1->k > t2->k ? 1 : 0));
+}
+
+void __print_knnsum(void *elem, void *fileout){
+
+ knnsum_t *t;
+
+ t = (knnsum_t*)elem;
+
+ fprintf((FILE*)fileout, "%d %2.8g\n", t->k, t->knnsum / (t->k * t->Nk));
+}
+
+
+knntree_t knntree_init(knntree_t t, void *fileout){
+
+ ilfunc_t funs= {
+ .alloc = __alloc_knnsum,
+ .dealloc = __dealloc_knnsum,
+ .copy = __copy_knnsum,
+ .compare = __compare_knnsum,
+ .print = __print_knnsum,
+ .fileout = fileout
+ };
+
+ t = iltree_create((iltree_t)t);
+ iltree_set_funs((iltree_t)t, &funs);
+ return t;
+}
+
+
diff --git a/src/knn/knntree.h b/src/knn/knntree.h
new file mode 100644
index 0000000..d64417e
--- /dev/null
+++ b/src/knn/knntree.h
@@ -0,0 +1,54 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Functions needed to manage the BST.
+ *
+ */
+
+
+#ifndef __KNNTREE_H__
+#define __KNNTREE_H__
+
+#include "iltree.h"
+
+typedef struct{
+ int k; /* node degree*/
+ int Nk; /* number of nodes with degree k */
+ double knnsum; /* sum of the degrees of the neighbours of all the Nk nodes */
+} knnsum_t;
+
+
+typedef iltree_t knntree_t;
+
+knntree_t knntree_init(knntree_t t, void *fileout);
+
+
+#endif //__KNNTREE_H__
diff --git a/src/kruskal/Makefile.am b/src/kruskal/Makefile.am
new file mode 100644
index 0000000..6db35f0
--- /dev/null
+++ b/src/kruskal/Makefile.am
@@ -0,0 +1,6 @@
+include ../common.mk
+bin_PROGRAMS = kruskal
+kruskal_SOURCES = kruskal.c edge_w_funs.c edge_w_funs.h \
+../utils/utils.c ../utils/dset.c ../utils/gen_heap.c \
+../include/utils.h ../include/dset.h ../include/gen_heap.h
+kruskal_LDADD = -lm
diff --git a/src/kruskal/Makefile.in b/src/kruskal/Makefile.in
new file mode 100644
index 0000000..252117e
--- /dev/null
+++ b/src/kruskal/Makefile.in
@@ -0,0 +1,590 @@
+# 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 = :
+bin_PROGRAMS = kruskal$(EXEEXT)
+subdir = src/kruskal
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_kruskal_OBJECTS = kruskal.$(OBJEXT) edge_w_funs.$(OBJEXT) \
+ ../utils/utils.$(OBJEXT) ../utils/dset.$(OBJEXT) \
+ ../utils/gen_heap.$(OBJEXT)
+kruskal_OBJECTS = $(am_kruskal_OBJECTS)
+kruskal_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(kruskal_SOURCES)
+DIST_SOURCES = $(kruskal_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+kruskal_SOURCES = kruskal.c edge_w_funs.c edge_w_funs.h \
+../utils/utils.c ../utils/dset.c ../utils/gen_heap.c \
+../include/utils.h ../include/dset.h ../include/gen_heap.h
+
+kruskal_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/kruskal/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/kruskal/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/dset.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/gen_heap.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+kruskal$(EXEEXT): $(kruskal_OBJECTS) $(kruskal_DEPENDENCIES) $(EXTRA_kruskal_DEPENDENCIES)
+ @rm -f kruskal$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(kruskal_OBJECTS) $(kruskal_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/dset.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/gen_heap.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edge_w_funs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kruskal.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/kruskal/edge_w_funs.c b/src/kruskal/edge_w_funs.c
new file mode 100644
index 0000000..09568ef
--- /dev/null
+++ b/src/kruskal/edge_w_funs.c
@@ -0,0 +1,73 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ */
+
+
+#include "edge_w_funs.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+int compare_edge_w(const void *e1, const void *e2){
+
+ edge_w_t *t1, *t2;
+
+ t1 = (edge_w_t*) e1;
+ t2 = (edge_w_t*) e2;
+
+ return (t1->w == t2->w? 0 : (t1->w < t2->w? -1 :1));
+}
+
+
+void* alloc_vector_edge_w(unsigned int N){
+
+ return malloc(N * sizeof(edge_w_t*));
+}
+
+void dealloc_vector_edge_w(void *v){
+
+ free(v);
+}
+
+void dealloc_elem_edge_w(void *e){
+
+ free(e);
+}
+
+void print_elem_edge_w(void *e){
+
+ edge_w_t *elem;
+
+ elem = (edge_w_t*)e;
+
+ printf("%d %d %2.8g\n", elem->i, elem->j, elem->w);
+}
+
+
diff --git a/src/kruskal/edge_w_funs.h b/src/kruskal/edge_w_funs.h
new file mode 100644
index 0000000..bb6fd9c
--- /dev/null
+++ b/src/kruskal/edge_w_funs.h
@@ -0,0 +1,54 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ */
+
+#ifndef __EDGE_W_FUNS_H__
+#define __EDGE_W_FUNS_H__
+
+typedef struct{
+ unsigned int i;
+ unsigned int j;
+ double w;
+} edge_w_t;
+
+
+int compare_edge_w(const void *e1, const void *e2);
+
+void* alloc_vector_edge_w(unsigned int N);
+
+void dealloc_vector_edge_w(void *v);
+
+void dealloc_elem_edge_w(void *e);
+
+void print_elem_edge_w(void *e);
+
+
+#endif //__EDGE_W_FUNS_H__
diff --git a/src/kruskal/kruskal.c b/src/kruskal/kruskal.c
new file mode 100644
index 0000000..2aa3660
--- /dev/null
+++ b/src/kruskal/kruskal.c
@@ -0,0 +1,215 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program finds the minimum/maximum spanning tree of a graph
+ * given as input, using the Kruskal's algorithm
+ *
+ *
+ * References:
+ *
+ * [1] 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.
+ *
+ */
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "dset.h"
+#include "gen_heap.h"
+#include "utils.h"
+#include "edge_w_funs.h"
+
+
+void usage(int argc, char *argv[]){
+
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- kruskal -*- **\n"
+ "** **\n"
+ "** Find the minimum/maximum spanning tree of a weighted graph **\n"
+ "** 'graph_in' provided as input. **\n"
+ "** **\n"
+ "** The input file 'graph_in' is a weighted edge-list: **\n"
+ "** **\n"
+ "** I_1 J_1 W_1 **\n"
+ "** I_2 J_2 W_2 **\n"
+ "** I_3 J_3 W_3 **\n"
+ "** ... ... **\n"
+ "** I_K J_K W_K **\n"
+ "** **\n"
+ "** The program computes by default the minimum spanning tree **\n"
+ "** of 'graph_in', unless the second parameter 'MAX' is **\n"
+ "** specified. **\n"
+ "** **\n"
+ "** The program prints on STDOUT the weighted edge-list of the **\n"
+ "** minimum/maximum spanning tree of 'graph_in'. **\n"
+ "** **\n"
+ "** If 'graph_in' is an unweighted graph, the program prints **\n"
+ "** on output one of the spanning trees of the graph. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in> [MAX]\n", argv[0]);
+}
+
+
+void kruskal(gen_heap_t *h, unsigned int N){
+
+ dset_t *nodes, set1, set2;
+ edge_w_t *elem;
+ unsigned int i;
+
+
+ nodes = malloc(N * sizeof(dset_t));
+
+ for(i=0; i<N; i++){
+ nodes[i] = NULL;
+ dset_makeset(nodes + i);
+ }
+
+ while(! gen_heap_delete(h, (void**)(&elem))){
+ /* get the next edge */
+ set1 = dset_find(nodes[elem->i]);
+ set2 = dset_find(nodes[elem->j]);
+ /* if i and j do not belong to the same disjoint set...*/
+ if (set1 != set2){
+ /* ... the edge (i,j) belongs to the spanning tree, */
+ /* so we print it...*/
+ print_elem_edge_w(elem);
+ /* ...then merge the two sets... */
+ dset_union(nodes[elem->i], nodes[elem->j]);
+ }
+ free(elem);
+ }
+ /* We now destroy all the disjoint sets... */
+ for (i=0;i<N;i++){
+ dset_destroy(nodes[i]);
+ }
+ free(nodes);
+
+}
+
+void load_edges_into_heap(FILE *filein, gen_heap_t *h){
+
+ char buff[256];
+ char *ptr;
+ edge_w_t *elem;
+
+
+ while(fgets(buff, 256, filein)){
+ if (buff[0] == '#')
+ continue;
+ elem = malloc(sizeof(edge_w_t));
+ ptr = strtok(buff, " "); /* read the first node */
+ VALID_PTR_OR_EXIT(ptr, 7);
+ elem->i = atoi(ptr);
+ ptr = strtok(NULL, " "); /* read the second node */
+ VALID_PTR_OR_EXIT(ptr, 7);
+ elem->j = atoi(ptr);
+ ptr = strtok(NULL, " "); /* read the weight */
+ if (!ptr)
+ /* if no weight is specified, assume it is set to 1.0 */
+ elem->w = 1.0;
+ else
+ elem->w = atof(ptr);
+ /* put the edge in the heap */
+ gen_heap_insert(h, elem);
+ }
+
+}
+
+int count_num_lines(FILE *filein){
+
+ int i, ch ;
+
+ i = 0;
+
+ while ((ch = fgetc(filein)) != EOF){
+ if (ch == '\n')
+ i ++;
+ }
+ rewind(filein);
+ return i;
+}
+
+
+int main(int argc, char *argv[]){
+
+ gen_heap_t *h;
+ unsigned int N;
+ FILE *filein;
+ char htype;
+ gen_heap_func_t *funs;
+
+ if(argc < 2){
+ usage(argc, argv);
+ exit(1);
+ }
+
+ htype = MIN_HEAP;
+ if (argc > 2 && !my_strcasecmp(argv[2], "MAX")){
+ htype = MAX_HEAP;
+ }
+
+ /* Initialisation of functions for gen_heap*/
+ funs = malloc(sizeof(gen_heap_func_t));
+ (*funs).compare = compare_edge_w;
+ (*funs).alloc_vector = alloc_vector_edge_w;
+ (*funs).dealloc_vector = dealloc_vector_edge_w;
+ (*funs).dealloc_elem = dealloc_elem_edge_w;
+ (*funs).print_elem = print_elem_edge_w;
+
+
+
+ filein = openfile_or_exit(argv[1], "r", 2);
+
+ N = count_num_lines(filein);
+
+ h = gen_heap_init(N, htype, funs);
+
+ load_edges_into_heap(filein, h);
+
+ fclose(filein);
+
+ kruskal(h, N);
+ gen_heap_destroy(h);
+ free(funs);
+}
diff --git a/src/label_prop/Makefile.am b/src/label_prop/Makefile.am
new file mode 100644
index 0000000..1ab1240
--- /dev/null
+++ b/src/label_prop/Makefile.am
@@ -0,0 +1,5 @@
+include ../common.mk
+bin_PROGRAMS = label_prop
+label_prop_SOURCES = label_prop.c ../utils/utils.c ../include/utils.h
+label_prop_LDADD = -lm
+
diff --git a/src/label_prop/Makefile.in b/src/label_prop/Makefile.in
new file mode 100644
index 0000000..57a3c99
--- /dev/null
+++ b/src/label_prop/Makefile.in
@@ -0,0 +1,578 @@
+# 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 = :
+bin_PROGRAMS = label_prop$(EXEEXT)
+subdir = src/label_prop
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_label_prop_OBJECTS = label_prop.$(OBJEXT) ../utils/utils.$(OBJEXT)
+label_prop_OBJECTS = $(am_label_prop_OBJECTS)
+label_prop_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(label_prop_SOURCES)
+DIST_SOURCES = $(label_prop_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+label_prop_SOURCES = label_prop.c ../utils/utils.c ../include/utils.h
+label_prop_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/label_prop/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/label_prop/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+label_prop$(EXEEXT): $(label_prop_OBJECTS) $(label_prop_DEPENDENCIES) $(EXTRA_label_prop_DEPENDENCIES)
+ @rm -f label_prop$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(label_prop_OBJECTS) $(label_prop_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/label_prop.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/label_prop/label_prop.c b/src/label_prop/label_prop.c
new file mode 100644
index 0000000..3488834
--- /dev/null
+++ b/src/label_prop/label_prop.c
@@ -0,0 +1,415 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program finds the communities in a graph using the
+ * label-propagation algorithm proposed by Raghavan, Albert, and
+ * Kumara.
+ *
+ * References:
+ *
+ * [1] 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.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <math.h>
+
+
+#include "iltree.h"
+#include "utils.h"
+
+
+typedef struct{
+ int label;
+ int freq;
+} label_freq_t;
+
+#define MODE_SYNC 0x0
+#define MODE_ASYNC 0x1
+
+
+
+/* Usage */
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- label_prop -*- **\n"
+ "** **\n"
+ "** Find the communities in 'graph_in' using the label **\n"
+ "** propagation algorithm. **\n"
+ "** **\n"
+ "** The first parameter is used to choose between synchronous **\n"
+ "** (SYNC) and asynchronous (ASYNC) update. **\n"
+ "** **\n"
+ "** The input file 'graph_in' is an edge-list. **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the file from **\n"
+ "** the standard input (STDIN). **\n"
+ "** **\n"
+ "** If 'max_epochs' is specified, the program stops after **\n"
+ "** 'max_epochs' epochs (useful in conjunction with SYNC, to **\n"
+ "** exit from loops). **\n"
+ "** **\n"
+ "** The program prints on STDOUT the partition obtained when **\n"
+ "** no more label flips are possible, in the format: **\n"
+ "** **\n"
+ "** node_1 comm_1 **\n"
+ "** node_2 comm_2 **\n"
+ "** node_3 comm_3 **\n"
+ "** ..... **\n"
+ "** **\n"
+ "** where 'comm_1' is the community to which 'node_1' belongs. **\n"
+ "** **\n"
+ "** The program prints on STDERR one line for each epoch, **\n"
+ "** in the format: **\n"
+ "** **\n"
+ "** epoch_1 Q_1 flips_1 **\n"
+ "** epoch_2 Q_2 flips_2 **\n"
+ "** ..... **\n"
+ "** **\n"
+ "** where 'epoch_i' is the epoch number, 'Q_i' is the modularity **\n"
+ "** of the partition found at that epoch, and 'flips_i' is the **\n"
+ "** number of label flips occurred in 'epoch_i'. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s [SYNC|ASYNC] <graph_in> [<max_epochs>]\n\n" , argv[0]);
+}
+
+
+
+
+/* Compare the frequency of two labels and return a value which allows
+ to sort them in reverse order (i.e., -v, if v=f1-f2) */
+
+int compare_label_freq_reverse(const void *e1, const void *e2){
+
+ label_freq_t v1, v2;
+
+ v1 = *((label_freq_t*)e1);
+ v2 = *((label_freq_t*)e2);
+
+ return - (v1.freq - v2.freq);
+
+}
+
+/* get the most common label in neighs (that is the list of the k
+ neighbours of a node) */
+unsigned int get_most_common_label(unsigned int *neighs, unsigned int k,
+ unsigned int *labels, unsigned int ref_label,
+ int *is_max){
+
+ static label_freq_t *neigh_labels = NULL;
+ static int size = 0;
+ int num, i, j, max_freq;
+
+ if (size < k){
+ size = k;
+ neigh_labels = realloc(neigh_labels, size * sizeof(label_freq_t));
+ }
+
+ neigh_labels[0].label = labels[neighs[0]];
+ neigh_labels[0].freq = 1;
+ num = 1;
+
+ for (i=1; i<k; i ++){
+ for(j=0; j<num; j++){
+ if (labels[neighs[i]] == neigh_labels[j].label)
+ break;
+ }
+ if (j == num){ /* new label */
+ neigh_labels[j].label = labels[neighs[i]];
+ neigh_labels[j].freq = 1;
+ num += 1;
+ }
+ else{/* the label already exists -> increase the counter */
+ neigh_labels[j].freq += 1;
+ }
+ }
+
+ /* Now we sort the array neigh_labels */
+ qsort(neigh_labels, num, sizeof(label_freq_t), compare_label_freq_reverse);
+
+ /* we determine how many neighbours have the maximum freq*/
+ max_freq = neigh_labels[0].freq;
+ i = 1;
+ while(i < num && neigh_labels[i].freq == max_freq){
+ i ++;
+ }
+
+ /* check whether ref_label is one of the most common labels */
+ *is_max = 0;
+ for (j=0; j<i; j++){
+ if (neigh_labels[j].label == ref_label)
+ *is_max = 1;
+ }
+ /* now that we know that there are "i" max_freqs, let's select one
+ of them at random */
+ j = rand() % i;
+
+ return neigh_labels[j].label;
+}
+
+/* reassign the labels so that communities are numbered from 1 to NC */
+int normalise_labels(unsigned int *labels, unsigned int N,
+ unsigned int *label_count){
+
+ unsigned int *label_map;
+ int i, j, num = 0;
+
+
+ label_map = malloc(N * sizeof(unsigned int));
+
+ label_map[0] = labels[0];
+ labels[0] = 0;
+ label_count[0] = 1;
+ num = 1;
+
+ for(i=1; i<N; i ++){
+ for(j=0; j<num; j++){
+ if (labels[i] == label_map[j])
+ break;
+ }
+ if (j == num){
+ label_map[j] = labels[i];
+ label_count[j] = 0;
+ num +=1;
+ }
+ labels[i] = j;
+ label_count[j] += 1;
+ }
+
+ free(label_map);
+ return num;
+}
+
+
+void dump_partition(unsigned int *labels, unsigned int *label_count, unsigned int N){
+
+ int i;
+
+ for(i=0; i<N; i ++){
+ fprintf(stdout, "%d %d\n", i, labels[i]);//, label_count[labels[i]]);
+ }
+}
+
+
+/* compute the modularity of the current partition */
+
+double modularity(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ unsigned int K, unsigned int *comm, unsigned int NC){
+
+ double Q=0;
+ int i, j;
+ unsigned int c_i, c_j;
+ double *pmm, *am;
+
+ pmm = malloc(NC * sizeof(double));
+ am = malloc(NC * sizeof(double));
+
+ for (i=0; i<NC; i++){
+ pmm[i] = am[i] = 0;
+ }
+
+ for(i=0; i<N; i ++){
+ c_i = comm[i];
+ am[c_i] += degree(r_slap, i);
+ for(j=r_slap[i]; j<r_slap[i+1]; j++){
+ c_j = comm[J_slap[j]];
+ if ( c_j == c_i ){
+ pmm[c_i] += 0.5;
+ }
+ }
+ }
+ Q = 0.0;
+ for(i=0; i < NC; i++){
+ Q += (pmm[i]* 2.0 / K - pow((am[i] * 1.0 / K), 2));
+ }
+ free(am);
+ free(pmm);
+ return Q;
+}
+
+
+
+unsigned int* label_propagation(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ unsigned int K, unsigned int *num_epochs,
+ int max_epochs, char mode){
+
+ unsigned int *labels, *next_labels, *tmp_labels, *ids, tmp, new_label;
+ int i, epochs, j, k, cont, is_max;
+ long long int num_flips;
+ double Q;
+
+
+
+ labels = malloc(N * sizeof(unsigned int));
+ ids = malloc(N * sizeof(unsigned int));
+
+ if(mode == MODE_ASYNC){
+ next_labels = labels;
+ }
+ else if (mode == MODE_SYNC){
+ next_labels = malloc(N * sizeof(unsigned int));
+ }
+
+ /* We initialize the list of ids and labels */
+ for (i=0; i<N; i ++){
+ ids[i] = labels[i] = i;
+ }
+
+ cont = 1;
+ epochs = 0;
+ while(cont){
+ if (max_epochs > 0 && epochs > max_epochs)
+ break;
+ cont = 0;
+ if (epochs > 0){
+ Q= modularity(J_slap, r_slap, N, K, labels, N);
+ fprintf(stderr, "%d %g %g\n", epochs, Q, (double)num_flips);
+ }
+ num_flips = 0;
+
+ epochs += 1;
+ for (i=N-1; i>=0; i--){
+ j = rand() % (i+1);
+ tmp = ids[j]; /* This is the id to be considered */
+
+ ids[j] = ids[i];
+ ids[i] = tmp;
+ k = r_slap[tmp + 1] - r_slap[tmp];
+ new_label = get_most_common_label(J_slap+r_slap[tmp], k,labels, labels[tmp], &is_max);
+
+ /* Stop criterion: if the new label is not equal to the
+ old one, continue to another epoch */
+
+ if (mode == MODE_ASYNC && labels[tmp] != new_label){
+ labels[tmp] = new_label;
+ cont = 1;
+ num_flips += 1 ;
+ }
+ if (mode == MODE_SYNC){
+ next_labels[tmp] = new_label;
+ if (labels[tmp] != next_labels[tmp]){
+ cont = 1;
+ num_flips += 1;
+ }
+ }
+ }
+ if (mode == MODE_SYNC){
+ /* Now we can swap labels and next_labels */
+ tmp_labels = labels;
+ labels = next_labels;
+ next_labels = tmp_labels;
+ }
+ }
+ free(ids);
+ *num_epochs = epochs - 1;
+
+ if (mode == MODE_SYNC){
+ free(next_labels);
+ }
+
+ return labels;
+}
+
+
+
+
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int N, K, nc;
+ unsigned int *J_slap, *r_slap, *labels, *label_count, num_epochs, max_epochs;
+ FILE *filein;
+ double Q;
+ char mode;
+
+
+ if (argc < 3){
+ usage(argv);
+ exit(1);
+ }
+
+ srand(time(NULL));
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[2], "r", 2);
+ }
+
+
+ read_slap(filein, &K, &N, &J_slap, &r_slap);
+
+ fclose(filein);
+
+ if (!my_strcasecmp(argv[1], "sync")){
+ mode = MODE_SYNC;
+ }
+ else{
+ mode = MODE_ASYNC;
+ }
+
+ if (argc > 3)
+ max_epochs = atoi(argv[3]);
+ else
+ max_epochs = 0;
+
+ labels = label_propagation(J_slap, r_slap, N, K, &num_epochs, max_epochs, mode);
+ label_count = malloc(N * sizeof(unsigned int));
+
+ nc = normalise_labels(labels, N, label_count);
+
+ Q= modularity(J_slap, r_slap, N, K, labels, nc);
+
+ printf("### nc: %d Q_max: %f Epochs: %d\n", nc, Q, num_epochs);
+ dump_partition(labels, label_count, N);
+ free(J_slap);
+ free(r_slap);
+ free(label_count);
+ free(labels);
+}
+
+
+
diff --git a/src/modularity/Makefile.am b/src/modularity/Makefile.am
new file mode 100644
index 0000000..d278c6e
--- /dev/null
+++ b/src/modularity/Makefile.am
@@ -0,0 +1,5 @@
+include ../common.mk
+bin_PROGRAMS = modularity
+modularity_SOURCES = modularity.c ../utils/utils.c ../include/utils.h
+modularity_LDADD = -lm
+
diff --git a/src/modularity/Makefile.in b/src/modularity/Makefile.in
new file mode 100644
index 0000000..76cc2a5
--- /dev/null
+++ b/src/modularity/Makefile.in
@@ -0,0 +1,578 @@
+# 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 = :
+bin_PROGRAMS = modularity$(EXEEXT)
+subdir = src/modularity
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_modularity_OBJECTS = modularity.$(OBJEXT) ../utils/utils.$(OBJEXT)
+modularity_OBJECTS = $(am_modularity_OBJECTS)
+modularity_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(modularity_SOURCES)
+DIST_SOURCES = $(modularity_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+modularity_SOURCES = modularity.c ../utils/utils.c ../include/utils.h
+modularity_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/modularity/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/modularity/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+modularity$(EXEEXT): $(modularity_OBJECTS) $(modularity_DEPENDENCIES) $(EXTRA_modularity_DEPENDENCIES)
+ @rm -f modularity$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(modularity_OBJECTS) $(modularity_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modularity.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/modularity/modularity.c b/src/modularity/modularity.c
new file mode 100644
index 0000000..2b01ff9
--- /dev/null
+++ b/src/modularity/modularity.c
@@ -0,0 +1,220 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Take a graph and a partition, and compute the modularity function
+ * associated to that partition.
+ *
+ * References:
+ *
+ * [1] M. E. J. Newman and M. Girvan. "Finding and evaluating
+ * community structure in networks". Phys. Rev. E 69, (2004),
+ * 026113.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#include "utils.h"
+
+void usage(char *argv[]){
+
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- modularity -*- **\n"
+ "** **\n"
+ "** Compute the modularity function associated to a partition **\n"
+ "** of the nodes of the graph provided as input. **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the edge list **\n"
+ "** from standard input (STDIN). The parameter 'partition' MUST **\n"
+ "** be a file in the format: **\n"
+ "** **\n"
+ "** node_0 community_0 **\n"
+ "** node_1 community_1 **\n"
+ "** node_2 community_2 **\n"
+ "** ..... **\n"
+ "** **\n"
+ "** where 'node_0', 'node_1', etc. are node labels, and **\n"
+ "** 'community_0', 'community_1', etc. is the label of the **\n"
+ "** community to which a node belongs. Notice that a node can **\n"
+ "** belong to exactly one community. This format is compatible **\n"
+ "** with the output of the programs which compute community **\n"
+ "** partitions, such as `gn`, `cnm`, `label_prop`, etc. **\n"
+ "** **\n"
+ "** The program prints on STDOUT the modularity of the partition, **\n"
+ "** and prints on STDERR a single line in the format: **\n"
+ "** **\n"
+ "** ## nc: NUM_COMMUNITIES **\n"
+ "** **\n"
+ "** where 'NUM_COMMUNITIES' is the number of communities in the **\n"
+ "** partition given as input. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in> <partition>\n", argv[0]);
+}
+
+
+/* This is the function that computes the value of the modularity function */
+
+double compute_modularity(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ unsigned int *part, unsigned int nc){
+ static double *e, *a;
+
+ unsigned int i, j, n, K, deg_i;
+ unsigned int ci, cj;
+ double Q;
+
+ if(!e)
+ e = malloc((N+1) * sizeof(double));
+ if(!a)
+ a = malloc((N+1) * sizeof(double));
+
+ memset(e, 0, (N+1) * sizeof(double));
+ memset(a, 0, (N+1) * sizeof(double));
+
+ K = r_slap[N];
+
+ for (i=0; i<N; i++){
+ ci = part[i];
+ deg_i = (r_slap[i+1] - r_slap[i]);
+ if (deg_i == 0)
+ continue;
+ a[ci] += deg_i;
+ for(j=r_slap[i]; j< r_slap[i+1]; j++){
+ cj = part[J_slap[j]];
+ if (ci == cj){
+ e[ci] += 1;
+ }
+ }
+ }
+
+ Q = 0.0;
+ fprintf(stderr, "### nc: %d\n", nc);
+ for (n=0; n<=nc; n++){
+ Q += 1.0 * e[n]/(1.0 * K ) - pow(1.0 * a[n]/K, 2);
+ }
+ free(a);
+ free(e);
+ return Q;
+}
+
+
+/*
+ * This function remaps the original partition labels into a
+ * consecutive set of integers, starting at 0 (zero)
+ */
+int normalise_labels(unsigned int *labels, unsigned int N,
+ unsigned int *label_count){
+
+ unsigned int *label_map;
+ int i, j, num = 0;
+
+
+ label_map = malloc(N * sizeof(unsigned int));
+
+ label_map[0] = labels[0];
+ labels[0] = 0;
+ label_count[0] = 1;
+ num = 1;
+
+ for(i=1; i<N; i ++){
+ for(j=0; j<num; j++){
+ if (labels[i] == label_map[j])
+ break;
+ }
+ if (j == num){
+ label_map[j] = labels[i];
+ label_count[j] = 0;
+ num +=1;
+ }
+ labels[i] = j;
+ label_count[j] += 1;
+ }
+
+ free(label_map);
+ return num;
+}
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int N, K, nc;
+ unsigned int *J_slap=NULL, *r_slap=NULL, *part = NULL;
+ unsigned int *label_count;
+ FILE *f_net, *f_part;
+ double Q;
+
+
+ if (argc < 3){
+ usage(argv);
+ exit(1);
+ }
+
+ if(!strcmp(argv[1], "-")){
+ f_net = stdin;
+ }
+ else{
+ f_net = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ f_part = openfile_or_exit(argv[2], "r", 3);
+
+ read_slap(f_net, &K, &N, &J_slap, &r_slap);
+
+ part = malloc(N * sizeof(unsigned int));
+ memset(part, 0, N * sizeof(unsigned int));
+
+ label_count = malloc(N * sizeof(unsigned int));
+
+ nc = read_partition(f_part, N, part);
+
+ fclose(f_net);
+ fclose(f_part);
+
+ nc = normalise_labels(part, N, label_count);
+
+ Q = compute_modularity(J_slap, r_slap, N, part, nc);
+
+ printf("%g\n", Q);
+ free(J_slap);
+ free(r_slap);
+ free(part);
+ free(label_count);
+}
diff --git a/src/pm/Makefile.am b/src/pm/Makefile.am
new file mode 100644
index 0000000..0d8dcca
--- /dev/null
+++ b/src/pm/Makefile.am
@@ -0,0 +1,5 @@
+include ../common.mk
+bin_PROGRAMS = pm
+pm_SOURCES = pm.c ../utils/utils.c ../include/utils.h
+pm_LDADD = -lm
+
diff --git a/src/pm/Makefile.in b/src/pm/Makefile.in
new file mode 100644
index 0000000..bbc8fdd
--- /dev/null
+++ b/src/pm/Makefile.in
@@ -0,0 +1,578 @@
+# 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 = :
+bin_PROGRAMS = pm$(EXEEXT)
+subdir = src/pm
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_pm_OBJECTS = pm.$(OBJEXT) ../utils/utils.$(OBJEXT)
+pm_OBJECTS = $(am_pm_OBJECTS)
+pm_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(pm_SOURCES)
+DIST_SOURCES = $(pm_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp README
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+pm_SOURCES = pm.c ../utils/utils.c ../include/utils.h
+pm_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/pm/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/pm/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+pm$(EXEEXT): $(pm_OBJECTS) $(pm_DEPENDENCIES) $(EXTRA_pm_DEPENDENCIES)
+ @rm -f pm$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pm_OBJECTS) $(pm_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pm.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/pm/README b/src/pm/README
new file mode 100644
index 0000000..6c461e7
--- /dev/null
+++ b/src/pm/README
@@ -0,0 +1 @@
+---- the correct implementation is in pm_new.c, which makes use of the Rayleigh coefficient ----
diff --git a/src/pm/pm.c b/src/pm/pm.c
new file mode 100644
index 0000000..99e680b
--- /dev/null
+++ b/src/pm/pm.c
@@ -0,0 +1,231 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program computes the leading eigenvector and the leading
+ * eigenvalue of a given graph, using the power method. The value of
+ * the leading eigenvalue is printed on the standard output, while
+ * the associated eigenvector is reported.
+ *
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#include "utils.h"
+
+#define MAX(x,y) ((x)>(y)? (x) : (y))
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- pm -*- **\n"
+ "** **\n"
+ "** Compute the leading eigenvalue and the leading eigenvector **\n"
+ "** of a graph, with a relative error smaller than 'eps' using **\n"
+ "** the power method (Rayleigh iteration). **\n"
+ "** **\n"
+ "** The input file 'graph_in' is an edge-list: **\n"
+ "** **\n"
+ "** I_1 J_1 **\n"
+ "** I_2 J_2 **\n"
+ "** I_3 J_3 **\n"
+ "** ... ... **\n"
+ "** I_K J_K **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the file from **\n"
+ "** the standard input (STDIN). **\n"
+ "** **\n"
+ "** 'is_dir' should be set either to 0 (zero) if the graph is **\n"
+ "** undirected, or to 1 (one) if the graph is directed. **\n"
+ "** **\n"
+ "** The value of the leading eigenvalue is printed on the **\n"
+ "** standard output (STDOUT) while the associated eigenvector **\n"
+ "** is printed on the standard error (STDERR). **\n"
+ "** **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+
+ printf("Usage: %s <graph_in> <is_dir> <eps>\n", argv[0]);
+}
+
+
+/* Product of a matrix by a vector */
+
+void matrix_vector_product(unsigned int *I, unsigned int *J, unsigned int K,
+ double *src, double *dst, unsigned int N){
+
+ int i;
+
+ for(i=0; i<N; i ++){
+ dst[i] = 0;
+ }
+
+ for (i=0; i<K; i++){
+ dst[I[i]] += src[J[i]];
+ }
+ return;
+}
+
+/* product between two row vectors (v1 * v2') */
+
+double vector_vector_product(double *v1, double *v2, unsigned int N){
+
+ int i;
+ double sum = 0;
+
+ for(i=0; i<N; i ++){
+ sum += v1[i] * v2[i];
+ }
+ return sum;
+}
+
+/* compute the 2-norm of a vector */
+
+double vector_norm(double *v,unsigned int N){
+
+ double norm = 0.0;
+ int i;
+
+ for(i=0; i<N; i++){
+ norm += v[i] * v[i];
+ }
+ norm = sqrt(norm);
+ return norm;
+}
+
+
+double compute_relative_error(double *x_new, double *x_old, double lambda, unsigned int N){
+
+ double val, num, den;
+ int i;
+
+ num = den = 0.0;
+ for (i=0; i<N; i++){
+ val = x_new[i] - lambda * x_old [i];
+ num += val * val;
+ den += x_new[i] * x_new[i];
+ }
+ return sqrt(num / den);
+}
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int *I, *J;
+ unsigned int N, K;
+ double *x1, *x2, *tmp;
+ double norm, lambda, err, eps;
+ int i, is_dir;
+
+ FILE *filein, *fileout;
+
+ if(argc < 4){
+ usage(argv);
+ exit(1);
+ }
+
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+ is_dir = atoi(argv[2]);
+ eps = fabs(atof(argv[3]));
+ lambda = 0.0;
+
+
+ K = read_ij(filein, &I, &J);
+ if (! is_dir){
+ K = 2*K;
+ I = realloc(I, K * sizeof(unsigned int));
+ J = realloc(J, K * sizeof(unsigned int));
+ for (i=K/2; i<K; i++){
+ I[i] = J[i-K/2];
+ J[i] = I[i-K/2];
+ }
+
+ }
+ N = 1 + MAX(find_max(I, K), find_max(J, K));
+
+ fclose(filein);
+
+ x1 = malloc(N * sizeof(double));
+ x2 = malloc(N * sizeof(double));
+
+ for(i=0; i<N; i++){
+ x1[i] = 1;
+ x2[i] = 0;
+ }
+
+ /* The following cycle is the actual implementation of the power
+ method (Rayleigh iteration) */
+ err = 100*eps;
+
+ while (err > eps) {
+ norm = vector_norm(x1, N);
+ for(i=0; i<N; i ++){
+ x1[i] /= norm;
+ }
+ matrix_vector_product(I, J, K, x1, x2, N);
+ lambda = vector_vector_product(x2, x1, N);
+ /* compute the relative error */
+ err = compute_relative_error(x2, x1, lambda, N);
+ tmp = x1;
+ x1 = x2;
+ x2 = tmp;
+ }
+
+ fileout = stderr;
+ norm = vector_norm(x1, N);
+
+ for(i=0; i<N; i++){
+ fprintf(fileout, "%d %g\n", i, x1[i]/norm);
+ }
+ printf("%2.15g\n", lambda);
+ free(I);
+ free(J);
+ free(x1);
+ free(x2);
+}
diff --git a/src/power_law/Makefile.am b/src/power_law/Makefile.am
new file mode 100644
index 0000000..db074b8
--- /dev/null
+++ b/src/power_law/Makefile.am
@@ -0,0 +1,4 @@
+include ../common.mk
+bin_PROGRAMS = power_law
+power_law_SOURCES = power_law.c ../utils/utils.c ../include/utils.h
+power_law_LDADD = -lm
diff --git a/src/power_law/Makefile.in b/src/power_law/Makefile.in
new file mode 100644
index 0000000..9071a8e
--- /dev/null
+++ b/src/power_law/Makefile.in
@@ -0,0 +1,578 @@
+# 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 = :
+bin_PROGRAMS = power_law$(EXEEXT)
+subdir = src/power_law
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_power_law_OBJECTS = power_law.$(OBJEXT) ../utils/utils.$(OBJEXT)
+power_law_OBJECTS = $(am_power_law_OBJECTS)
+power_law_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(power_law_SOURCES)
+DIST_SOURCES = $(power_law_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+power_law_SOURCES = power_law.c ../utils/utils.c ../include/utils.h
+power_law_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/power_law/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/power_law/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+power_law$(EXEEXT): $(power_law_OBJECTS) $(power_law_DEPENDENCIES) $(EXTRA_power_law_DEPENDENCIES)
+ @rm -f power_law$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(power_law_OBJECTS) $(power_law_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/power_law.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/power_law/power_law.c b/src/power_law/power_law.c
new file mode 100644
index 0000000..4733019
--- /dev/null
+++ b/src/power_law/power_law.c
@@ -0,0 +1,146 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program samples a degree sequence from a discrete power-law
+ * distribution with a given exponent.
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+#include <errno.h>
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- power_law -*- **\n"
+ "** **\n"
+ "** Sample 'N' elements from a power law degree distribution **\n"
+ "** P(k) ~= k^{gamma} **\n"
+ "** with degrees in the range [k_min, k_max], and print them **\n"
+ "** on STDOUT. **\n"
+ "** **\n"
+ "** If the obtained degree sequence is even, i.e., if the sum **\n"
+ "** of all the sampled degrees is even, the program returns 0 **\n"
+ "** (zero), otherwise it returns 1. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <gamma> <k_min> <k_max> <N>\n" , argv[0]);
+}
+
+
+
+void create_distr(double *v, double gamma, int k_min, int k_max){
+ int n, i;
+ double sum, new_sum;
+
+ n = k_max-k_min + 1;
+
+ sum = 0;
+ for(i=0; i<n; i++){
+ v[i] = pow((k_min + i), gamma);
+ sum += v[i];
+ }
+ new_sum = 0;
+ /* Now we normalize the array*/
+ for(i=0; i<n; i++){
+ v[i]/= sum;
+ new_sum += v[i];
+ }
+ /* Now we compute the cumulative distribution*/
+ for(i=1; i<n; i++){
+ v[i] += v[i-1];
+ }
+}
+
+
+int find_degree(double *v, int dim, double xi){
+ int i;
+
+ i=0;
+ while(xi > v[i])
+ i++;
+ return i;
+
+}
+
+
+int main(int argc, char *argv[]){
+
+ double gamma, xi, val, q;
+ unsigned int N, i, distr_num, k, k_min, k_max, K;
+ double *distr;
+
+ if (argc < 5){
+ usage(argv);
+ exit(1);
+ }
+
+ srand(time(NULL));
+
+ gamma = atof(argv[1]);
+ k_min = atoi(argv[2]);
+ k_max = atoi(argv[3]);
+ N = atoi(argv[4]);
+
+ K = 0;
+
+ distr_num = k_max - k_min + 1;
+ distr = malloc(distr_num * sizeof(double));
+
+ create_distr(distr, gamma, k_min, k_max);
+
+ for(i=0; i<N;){
+ xi = rand()* 1.0 / RAND_MAX;
+ k = find_degree(distr, distr_num, xi);
+ val = rand()*1.0/RAND_MAX;
+ q = k_min + xi * distr_num;
+ q = q / (floor(q) + 1);
+ q = pow(q, gamma);
+ if (val <= q){
+ printf("%d\n", k+k_min);
+ K += k+k_min;
+ i++;
+ }
+ }
+ free(distr);
+ /* Return 0 if the degree sequence is even, or 1 otherwise */
+ return K%2;
+}
diff --git a/src/shortest/Makefile.am b/src/shortest/Makefile.am
new file mode 100644
index 0000000..71cabc2
--- /dev/null
+++ b/src/shortest/Makefile.am
@@ -0,0 +1,6 @@
+include ../common.mk
+bin_PROGRAMS = shortest shortest_avg_max_hist
+shortest_SOURCES = shortest.c ../utils/utils.c ../include/utils.h
+shortest_LDADD = -lm
+shortest_avg_max_hist_SOURCES = shortest_avg_max_hist.c ../utils/utils.c ../include/utils.h
+shortest_avg_max_hist_LDADD = -lm
diff --git a/src/shortest/Makefile.in b/src/shortest/Makefile.in
new file mode 100644
index 0000000..8a0723a
--- /dev/null
+++ b/src/shortest/Makefile.in
@@ -0,0 +1,589 @@
+# 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 = :
+bin_PROGRAMS = shortest$(EXEEXT) shortest_avg_max_hist$(EXEEXT)
+subdir = src/shortest
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_shortest_OBJECTS = shortest.$(OBJEXT) ../utils/utils.$(OBJEXT)
+shortest_OBJECTS = $(am_shortest_OBJECTS)
+shortest_DEPENDENCIES =
+am_shortest_avg_max_hist_OBJECTS = shortest_avg_max_hist.$(OBJEXT) \
+ ../utils/utils.$(OBJEXT)
+shortest_avg_max_hist_OBJECTS = $(am_shortest_avg_max_hist_OBJECTS)
+shortest_avg_max_hist_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(shortest_SOURCES) $(shortest_avg_max_hist_SOURCES)
+DIST_SOURCES = $(shortest_SOURCES) $(shortest_avg_max_hist_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+shortest_SOURCES = shortest.c ../utils/utils.c ../include/utils.h
+shortest_LDADD = -lm
+shortest_avg_max_hist_SOURCES = shortest_avg_max_hist.c ../utils/utils.c ../include/utils.h
+shortest_avg_max_hist_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/shortest/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/shortest/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+shortest$(EXEEXT): $(shortest_OBJECTS) $(shortest_DEPENDENCIES) $(EXTRA_shortest_DEPENDENCIES)
+ @rm -f shortest$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(shortest_OBJECTS) $(shortest_LDADD) $(LIBS)
+
+shortest_avg_max_hist$(EXEEXT): $(shortest_avg_max_hist_OBJECTS) $(shortest_avg_max_hist_DEPENDENCIES) $(EXTRA_shortest_avg_max_hist_DEPENDENCIES)
+ @rm -f shortest_avg_max_hist$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(shortest_avg_max_hist_OBJECTS) $(shortest_avg_max_hist_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shortest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shortest_avg_max_hist.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/shortest/shortest.c b/src/shortest/shortest.c
new file mode 100644
index 0000000..9ea9a1a
--- /dev/null
+++ b/src/shortest/shortest.c
@@ -0,0 +1,259 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program computes the distance from a given node to all the
+ * other nodes of an undirected graph, using the Breadth-First Search
+ * algorithm.
+ *
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "utils.h"
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- shortest -*- **\n"
+ "** **\n"
+ "** Compute the distance from the given 'node' to all the other **\n"
+ "** nodes of an undirected graph. The first parameter 'graph_in' **\n"
+ "** is the name of the file containing the edge list of the **\n"
+ "** graph. The second parameter 'node' is the label of the node **\n"
+ "** for which we want to compute the distances to all the other **\n"
+ "** nodes. **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the edge list **\n"
+ "** from standard input (STDIN) **\n"
+ "** **\n"
+ "** The program prints on output a row of values: **\n"
+ "** **\n"
+ "** d0 d1 d2 d3 d4...... **\n"
+ "** **\n"
+ "** where d0 is the distance between 'node' and '0', 'd1' is the **\n"
+ "** distance between 'node' and '1', and so on. **\n"
+ "** **\n"
+ "** If the third parameter is equal to 'SHOW', the program will **\n"
+ "** dump all the shortest paths from 'node' to all the other **\n"
+ "** nodes on the standard error (STDERR). **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2009-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in> <node> [SHOW]\n\n" , argv[0]);
+}
+
+
+/*
+ * Add 'k' to a list of predecessors
+ */
+
+void add_predecessor(unsigned int **pred, unsigned int k){
+
+ (*pred)[0] += 1;
+ *pred = realloc(*pred, ((*pred)[0] + 1) * sizeof(unsigned int));
+ (*pred)[ (*pred)[0] ] = k;
+}
+
+
+
+/*
+ *
+ * This is the implementation of the Breadth-First Search algorithm
+ * (BFS) to compute the shortest paths, and the distances, between a
+ * given node 'i' and all the other nodes of a graph.
+ *
+ */
+unsigned int** compute_shortest_paths(unsigned int N, unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int i, unsigned int **dist){
+
+ unsigned int j, k, cur_node;
+ unsigned int *marked, **preds;
+ unsigned int d;
+ unsigned int n, nd, ndp;
+
+ *dist = malloc(N * sizeof(unsigned int));
+ marked = malloc(N * sizeof(unsigned int));
+ preds = malloc(N * sizeof(unsigned int *));
+
+ for(j=0; j<N; j ++){
+ (*dist)[j] = N;
+ preds[j] = malloc(sizeof(unsigned int));
+ preds[j][0] = 0; /* The list of predecessors is empty! */
+ }
+ (*dist)[i] = 0;
+ marked[0] = i;
+ d = 0;
+ n = 0;
+ nd = 1;
+ ndp = 0;
+ while (d<N && nd > 0){
+ for(k = n; k< n+nd; k ++){
+ cur_node = marked[k];
+ for (j=r_slap[cur_node]; j<r_slap[cur_node +1] ; j++){
+ if ( (*dist)[ J_slap[j] ] == d+1){
+ add_predecessor((unsigned int **)(preds + J_slap[j]), cur_node);
+ }
+ if ( (*dist)[ J_slap[j] ] == N){
+ (*dist)[ J_slap[j] ] = d+1;
+ marked[n + nd + ndp] = J_slap[j];
+ add_predecessor(preds + J_slap[j], cur_node);
+ ndp +=1;
+ }
+ }
+
+ }
+ n = n + nd;
+ nd = ndp;
+ ndp = 0;
+ d += 1;
+ }
+ free(marked);
+ return preds;
+}
+
+/*
+ * Dump on output the distances between 'node' and all the other nodes
+ * of the graph
+ *
+ */
+
+void dump_dists(unsigned int *dists, unsigned int N){
+
+ unsigned int i;
+ for (i=0; i<N; i++){
+ printf("%d ", dists[i]);
+ }
+ printf("\n");
+}
+
+
+/*
+ * recursively show the shortest paths from 'node' to all the other
+ * nodes ot the graph
+ *
+ */
+void recursive_show_paths(unsigned int **preds, unsigned int N, unsigned int k,
+ char *buff, int pos, FILE *fileout){
+
+ int i;
+ char lbuff[10];
+
+
+ if (preds[k][0] == 0){
+ sprintf(buff + pos, "%5d\n", k);
+ fprintf(fileout, "%s", buff );
+ return;
+ }
+
+ sprintf(lbuff, "%5d ", k);
+ strncpy(buff + pos, lbuff, 7);
+ for(i=1; i<= preds[k][0]; i ++){
+ recursive_show_paths(preds, N, preds[k][i], buff, pos + 7, fileout);
+ }
+ return;
+}
+
+/*
+ *
+ * This function calls recursive_show_paths() for each of the nodes of
+ * the graph, to dump the shortest paths between 'node' and all the
+ * other nodes of the graph.
+ *
+ */
+
+void show_paths(unsigned int **preds, unsigned int N, FILE *fileout){
+
+ int j;
+ char buff[256];
+
+ for (j = 0; j<N; j++){
+ if (preds[j][0] > 0)
+ recursive_show_paths(preds, N, j, buff, 0, fileout);
+ }
+
+}
+
+int main(int argc, char *argv[]){
+
+ unsigned int *J_slap=NULL, *r_slap=NULL;
+ unsigned int K, N, i;
+ unsigned int **preds, *dists=NULL;
+ FILE *filein;
+
+ if (argc < 3){
+ usage(argv);
+ exit(1);
+ }
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ read_slap(filein, &K, &N, &J_slap, &r_slap);
+ i = atoi(argv[2]);
+ if (i>N){
+ printf("Node id '%d' does not exist!!!! Exiting....\n", i);
+ exit(3);
+ }
+
+ fclose(filein);
+
+ preds = compute_shortest_paths(N, J_slap, r_slap, i, &dists);
+ dump_dists(dists, N);
+ /* check if we should dump the shortest paths on stderr */
+ if (argc > 3 && !strcmp(argv[3], "SHOW")){
+ show_paths(preds, N, stderr);
+ }
+
+ /* Cleanup */
+
+ for (i=0; i<N; i++){
+ free(preds[i]);
+ }
+ free(preds);
+ free(dists);
+ free(J_slap);
+ free(r_slap);
+}
diff --git a/src/shortest/shortest_avg_max_hist.c b/src/shortest/shortest_avg_max_hist.c
new file mode 100644
index 0000000..287c8a6
--- /dev/null
+++ b/src/shortest/shortest_avg_max_hist.c
@@ -0,0 +1,223 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program computes the distance from a given node to all the
+ * other nodes of an undirected graph, using the Breadth-First Search
+ * algorithm.
+ *
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "utils.h"
+
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- shortest_avg_max_hist -*- **\n"
+ "** **\n"
+ "** Compute the distance from the given 'node' to all the other **\n"
+ "** nodes of an undirected graph. The first parameter 'graph_in' **\n"
+ "** is the name of the file containing the edge list of the **\n"
+ "** graph. The second parameter 'node' is the label of the node **\n"
+ "** for which we want to compute the distances to all the other **\n"
+ "** nodes. **\n"
+ "** **\n"
+ "** If 'graph_in' is equal to '-' (dash), read the edge list **\n"
+ "** from standard input (STDIN) **\n"
+ "** **\n"
+ "** The program prints on output a row containing: **\n"
+ "** **\n"
+ "** - The average shortest path length between 'node' and **\n"
+ "** all the other nodes **\n"
+ "** - The maximum distance to any other node (eccentricity) **\n"
+ "** - The number of nodes at distance 1, 2, 3, .... from 'node' **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " Please visit http://www.complex-networks.net for more information\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <graph_in> <node>\n\n" , argv[0]);
+}
+
+
+/*
+ * Add 'k' to a list of predecessors
+ */
+
+void add_predecessor(unsigned int **pred, unsigned int k){
+
+ (*pred)[0] += 1;
+ *pred = realloc(*pred, ((*pred)[0] + 1) * sizeof(unsigned int));
+ (*pred)[ (*pred)[0] ] = k;
+}
+
+
+
+/*
+ *
+ * This is the implementation of the Breadth-First Search algorithm
+ * (BFS) to compute the shortest paths, and the distances, between a
+ * given node 'i' and all the other nodes of a graph.
+ *
+ */
+unsigned int** compute_shortest_paths(unsigned int N, unsigned int *J_slap, unsigned int *r_slap,
+ unsigned int i, unsigned int **dist){
+
+ unsigned int j, k, cur_node;
+ unsigned int *marked, **preds;
+ unsigned int d;
+ unsigned int n, nd, ndp;
+
+ *dist = malloc(N * sizeof(unsigned int));
+ marked = malloc(N * sizeof(unsigned int));
+ preds = malloc(N * sizeof(unsigned int *));
+
+ for(j=0; j<N; j ++){
+ (*dist)[j] = N;
+ preds[j] = malloc(sizeof(unsigned int));
+ preds[j][0] = 0; /* The list of predecessors is empty! */
+ }
+ (*dist)[i] = 0;
+ marked[0] = i;
+ d = 0;
+ n = 0;
+ nd = 1;
+ ndp = 0;
+ while (d<N && nd > 0){
+ for(k = n; k< n+nd; k ++){
+ cur_node = marked[k];
+ for (j=r_slap[cur_node]; j<r_slap[cur_node +1] ; j++){
+ if ( (*dist)[ J_slap[j] ] == d+1){
+ add_predecessor((unsigned int **)(preds + J_slap[j]), cur_node);
+ }
+ if ( (*dist)[ J_slap[j] ] == N){
+ (*dist)[ J_slap[j] ] = d+1;
+ marked[n + nd + ndp] = J_slap[j];
+ add_predecessor(preds + J_slap[j], cur_node);
+ ndp +=1;
+ }
+ }
+
+ }
+ n = n + nd;
+ nd = ndp;
+ ndp = 0;
+ d += 1;
+ }
+ free(marked);
+ return preds;
+}
+
+
+void dump_avg_max_hist(unsigned int *dists, unsigned int N){
+
+ unsigned int i;
+ double res = 0;
+ double max = 0;
+ double *hist;
+
+ for (i=0; i<N; i++){
+ res += dists[i];
+ if (dists[i] > max)
+ max = dists[i];
+ }
+ hist = malloc((max + 1) * sizeof(double));
+ for (i=0; i<=max; i++){
+ hist[i] = 0;
+ }
+ for (i=0; i<N; i++){
+ if(dists[i]){
+ hist[dists[i]] ++;
+ }
+ }
+
+ res = res/(N-1);
+
+ printf("%g %g", res, max);
+ for (i=1; i<=max; i++){
+ printf(" %g", hist[i]);
+ }
+ printf("\n");
+ free(hist);
+}
+
+
+
+
+int main(int argc, char *argv[]){
+
+ unsigned int *J_slap=NULL, *r_slap=NULL;
+ unsigned int K, N, i;
+ unsigned int **preds, *dists=NULL;
+ FILE *filein;
+
+ if (argc < 3){
+ usage(argv);
+ exit(1);
+ }
+
+ if (!strcmp(argv[1], "-")){
+ /* take the input from STDIN */
+ filein = stdin;
+ }
+ else {
+ filein = openfile_or_exit(argv[1], "r", 2);
+ }
+
+ read_slap(filein, &K, &N, &J_slap, &r_slap);
+ fclose(filein);
+ i = atoi(argv[2]);
+ if (i>N){
+ printf("Node id '%d' does not exist!!!! Exiting....\n", i);
+ exit(3);
+ }
+ preds = compute_shortest_paths(N, J_slap, r_slap, i, &dists);
+ dump_avg_max_hist(dists, N);
+
+ /* Cleanup */
+
+ for (i=0; i<N; i++){
+ free(preds[i]);
+ }
+ free(preds);
+ free(dists);
+ free(J_slap);
+ free(r_slap);
+}
diff --git a/src/utils/cum_distr.c b/src/utils/cum_distr.c
new file mode 100644
index 0000000..1445323
--- /dev/null
+++ b/src/utils/cum_distr.c
@@ -0,0 +1,134 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Implementation of a data structure to maintain a cumulative
+ * distribution and sample values from it. Used in all the models of
+ * growing graphs based on some kind of preferential attachment.
+ *
+ */
+
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "cum_distr.h"
+
+
+
+cum_distr_t* cum_distr_init(unsigned int N){
+
+ cum_distr_t* d = NULL;
+
+ d = malloc(sizeof(cum_distr_t));
+
+ d->N = N;
+ d->num = 0;
+ d->sum = 0;
+
+ d->v = malloc((d->N) * sizeof(idval_t));
+
+ return d;
+}
+
+
+int cum_distr_add(cum_distr_t *d, unsigned int id, long double val){
+
+ idval_t *tmp;
+
+ if (d->num == d->N){
+ //fprintf(stderr, "+++++++++ REALLOC ++++++++++\n");
+ d->N += 10;
+ tmp = realloc(d->v, d->N * sizeof(idval_t));
+ if (!tmp){
+ d->N -= 10;
+ fprintf(stderr, "#### Error!!! Unable to add more values to the cumulative distribution!!!\n");
+ return -1;
+ }
+ else{
+ d->v = tmp;
+ }
+ }
+
+ d->sum += val;
+ d->v[d->num].id = id;
+ d->v[d->num].value = d->sum;
+ d->num += 1;
+ //fprintf(stderr, ">>>>>> update >>>>>> d->num: %d\n", d->num);
+ return 0;
+
+}
+
+
+
+/* sample an id from the cumulative distribution, by means of binary
+ search */
+unsigned int cum_distr_sample(cum_distr_t *d){
+
+ long double val;
+ unsigned int high, low, cur;
+
+ val = d->sum * rand() / RAND_MAX;
+
+ cur = d->num / 2;
+
+ low = 0;
+ high = d->num - 1;
+
+ while (low < high){
+ if (d->v[cur].value < val){
+ low = cur+1;
+ }
+ else if(d->v[cur].value >= val){
+ high = cur;
+ }
+ cur = (high + low) / 2;
+ }
+ return d->v[cur].id;
+}
+
+
+
+void cum_distr_dump(cum_distr_t *d){
+
+ unsigned int i;
+
+
+ for(i=0; i< d->num; i++){
+ fprintf(stderr, "(%d, %g)\n", d->v[i].id, (double)(d->v[i].value));
+ }
+}
+
+
+void cum_distr_destroy(cum_distr_t *d){
+
+ free(d->v);
+ free(d);
+}
diff --git a/src/utils/dset.c b/src/utils/dset.c
new file mode 100644
index 0000000..acb6bc8
--- /dev/null
+++ b/src/utils/dset.c
@@ -0,0 +1,128 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This files implements a disjoint-set data structure, where nodes
+ * labels are integers.
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "dset.h"
+
+void dset_makeset(dset_t *ds){
+
+ if (*ds == NULL){
+ *ds= malloc(sizeof(dset_elem_t));
+ }
+ (*ds)->parent = *ds;
+ (*ds) -> rank = 0;
+}
+
+void dset_destroy(dset_t ds){
+ free(ds);
+}
+
+
+void dset_makeset_id(dset_t *ds, int id){
+
+ dset_makeset(ds);
+ (*ds)->id = id;
+}
+
+
+dset_t dset_find(dset_t ds){
+ if (ds -> parent == ds){
+ return ds;
+ }
+ else return dset_find(ds->parent);
+}
+
+void dset_union(dset_t s1, dset_t s2){
+ dset_t r1, r2;
+
+ r1= dset_find(s1);
+ r2= dset_find(s2);
+ r2->parent = r1;
+}
+
+
+void dset_union_opt(dset_t s1, dset_t s2){
+ dset_t r1, r2;
+
+ r1= dset_find(s1);
+ r2= dset_find(s2);
+ if (r1 == r2){
+ return;
+ }
+
+ if (r1->rank < r2->rank){
+ r1->parent = r2;
+ }
+ else if (r1->rank > r2->rank){
+ r2->parent = r1;
+ }
+ else{
+ r2->parent = r1;
+ r1->rank += 1;
+ }
+}
+
+
+dset_t dset_find_opt(dset_t ds){
+ if (ds->parent != ds){
+ ds->parent = dset_find_opt(ds->parent);
+ }
+ return ds->parent;
+}
+
+
+int dset_find_id(dset_t ds){
+
+ dset_t res;
+
+ res = dset_find(ds);
+
+ return res->id;
+}
+
+
+int dset_find_id_opt(dset_t ds){
+
+ dset_t res;
+
+ res = dset_find_opt(ds);
+
+ return res->id;
+}
+
diff --git a/src/utils/gen_heap.c b/src/utils/gen_heap.c
new file mode 100644
index 0000000..586c7fd
--- /dev/null
+++ b/src/utils/gen_heap.c
@@ -0,0 +1,302 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This is an implementation of binary heaps (both Min-Heap and
+ * Max-Heap).
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+#include "gen_heap.h"
+
+
+
+gen_heap_t * gen_heap_init(unsigned int N, char htype, gen_heap_func_t *funs){
+
+ gen_heap_t* h;
+
+ h = malloc(sizeof(gen_heap_t));
+ h->htype = htype;
+ h->N = N;
+ h->last = -1;
+ h->funs = *funs;
+ h->v = h->funs.alloc_vector(N);
+ return h;
+}
+
+
+void __gen_heap_sift_up(gen_heap_t *h, int i){
+
+ int idx, parent;
+ void *tmp;
+
+ idx = i;
+ parent = PARENT(idx);
+ switch(h->htype){
+ case MAX_HEAP:
+ while ( idx >0 && h->funs.compare(h->v[idx], h->v[parent]) > 0){
+ tmp = h->v[idx];
+ h->v[idx] = h->v[parent];
+ h->v[parent] = tmp;
+ idx = parent;
+ parent = PARENT(idx);
+ }
+ break;
+ case MIN_HEAP:
+ while ( idx >0 && h-> funs.compare(h->v[idx], h->v[parent]) < 0){
+ tmp = h->v[idx];
+ h->v[idx] = h->v[parent];
+ h->v[parent] = tmp;
+ idx = parent;
+ parent = PARENT(idx);
+ }
+ break;
+ }
+}
+
+
+void __gen_heap_sift_down(gen_heap_t *h, int i){
+
+ int left, right, largest, smallest;
+ void *tmp;
+
+
+ switch(h->htype){
+
+ case MAX_HEAP:
+ largest = i;
+ left = 2 * i + 1;
+ right = 2 * i + 2;
+
+ if (left <= h->last && h->funs.compare(h->v[left], h->v[largest]) > 0){
+ largest = left;
+ }
+ if (right <= h->last && h->funs.compare(h->v[right], h->v[largest]) > 0){
+ largest = right;
+ }
+ if (largest != i){
+ tmp = h->v[i];
+ h->v[i] = h->v[largest];
+ h->v[largest] = tmp;
+ __gen_heap_sift_down(h, largest);
+ }
+ break;
+
+ case MIN_HEAP:
+ smallest = i;
+ left = 2 * i + 1;
+ right = 2 * i + 2;
+
+ if (left <= h->last && h->funs.compare(h->v[left], h->v[smallest]) < 0){
+ smallest = left;
+ }
+ if (right <= h->last && h->funs.compare(h->v[right], h->v[smallest]) < 0){
+ smallest = right;
+ }
+ if (smallest != i){
+ tmp = h->v[i];
+ h->v[i] = h->v[smallest];
+ h->v[smallest] = tmp;
+ __gen_heap_sift_down(h, smallest);
+ }
+ break;
+ }
+
+}
+
+
+void gen_heap_insert(gen_heap_t *h, void *elem){
+
+ if (h->last < h->N-1){
+ h->last += 1;
+ h->v[h->last] = elem;
+ }
+ else{
+ fprintf(stderr, "Error! Trying to insert more than %d elements in the heap (%s:%d)\n",
+ h->N, __FILE__, __LINE__);
+ return;
+ }
+ __gen_heap_sift_up(h, h->last);
+}
+
+
+
+int gen_heap_delete(gen_heap_t *h, void **val){
+
+ if (h->last >=0){
+ *val = h->v[0];
+ h->v[0] = h->v[h->last];
+ h->last -= 1;
+ __gen_heap_sift_down(h,0);
+ return 0;
+ }
+ else{
+ return 1;
+ }
+}
+
+
+
+void* gen_heap_peek(gen_heap_t *h){
+ return h->v[0];
+}
+
+
+gen_heap_t* gen_heap_from_array(void **v, unsigned int N, unsigned int last,
+ char htype, gen_heap_func_t *funs){
+
+ gen_heap_t *h;
+ int i;
+
+ h = malloc(sizeof(gen_heap_t));
+ h->N = N;
+ h->last = last;
+ h->htype = htype;
+ h->funs = *funs;
+ h->v = v;
+
+ for (i=last >> 1 ; i>=0; i--){
+ __gen_heap_sift_down(h, i);
+ }
+ return h;
+}
+
+
+
+void gen_heap_dump(gen_heap_t* h){
+
+ int i;
+
+ unsigned int N;
+
+ N = h->last+1;
+
+ printf("N: %d last:%d root:", h->N, h->last);
+ if (h->last >=0)
+ h->funs.print_elem(h->v[0]);
+ else
+ printf("NULL");
+ printf("\n");
+
+ for(i=0; i<N; i++){
+ if (i < (N+1)/2){
+ if (2*i+1 < N)
+ if (2*i + 2 < N){
+ printf("%d: ", i);
+ h->funs.print_elem(h->v[i]);
+ printf(" (");
+ h->funs.print_elem(h->v[2*i+1]);
+ printf(", ");
+ h->funs.print_elem(h->v[2*i+2]);
+ printf(")\n");
+ }
+ else{
+ printf("%d: ", i);
+ h->funs.print_elem(h->v[i]);
+ printf(" (");
+ h->funs.print_elem(h->v[2*i+1]);
+ printf(", NULL)\n");
+ }
+ else{
+ printf("%d: ", i);
+ h->funs.print_elem(h->v[i]);
+ printf(" (NULL, NULL)\n");
+ }
+ }
+ else{
+ printf("%d: ", i);
+ h->funs.print_elem(h->v[i]);
+ printf(" (NULL, NULL)\n");
+ }
+ }
+ printf("\n");
+}
+
+void gen_heap_destroy(gen_heap_t *h){
+
+ int i;
+
+ /* First deallocate all the elems */
+ for(i=0; i<=h->last; i++){
+ h->funs.dealloc_elem(h->v[i]);
+ }
+
+ /* now we deallocate the array */
+ h->funs.dealloc_vector(h->v);
+ h->v = NULL;
+ free(h);
+}
+
+
+int gen_heap_sort(void *v, unsigned int N, size_t size, char dir,
+ int (*compar)(const void *, const void *)){
+
+ gen_heap_func_t funs;
+ gen_heap_t *h;
+ void *val, **new_v=NULL, *tmp_v=NULL;
+ char htype;
+ int i;
+
+ funs.compare = compar;
+
+ htype = MAX_HEAP;
+
+ if (dir == SORT_DESC)
+ htype = MIN_HEAP;
+
+ new_v = malloc(N * sizeof(void*));
+ tmp_v = malloc(N * size);
+
+ for (i=0; i<N; i++){
+ new_v[i] = (char*)v+ i* size;
+ }
+
+ h = gen_heap_from_array(new_v, N, N-1, htype, &funs);
+ for(i = 0; i<N; i++){
+ if (gen_heap_delete(h, (void **)&val)){
+ free(new_v);
+ free(tmp_v);
+ return ERR_DELETE;
+ }
+ //fprintf(stderr, "(%p <- %p) ", (char*) v + (N-i-1) * size, val);
+ memcpy((char*)tmp_v + (N-i-1) * size, val, size);
+ }
+ memcpy(v, tmp_v, N*size);
+ free(new_v);
+ free(tmp_v);
+ return 0;
+}
+
diff --git a/src/utils/gen_pqueue.c b/src/utils/gen_pqueue.c
new file mode 100644
index 0000000..590bb98
--- /dev/null
+++ b/src/utils/gen_pqueue.c
@@ -0,0 +1,359 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This is an implementation of a (MIN/MAX)-priority-queue based on
+ * gen_heap. Most of the functions, with the only exception of
+ * gen_pqueue_change_key which is the core of the priority queue, are
+ * just wrappers around the corresponding functions in gen_heap
+ *
+ */
+
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include "gen_pqueue.h"
+
+void __update_handle(gen_pqueue_t *q, int idx){
+
+ q->handles[q->funs.get_id(q->v[idx])] = idx;
+}
+
+
+gen_pqueue_t * gen_pqueue_init(unsigned int N, char qtype, gen_pqueue_func_t *funs){
+
+ gen_pqueue_t* q;
+ int i;
+
+ q = malloc(sizeof(gen_pqueue_t));
+ q->qtype = qtype;
+ q->N = N;
+ q->last = -1;
+ q->funs = *funs;
+ q->v = q->funs.alloc_vector(N);
+ q->handles = malloc(N * sizeof(int));
+ for (i=0; i<N; i++){
+ q->handles[i] = -1;
+ }
+ return q;
+
+}
+
+void __gen_pqueue_sift_up(gen_pqueue_t *q, int i){
+
+ int idx, parent;
+ void *tmp;
+
+ idx = i;
+ parent = PARENT(idx);
+
+ switch(q->qtype){
+ case MAX_QUEUE:
+ while ( idx >0 && q->funs.compare(q->v[idx], q->v[parent]) > 0){
+ tmp = q->v[idx];
+ q->v[idx] = q->v[parent];
+ q->v[parent] = tmp;
+ __update_handle(q, idx);
+ __update_handle(q, parent);
+ idx = parent;
+ parent = PARENT(idx);
+ }
+ break;
+ case MIN_QUEUE:
+ while ( idx >0 && q-> funs.compare(q->v[idx], q->v[parent]) < 0){
+ tmp = q->v[idx];
+ q->v[idx] = q->v[parent];
+ q->v[parent] = tmp;
+ __update_handle(q, idx);
+ __update_handle(q, parent);
+ idx = parent;
+ parent = PARENT(idx);
+ }
+ break;
+ }
+}
+
+
+void __gen_pqueue_sift_down(gen_pqueue_t *q, int i){
+
+ int left, right, largest, smallest;
+ void *tmp;
+
+ switch(q->qtype){
+ case MAX_QUEUE:
+ largest = i;
+ left = 2 * i + 1;
+ right = 2 * i + 2;
+
+ if (left <= q->last && q->funs.compare(q->v[left], q->v[largest]) > 0){
+ largest = left;
+ }
+ if (right <= q->last && q->funs.compare(q->v[right], q->v[largest]) > 0){
+ largest = right;
+ }
+ if (largest != i){
+ tmp = q->v[i];
+ q->v[i] = q->v[largest];
+ q->v[largest] = tmp;
+ __update_handle(q, i);
+ __update_handle(q, largest);
+ __gen_pqueue_sift_down(q, largest);
+ }
+ else{
+ __update_handle(q, i);
+ }
+ break;
+
+ case MIN_QUEUE:
+ smallest = i;
+ left = 2 * i + 1;
+ right = 2 * i + 2;
+
+ if (left <= q->last && q->funs.compare(q->v[left], q->v[smallest]) < 0){
+ smallest = left;
+ }
+ if (right <= q->last && q->funs.compare(q->v[right], q->v[smallest]) < 0){
+ smallest = right;
+ }
+ if (smallest != i){
+ tmp = q->v[i];
+ q->v[i] = q->v[smallest];
+ q->v[smallest] = tmp;
+ __update_handle(q, i);
+ __update_handle(q, smallest);
+ __gen_pqueue_sift_down(q, smallest);
+ }
+ else{
+ __update_handle(q, i);
+ }
+ break;
+ }
+}
+
+
+void gen_pqueue_insert(gen_pqueue_t *q, void *elem){
+
+ if (q->last < q->N-1){
+ q->last += 1;
+ q->v[q->last] = elem;
+ __update_handle(q, q->last);
+ }
+ else{
+ fprintf(stderr, "Error! Trying to insert more than %d elements in the heap (%s:%d)\n",
+ q->N, __FILE__, __LINE__);
+ return;
+ }
+ __gen_pqueue_sift_up(q, q->last);
+}
+
+
+
+int gen_pqueue_delete(gen_pqueue_t *q, void **val){
+
+ if (q->last >=0){
+ *val = q->v[0];
+ q->v[0] = q->v[q->last];
+ q->last -= 1;
+ __gen_pqueue_sift_down(q, 0);
+ return 0;
+ }
+ else{
+ return 1;
+ }
+}
+
+
+
+void* gen_pqueue_peek(gen_pqueue_t *q){
+
+ return q->v[0];
+}
+
+gen_pqueue_t* gen_pqueue_from_array(void **v, unsigned int N, unsigned int last, char qtype,
+ gen_pqueue_func_t *funs){
+
+ gen_pqueue_t *q;
+ int i;
+
+ q = gen_pqueue_init(N, qtype, funs);
+ /* FIXME!!!! WARNING!!!! we should associate the array v to the array of the pqueue!!!! */
+ for (i=last >> 1 ; i>=0; i--){
+ __gen_pqueue_sift_down(q, i);
+ }
+ return q;
+}
+
+
+
+
+int gen_pqueue_force_key(gen_pqueue_t *q, unsigned int idx, void *key){
+
+
+ switch(q->qtype){
+ case MAX_QUEUE:
+ if (q->funs.compare_to_key(q->v[idx], key) > 0){
+ q->funs.set_key(q->v[idx], key);
+ __gen_pqueue_sift_down(q, idx);
+ }
+ else{
+ q->funs.set_key(q->v[idx], key);
+ __gen_pqueue_sift_up(q, idx);
+ }
+ break;
+ case MIN_QUEUE:
+ if (q->funs.compare_to_key(q->v[idx], key) < 0){
+ q->funs.set_key(q->v[idx], key);
+ __gen_pqueue_sift_down(q, idx);
+ }
+ else{
+ q->funs.set_key(q->v[idx], key);
+ __gen_pqueue_sift_up(q, idx);
+ }
+ break;
+ }
+ return 0;
+}
+
+
+int gen_pqueue_change_key(gen_pqueue_t *q, unsigned int idx, void *key){
+
+
+ switch(q->qtype){
+ case MAX_QUEUE:
+ if (q->funs.compare_to_key(q->v[idx], key) > 0){
+ return KEY_ERROR; /* we cannot assign a smaller key on a MAX_QUEUE*/
+ }
+ /* If everything is OK, we then set the new key here */
+ q->funs.set_key(q->v[idx], key);
+ if (idx == 0)
+ return 0;
+ __gen_pqueue_sift_up(q, idx);
+ break;
+ case MIN_QUEUE:
+ if (q->funs.compare_to_key(q->v[idx], key) < 0){
+ return KEY_ERROR; /* we cannot assign a higher key on a MIN_QUEUE*/
+ }
+ /* If everything is OK, we then set the new key here */
+ q->funs.set_key(q->v[idx], key);
+ /* parent = (int)(floor((idx-1)/2)); */
+ if (idx == 0)
+ return 0;
+ __gen_pqueue_sift_up(q, idx);
+ break;
+ }
+ return -1;
+}
+
+
+
+void gen_pqueue_dump(gen_pqueue_t *q){
+
+ int i;
+
+ unsigned int N;
+
+ N = q->last+1;
+
+ printf("N: %d last:%d root:", q->N, q->last);
+ if (q->last >=0)
+ q->funs.print_elem(q->v[0]);
+ else
+ printf("NULL");
+ printf("\n");
+
+ for(i=0; i<N; i++){
+ if (i < (N+1)/2){
+ if (2*i+1 < N)
+ if (2*i + 2 < N){
+ printf("%d: ", i);
+ q->funs.print_elem(q->v[i]);
+ printf(" (");
+ q->funs.print_elem(q->v[2*i+1]);
+ printf(", ");
+ q->funs.print_elem(q->v[2*i+2]);
+ printf(")\n");
+ }
+ else{
+ printf("%d: ", i);
+ q->funs.print_elem(q->v[i]);
+ printf(" (");
+ q->funs.print_elem(q->v[2*i+1]);
+ printf(", NULL)\n");
+ }
+ else{
+ printf("%d: ", i);
+ q->funs.print_elem(q->v[i]);
+ printf(" (NULL, NULL)\n");
+ }
+ }
+ else{
+ printf("%d: ", i);
+ q->funs.print_elem(q->v[i]);
+ printf(" (NULL, NULL)\n");
+ }
+ }
+ printf("\n");
+}
+
+
+void gen_pqueue_destroy(gen_pqueue_t *q){
+
+ int i;
+
+ /* First deallocate all the remaining elems (those that have not
+ been deleted) */
+ for(i=0; i<=q->last; i++){
+ q->funs.dealloc_elem(q->v[i]);
+ }
+
+ /* now we deallocate the array of elems */
+ q->funs.dealloc_vector(q->v);
+ free(q->handles);
+ free(q);
+}
+
+
+int gen_pqueue_get_handle(gen_pqueue_t *q, int id){
+
+ if (id >= q->N){
+ return ID_ERROR;
+ }
+ return q->handles[id];
+}
+
+void* gen_pqueue_get_key(gen_pqueue_t *q, int idx){
+
+ return q->funs.get_key(q->v[idx]);
+
+}
diff --git a/src/utils/gen_stack.c b/src/utils/gen_stack.c
new file mode 100644
index 0000000..76d8021
--- /dev/null
+++ b/src/utils/gen_stack.c
@@ -0,0 +1,87 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Implementation of a stack data structure, which stores pointers to
+ * generic objects
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "gen_stack.h"
+
+void gen_stack_create(gen_stack_t *s){
+
+ s->size = 10;
+ s->head = -1;
+ s->v = malloc(s->size * sizeof(void*));
+
+}
+
+void gen_stack_push(gen_stack_t *s, void *elem){
+
+ //void ** tmp;
+
+ if (s->head == s->size-1){
+ s->size += 10;
+ s->v = realloc(s->v, s->size * sizeof(void*));
+ if (!s->v){
+ fprintf(stderr, "Unable to allocate more memory in stack.c:stack_push... Exiting!\n");
+ exit(17);
+ }
+ }
+ s->head++;
+ s->v[s->head] = elem;
+}
+
+int gen_stack_pop(gen_stack_t *s, void **res){
+
+ if (!gen_stack_empty(s)){
+ *res = s->v[s->head];
+ s->head--;
+ return 0;
+ }
+ else{
+ return -1;
+ }
+
+}
+
+int gen_stack_empty(gen_stack_t *s){
+
+ return (s->head < 0 ? 1 : 0);
+}
+
+
+int gen_stack_size(gen_stack_t *s){
+ return s->head + 1;
+}
diff --git a/src/utils/iltree.c b/src/utils/iltree.c
new file mode 100644
index 0000000..28e8d90
--- /dev/null
+++ b/src/utils/iltree.c
@@ -0,0 +1,291 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This is an implementation of a simple insert-lookup Binary Search
+ * Tree. It supports adding nodes, checking for the presence of
+ * keys, visiting the BST in pre-order, getting the maximum/minumum
+ * key, and applying a function to all the nodes. There is no support
+ * for deleting nodes.
+ *
+ */
+
+
+/*
+ *
+ * A simple insert-lookup static binary tree datatype
+ *
+ */
+
+#include <stdlib.h>
+#include "iltree.h"
+#include <stdio.h>
+
+
+void __recursive_preorder(node_t *cur, ilfunc_t *funs){
+
+ if(cur->left){
+ __recursive_preorder(cur->left, funs);
+ }
+ funs->print(cur->info, funs->fileout);
+ if(cur->right){
+ __recursive_preorder(cur->right, funs);
+ }
+}
+
+/*
+ *
+ * Recursive push of nodes in the nodecache :-)
+ *
+ */
+
+void __recursive_destroy(node_t *cur, ilfunc_t *funs){
+ if(cur->left){
+ __recursive_destroy(cur->left, funs);
+ free(cur->left);
+ cur->left = NULL;
+ }
+ if(cur->right){
+ __recursive_destroy(cur->right, funs);
+ free(cur->right);
+ cur->right = NULL;
+ }
+ funs->dealloc(cur->info);
+}
+
+
+int __recursive_insert(node_t *cur, node_t *elem, ilfunc_t *f){
+
+ int res ;
+ res = f->compare(cur->info, elem->info);
+ /* printf("res: %d\n", res); */
+ if ( res > 0){
+ if (cur->left){
+ return __recursive_insert(cur->left, elem, f);
+ }
+ else{
+ cur->left = elem;
+ return 0;
+ }
+ }
+ else if (res < 0){
+ if (cur->right){
+ return __recursive_insert(cur->right, elem, f);
+ }
+ else{
+ cur->right = elem;
+ return 0;
+ }
+ }
+ printf("warning!!!!! duplicate entry!!!!!!\n\n");
+ return -1;
+}
+
+
+
+void* __recursive_lookup(node_t *cur, void *v, ilfunc_t *f){
+
+ int res;
+
+ res = f->compare(cur->info, v);
+
+ if (res > 0){
+ if(cur->left)
+ return __recursive_lookup(cur->left, v, f);
+ else
+ return NULL;
+
+ }
+ else if (res < 0){
+ if(cur->right)
+ return __recursive_lookup(cur->right, v, f);
+ else
+ return NULL;
+ }
+ else
+ return cur->info;
+}
+
+void __recursive_map(node_t *cur, void (*func)(void*)){
+
+ if (cur->left)
+ __recursive_map(cur->left, func);
+ func(cur->info);
+ if (cur->right)
+ __recursive_map(cur->right, func);
+}
+
+void __recursive_map_args(node_t *cur, void (*func)(void*, void*), void *args){
+
+ if (cur->left)
+ __recursive_map_args(cur->left, func, args);
+ func(cur->info, args);
+ if (cur->right)
+ __recursive_map_args(cur->right, func, args);
+}
+
+
+
+iltree_t iltree_create(iltree_t t){
+ if (!t) {
+ t = (iltree_t)malloc(sizeof(iltree_struct_t));
+ }
+ t->root = NULL;
+ return t;
+}
+
+
+void iltree_set_funs(iltree_t t, ilfunc_t *funs){
+
+ t->funs = *funs;
+}
+
+
+void iltree_insert(iltree_t t, void *elem){
+
+ node_t *n;
+
+ n = (node_t*)malloc(sizeof(node_t));
+ n->info = t->funs.alloc();
+ t->funs.copy(elem, n->info);
+ n->left = n->right = NULL;
+ if (t->root == NULL){
+ t->root = n;
+ }
+ else{
+ __recursive_insert(t->root, n, & (t->funs));
+ }
+}
+
+
+void iltree_destroy(iltree_t t){
+
+ if(t->root)
+ __recursive_destroy(t->root, & (t->funs));
+ free(t->root);
+ free(t);
+}
+
+
+
+
+void iltree_view_pre(iltree_t t){
+
+ if (t->root){
+ /*printf("----\n");*/
+ __recursive_preorder(t->root, & (t->funs));
+ /*printf("----\n");*/
+ }
+ else
+ printf("----- Empty tree!!!! -----\n");
+
+}
+
+
+
+void* iltree_lookup(iltree_t t , void *elem){
+
+ if(t->root)
+ return __recursive_lookup(t->root, elem, & (t->funs) );
+ else
+ return NULL;
+}
+
+
+void iltree_map(iltree_t t, void (*func)(void*)){
+
+ __recursive_map(t->root, func);
+
+}
+
+
+void iltree_map_args(iltree_t t, void (*func)(void*, void*), void *args){
+
+ __recursive_map_args(t->root, func, args);
+
+}
+
+void* iltree_get_fileout(iltree_t t){
+
+ return t->funs.fileout;
+}
+
+void iltree_set_fileout(iltree_t t, void *f){
+
+ t->funs.fileout = f;
+}
+
+void* __recursive_getmin(node_t *cur){
+
+ if(cur->left){
+ return __recursive_getmin(cur->left);
+ }
+ else{
+ return cur->info;
+ }
+
+}
+
+
+void* iltree_getmin(iltree_t t){
+
+ if (!t){
+ return NULL;
+ }
+ else{
+ return __recursive_getmin(t->root);
+ }
+
+}
+
+
+void* __recursive_getmax(node_t *cur){
+
+ if(cur->right){
+ return __recursive_getmax(cur->right);
+ }
+ else{
+ return cur->info;
+ }
+
+}
+
+
+void* iltree_getmax(iltree_t t){
+
+ if (!t){
+ return NULL;
+ }
+ else{
+ return __recursive_getmax(t->root);
+ }
+
+}
+
diff --git a/src/utils/iltree_double.c b/src/utils/iltree_double.c
new file mode 100644
index 0000000..a22236d
--- /dev/null
+++ b/src/utils/iltree_double.c
@@ -0,0 +1,102 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * Implementation of the iltree data structure with keys of type
+ * "long double"
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "iltree_double.h"
+
+
+void* alloc_double(){
+ return malloc(sizeof(long double));
+}
+
+void dealloc_double(void *elem){
+ free(elem);
+}
+
+void copy_double(void *elem1, void *elem2){
+ *((long double*)elem2) = *((long double*)elem1);
+}
+
+
+int compare_long_double(void *elem1, void *elem2){
+
+ long double *l1, *l2;
+
+ l1 = (long double*)elem1;
+ l2 = (long double*)elem2;
+
+ return (*l1 < *l2 ? -1 : (*l1 > *l2 ? 1 : 0));
+ //return *((long double*)elem1) - *((long double*)elem2);
+}
+
+void print_long_double(void *elem, void *fileout){
+
+ long double k, i, j;
+ long double x;
+
+ k = *((long double*)elem);
+
+ x = (1 + sqrtl(1 + 8 * (k-1))) / 2;
+ i = floorl(x) + 1;
+ j = k - ( (i-1)*1.0 * (i-2) ) /2;
+ //printf("x: %Lf\n i: %0.0Lf j: %0.0Lf\n", x, i, j);
+ fprintf((FILE*)fileout, "%d %d\n", (unsigned int)(i-1), (unsigned int)(j-1));
+}
+
+iltree_t iltree_double_init(iltree_t t, void *fileout){
+
+ ilfunc_t funs= {
+ .alloc = alloc_double,
+ .dealloc = dealloc_double,
+ .copy = copy_double,
+ .compare = compare_long_double,
+ .print = print_long_double,
+ .fileout = fileout
+ };
+
+ t = iltree_create(t);
+ iltree_set_funs(t, &funs);
+ return t;
+}
+
+
+void iltree_double_dump_edges(iltree_t t){
+
+ iltree_view_pre(t);
+}
diff --git a/src/utils/utils.c b/src/utils/utils.c
new file mode 100644
index 0000000..6ed5c19
--- /dev/null
+++ b/src/utils/utils.c
@@ -0,0 +1,785 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This file contains general utilities to handle input/output of
+ * graphs, convert between different sparse matrix representations,
+ * and other ancillary functions. It is linked against most of the
+ * programs in NetBunch.
+ *
+ */
+
+
+
+#include <stdlib.h>
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "utils.h"
+
+
+
+/* Read a degree distribution -- OBSOLETE */
+int read_deg_distr(FILE *filein, unsigned int **degs, unsigned int **Nk, double **p){
+
+ int n_degs = 0;
+ int size = 10;
+ char buff[256];
+ int k_i, num_i;
+ double p_i;
+ char *ptr;
+
+
+ *degs = realloc(*degs, size*sizeof(unsigned int));
+ *Nk = realloc(*Nk, size*sizeof(unsigned int));
+ *p = realloc(*p, size*sizeof(double));
+
+
+ while(fgets(buff, 256, filein)){
+ ptr = strtok(buff, " ");
+ VALID_PTR_OR_EXIT(ptr, 7);
+ if (ptr[0] == '#')
+ continue;
+ k_i = atoi(ptr);
+ ptr = strtok(NULL, " " );
+ VALID_PTR_OR_EXIT(ptr, 7);
+ num_i = atoi(ptr);
+ ptr = strtok(NULL, " \n");
+ VALID_PTR_OR_EXIT(ptr, 7);
+ p_i = atof(ptr);
+ if (n_degs == size){
+ size += 10;
+ *degs = realloc(*degs, size*sizeof(unsigned int));
+ *Nk = realloc(*Nk, size*sizeof(unsigned int));
+ *p = realloc(*p, size*sizeof(double));
+ }
+ (*degs)[n_degs] = k_i;
+ (*Nk)[n_degs] = num_i;
+ (*p)[n_degs] = p_i;
+ n_degs += 1;
+ }
+ if (n_degs > 0){
+ *degs = realloc(*degs, n_degs*sizeof(unsigned int));
+ *Nk = realloc(*Nk, n_degs*sizeof(unsigned int));
+ *p = realloc(*p, n_degs*sizeof(double));
+ }
+ return n_degs;
+}
+
+
+int read_deg_seq(FILE *filein, unsigned int **nodes){
+
+ int size, N, k;
+ char buff[256];
+ char *ptr;
+
+ N = 0;
+ size = 10;
+
+ *nodes = (unsigned int*)malloc(size * sizeof(unsigned int));
+
+ while(fgets(buff, 256, filein)){
+ ptr = strtok(buff, " ");
+ VALID_PTR_OR_EXIT(ptr, 7);
+ if (ptr[0] == '#')
+ continue;
+ k = atoi(ptr);
+
+ if (N == size){
+ size += 10;
+ *nodes = realloc(*nodes, size*sizeof(unsigned int));
+ }
+ (*nodes)[N] = k;
+ N += 1;
+ }
+ if (N > 0)
+ *nodes = realloc(*nodes, N * sizeof(unsigned int));
+ return N;
+}
+
+int read_stubs(FILE *filein, unsigned int **S){
+
+ int size, K;
+ char buff[256];
+ char *ptr;
+
+ K=0;
+ size = 20;
+ *S = malloc(size * sizeof(unsigned int));
+
+ while(fgets(buff, 256, filein)){
+ if (K == size){
+ size += 20;
+ *S = realloc(*S, size*sizeof(unsigned int));
+ }
+ ptr = strtok(buff, " "); /* read the first node */
+ VALID_PTR_OR_EXIT(ptr, 7);
+ (*S)[K++] = atoi(ptr);
+ ptr = strtok(NULL, " "); /* read the second node */
+ VALID_PTR_OR_EXIT(ptr, 7);
+ (*S)[K++] = atoi(ptr);
+ }
+ if (K > 0)
+ *S = realloc(*S, K * sizeof(unsigned int));
+ return K;
+}
+
+/*
+ * Read a file in ij format
+ */
+int read_ij(FILE *filein, unsigned int **I, unsigned int **J){
+
+ unsigned int size, K;
+ char buff[256];
+ char *ptr;
+
+ size = 20;
+ K = 0;
+
+ *I = malloc(size * sizeof(unsigned int));
+ *J = malloc(size * sizeof(unsigned int));
+ while(fgets(buff, 256, filein)){
+ if (buff[0] == '#')
+ continue;
+ if (K == size){
+ size += 20;
+ *I = realloc(*I, size*sizeof(unsigned int));
+ *J = realloc(*J, size*sizeof(unsigned int));
+ }
+ ptr = strtok(buff, " "); /* read the first node */
+ VALID_PTR_OR_EXIT(ptr, 7);
+ (*I)[K] = atoi(ptr);
+ ptr = strtok(NULL, " "); /* read the second node */
+ VALID_PTR_OR_EXIT(ptr, 7);
+ (*J)[K] = atoi(ptr);
+ K += 1;
+ }
+ if (K > 0){
+ *I = realloc(*I, K * sizeof(unsigned int));
+ *J = realloc(*J, K * sizeof(unsigned int));
+ }
+ return K;
+}
+
+
+/*
+ * Read a file in ij format -- weighted graphs -- if the input file is
+ * unweighted (i.e., no weights are provided), all the edges are
+ * assumed to have weight equal to 1.0
+ */
+int read_ij_w(FILE *filein, unsigned int **I, unsigned int **J,
+ double **W){
+
+ unsigned int size, K;
+ char buff[256];
+ char *ptr;
+
+ size = 20;
+ K = 0;
+
+ *I = malloc(size * sizeof(unsigned int));
+ *J = malloc(size * sizeof(unsigned int));
+ *W = malloc(size * sizeof(double));
+ while(fgets(buff, 256, filein)){
+ if (buff[0] == '#')
+ continue;
+ if (K == size){
+ size += 20;
+ *I = realloc(*I, size*sizeof(unsigned int));
+ *J = realloc(*J, size*sizeof(unsigned int));
+ *W = realloc(*W, size*sizeof(double));
+ }
+ ptr = strtok(buff, " "); /* read the first node */
+ VALID_PTR_OR_EXIT(ptr, 7);
+ (*I)[K] = atoi(ptr);
+ ptr = strtok(NULL, " "); /* read the second node */
+ VALID_PTR_OR_EXIT(ptr, 7);
+ (*J)[K] = atoi(ptr);
+ ptr = strtok(NULL, " "); /* read the weight */
+ if (!ptr)
+ (*W)[K] = 1.0;
+ else
+ (*W)[K] = atof(ptr);
+ K += 1;
+ }
+ if (K > 0){
+ *I = realloc(*I, K * sizeof(unsigned int));
+ *J = realloc(*J, K * sizeof(unsigned int));
+ *W = realloc(*W, K * sizeof(double));
+ }
+ return K;
+}
+
+
+
+void read_slap(FILE *filein, unsigned int *K, unsigned int *N,
+ unsigned int **J_slap, unsigned int **r_slap){
+
+ unsigned int *I=NULL, *J=NULL;
+ unsigned int i, k;
+
+ k = read_ij(filein, &I, &J);
+ *K = 2 * k;
+ I = realloc(I, 2*k * sizeof(unsigned int));
+ J = realloc(J, 2*k * sizeof(unsigned int));
+ for (i=k; i<2*k; i ++){
+ I[i] = J[i-k];
+ J[i] = I[i-k];
+ }
+
+ *N = convert_ij2slap(I, J, 2*k, r_slap, J_slap);
+ free(I);
+ free(J);
+ return;
+}
+
+void read_slap_w(FILE *filein, unsigned int *K, unsigned int *N,
+ unsigned int **J_slap, unsigned int **r_slap, double **W_slap){
+
+ unsigned int *I=NULL, *J=NULL;
+ double *W=NULL;
+ unsigned int i, k;
+
+ k = read_ij_w(filein, &I, &J, &W);
+ *K = 2 * k;
+ if (*K > 0){
+ I = realloc(I, (*K) * sizeof(unsigned int));
+ J = realloc(J, (*K) * sizeof(unsigned int));
+ W = realloc(W, (*K) * sizeof(double));
+ }
+ for (i=k; i<2*k; i ++){
+ I[i] = J[i-k];
+ J[i] = I[i-k];
+ W[i] = W[i-k];
+ }
+
+ *N = convert_ij2slap_w(I, J, W, 2*k, r_slap, J_slap, W_slap);
+ free(I);
+ free(J);
+ free(W);
+ return;
+}
+
+/**
+ *
+ * Read an I-J (directed) edge list, and transform it in SLAP
+ * notation, where the members of J_slap will be the outgoing
+ * neighbours
+ *
+ */
+void read_slap_dir(FILE *filein, unsigned int *K, unsigned int *N,
+ unsigned int **J_slap, unsigned int **r_slap){
+
+ unsigned int *I=NULL, *J=NULL;
+ unsigned int k;
+
+ k = read_ij(filein, &I, &J);
+ *K = k;
+
+ *N = convert_ij2slap(I, J, k, r_slap, J_slap);
+ free(I);
+ free(J);
+ return;
+}
+
+/**
+ *
+ * Read an I-J (directed) edge list, and transform it in SLAP
+ * notation, where the members of J_slap will be the incoming
+ * neighbours
+ *
+ */
+void read_slap_dir_incoming(FILE *filein, unsigned int *K, unsigned int *N,
+ unsigned int **J_slap, unsigned int **r_slap){
+
+ unsigned int *I=NULL, *J=NULL;
+ unsigned int k;
+
+ k = read_ij(filein, &I, &J);
+ *K = k;
+
+ *N = convert_ij2slap(J, I, k, r_slap, J_slap);
+ free(I);
+ free(J);
+ return;
+}
+
+
+
+
+unsigned int find_max(unsigned int *v, unsigned int N){
+
+ unsigned int i, max;
+
+ max = v[0];
+ i = 0;
+ while(++i < N){
+ if (v[i] > max)
+ max = v[i];
+ }
+ return max;
+}
+
+
+int convert_ij2slap(unsigned int *I, unsigned int *J, unsigned int K,
+ unsigned int ** r_slap, unsigned int **J_slap){
+
+ unsigned int tmp, max;
+ unsigned int i, pos;
+ unsigned int *p;
+
+ if (K < 1){
+ return 0;
+ }
+
+ max = find_max(I, K) + 1;
+ tmp = find_max(J, K) + 1;
+ if (tmp > max){
+ max = tmp ;
+ }
+
+ *r_slap = malloc( (max+1) * sizeof(unsigned int));
+ p = malloc(max * sizeof(unsigned int));
+
+ *J_slap = malloc(K * sizeof(unsigned int));
+
+ memset(*r_slap, 0, (max+1) * sizeof(unsigned int));
+ for(i=0; i<max + 1; i++)
+ (*r_slap)[i] = 0;
+ memset(p, 0, max * sizeof(unsigned int));
+ (*r_slap)[0] = 0;
+ for(i=0; i<K; i++){
+ (*r_slap)[ I[i] + 1] += 1;
+ }
+ for(i=1; i<=max; i++){
+ (*r_slap)[i] += (*r_slap)[i-1];
+ }
+ for(i=0; i<K; i++){
+ pos = (*r_slap) [ I[i] ] + p[ I[i] ];
+ (*J_slap)[pos] = J[i];
+ p[ I[i] ] += 1;
+ }
+ free(p);
+ return max;
+}
+
+
+
+int convert_ij2slap_w(unsigned int *I, unsigned int *J, double *W, unsigned int K,
+ unsigned int ** r_slap, unsigned int **J_slap,
+ double **W_slap){
+
+ unsigned int tmp, max;
+ unsigned int i, pos;
+ unsigned int *p;
+
+ max = find_max(I, K) + 1;
+ tmp = find_max(J, K) + 1;
+ if (tmp > max){
+ max = tmp ;
+ }
+ if (K<1){
+ return 0;
+ }
+
+ *r_slap = malloc( (max+1) * sizeof(unsigned int));
+ p = malloc(max * sizeof(unsigned int));
+
+ *J_slap = malloc(K * sizeof(unsigned int));
+ *W_slap = malloc(K * sizeof(double));
+
+ memset(*r_slap, 0, (max+1) * sizeof(unsigned int));
+ for(i=0; i<max + 1; i++)
+ (*r_slap)[i] = 0;
+ memset(p, 0, max * sizeof(unsigned int));
+ (*r_slap)[0] = 0;
+ for(i=0; i<K; i++){
+ (*r_slap)[ I[i] + 1] += 1;
+ }
+ for(i=1; i<=max; i++){
+ (*r_slap)[i] += (*r_slap)[i-1];
+ }
+ for(i=0; i<K; i++){
+ pos = (*r_slap) [ I[i] ] + p[ I[i] ];
+ (*J_slap)[pos] = J[i];
+ (*W_slap)[pos] = W[i];
+ p[ I[i] ] += 1;
+ }
+ free(p);
+ return max;
+}
+
+
+int convert_ij2slap_N(unsigned int *I, unsigned int *J, unsigned int K,
+ unsigned int N, unsigned int ** r_slap,
+ unsigned int **J_slap){
+
+ unsigned int max;
+ unsigned int i, pos;
+ unsigned int *p;
+
+ max = N;
+
+ *r_slap = malloc( (max+1) * sizeof(unsigned int));
+ p = malloc(max * sizeof(unsigned int));
+
+ *J_slap = malloc(K * sizeof(unsigned int));
+
+ memset(*r_slap, 0, (max+1) * sizeof(unsigned int));
+ for(i=0; i<max + 1; i++)
+ (*r_slap)[i] = 0;
+ memset(p, 0, max * sizeof(unsigned int));
+ (*r_slap)[0] = 0;
+ for(i=0; i<K; i++){
+ (*r_slap)[ I[i] + 1] += 1;
+ }
+ for(i=1; i<=max; i++){
+ (*r_slap)[i] += (*r_slap)[i-1];
+ }
+ for(i=0; i<K; i++){
+ pos = (*r_slap) [ I[i] ] + p[ I[i] ];
+ (*J_slap)[pos] = J[i];
+ p[ I[i] ] += 1;
+ }
+ free(p);
+ return max;
+}
+
+
+
+/* RIVEDERE QUESTA FUNZIONE...... PASSARE UN FILE COME ARGOMENTO E
+ USARE fprintf */
+void dump_deg_distr(unsigned int *degs, double *p, int n){
+
+ int i;
+
+ for(i=0; i<n; i++){
+ printf("%d %2.6f\n", degs[i], p[i]);
+ }
+}
+
+
+
+/* RIVEDERE QUESTA FUNZIONE...... PASSARE UN FILE COME ARGOMENTO E
+ USARE fprintf */
+void dump_deg_seq(unsigned int *nodes, int N){
+
+ int i;
+ for(i=0; i<N; i++){
+ printf("%d: %d\n", i, nodes[i]);
+ }
+}
+
+
+FILE* openfile_or_exit(char *filename, char *mode, int exitcode){
+
+ FILE *fileout;
+ char error_str[256];
+
+ fileout = fopen(filename, mode);
+ if (!fileout){
+ sprintf(error_str, "Error opening file %s", filename);
+ perror(error_str);
+ exit(exitcode);
+ }
+ return fileout;
+}
+
+int compare_int(const void *x1, const void *x2){
+ return *((unsigned int*)x1) - *((unsigned int*)x2);
+}
+
+int compare_double(const void *elem1, const void *elem2){
+
+ double *l1, *l2;
+
+ l1 = (double*)elem1;
+ l2 = (double*)elem2;
+ return (*l1 < *l2 ? -1 : (*l1 > *l2 ? 1 : 0));
+}
+
+void print_int(void *e){
+
+ int d;
+
+ d = *((int*)e);
+ printf("%d ", d);
+}
+
+void print_double(void *e){
+
+ double d;
+
+ d = *((double*)e);
+ printf("%g ", d);
+}
+
+
+
+void write_edges(FILE *fileout, unsigned int *J_slap,
+ unsigned int *r_slap, unsigned int N){
+
+ unsigned int i, j;
+
+ for(i=0; i<N; i++){
+ for (j=r_slap[i]; j<r_slap[i+1]; j++){
+ if (J_slap[j] > i){
+ fprintf(fileout, "%d %d\n", i, J_slap[j]);
+ }
+ }
+ }
+}
+
+
+void write_edges_dir(FILE *fileout, unsigned int *J_slap,
+ unsigned int *r_slap, unsigned int N){
+
+ unsigned int i, j;
+
+ for(i=0; i<N; i++){
+ for (j=r_slap[i]; j<r_slap[i+1]; j++){
+ fprintf(fileout, "%d %d\n", i, J_slap[j]);
+ }
+ }
+}
+
+
+
+
+/* Check if j is a neighbour of i */
+int is_neigh(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ unsigned int i, unsigned int j){
+
+ unsigned int l;
+ unsigned int count;
+ count = 0;
+ if (i >=N || j >=N)
+ return 0;
+ for(l=r_slap[i]; l<r_slap[i+1]; l++){
+ if (J_slap[l] == j)
+ count ++;
+ }
+ return count;
+}
+
+
+/* Check if j is a neighbour of i, using bsearch.
+
+ BE CAREFUL!!!! THIS WORKS ONLY IF THE LIST OF NEIGHBOURS HAS BEEN
+ PREVIOUSLY SORTED APPROPRIATELY, E.G. BY CALLING
+ sort_neighbours()
+
+*/
+int is_neigh_bs(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ unsigned int i, unsigned int j){
+
+ unsigned int *ptr;
+
+ ptr = bsearch(&j, & (J_slap[r_slap[i]]), r_slap[i+1] - r_slap[i], sizeof(unsigned int),
+ compare_int);
+ return (ptr == NULL ? 0: 1);
+}
+
+int find_neigh_in_Jslap(unsigned int *J_slap, unsigned int *r_slap, unsigned int N,
+ unsigned int i, unsigned int j, unsigned int *ret){
+
+ unsigned int *ptr;
+
+ ptr = bsearch(&j, & (J_slap[r_slap[i]]), r_slap[i+1] - r_slap[i], sizeof(unsigned int),
+ compare_int);
+ if (ptr == NULL){
+ return 0;
+ }
+ else{
+ *ret = (ptr - J_slap);
+ return 1;
+ }
+}
+
+
+double get_neigh_weight(unsigned int *J_slap, unsigned int *r_slap, double *W_slap,
+ unsigned int N, unsigned int i, unsigned int j){
+
+ unsigned int l;
+ double w = 0.0;
+
+ for(l=r_slap[i]; l<r_slap[i+1]; l++){
+ if (J_slap[l] == j)
+ w += W_slap[l];
+ }
+ return w;
+}
+
+
+
+
+
+void sort_neighbours(unsigned int *J_slap, unsigned int *r_slap, unsigned int N){
+
+ unsigned int i, *base;
+
+ for(i=0; i<N; i++){
+ base = J_slap + r_slap[i];
+ qsort(base, r_slap[i+1] - r_slap[i], sizeof(unsigned int), compare_int);
+ }
+}
+
+double strength(unsigned int *r_slap, double *W_slap, int i){
+
+ double s = 0;
+ int j;
+
+ for(j = r_slap[i]; j<r_slap[i+1]; j++){
+ s += W_slap[j];
+ }
+ return s;
+
+}
+
+
+void convert_slap2ij(unsigned int *J_slap, unsigned int *r_slap, int N, unsigned int *I, unsigned int *J){
+
+ int i, j, num;
+
+ num = 0;
+ for(i=0; i<N; i++){
+ for(j=r_slap[i]; j< r_slap[i+1]; j++){
+ I[num] = i;
+ J[num] = J_slap[j];
+ num += 1;
+ }
+ }
+}
+
+void show_progress(FILE *fout, char *s, unsigned int progress, unsigned int total){
+
+ char str[21]; /* 20 spaces */
+ double frac;
+ int num_char, i;
+
+ if (total){
+ frac = 1.0*progress/total;
+ }
+ else{
+ frac = 0.0;
+ }
+
+ num_char = (int)(frac * 20) - 1;
+ i = 20;
+ while(--i >= 0){
+ if (i > num_char)
+ str[i] = ' ';
+ else
+ str[i] = '.';
+ }
+ str[20] = '\0';
+ fprintf(fout, "\r%s [%s] %3d%%\r", s, str, (int)(frac * 100));
+}
+
+
+void shuffle_vector(unsigned int *v, unsigned int N){
+
+ int i, pos;
+
+ for(i=N-1; i>=0; i--){
+ pos = rand() % N;
+ if (pos != i){
+ v[i] ^= v[pos];
+ v[pos] ^= v[i];
+ v[i] ^= v[pos];
+ }
+ }
+}
+
+
+unsigned int read_partition(FILE *fin, unsigned int N, unsigned int *part){
+
+ unsigned int i;
+ char *ptr;
+ char buff[256];
+ unsigned int max_part = 0, val;
+
+
+ while(fgets(buff, 256, fin)){
+ if (buff[0] == '#')
+ continue;
+ ptr = strtok(buff, " "); /* read the node */
+ VALID_PTR_OR_EXIT(ptr, 7);
+ i = atoi(ptr);
+ if(i >= N){
+ fprintf(stderr, "Index %d out of bounds (0, %d) in read_partition (%s: %d)\n",
+ i, N, __FILE__, __LINE__);
+ }
+ ptr = strtok(NULL, " "); /* read the partition number */
+ VALID_PTR_OR_EXIT(ptr, 7);
+ val = atoi(ptr);
+ if (val > max_part){
+ max_part = val;
+ }
+ part[i] = val;
+ }
+ return max_part;
+}
+
+int degree(unsigned int *r_slap, unsigned int i){
+
+ return r_slap[i+1] - r_slap[i];
+}
+
+int my_strcasecmp(const char *s1, const char *s2){
+
+ char *c1, *c2;
+ int l1, l2;
+ int res, i;
+
+ l1 = strlen(s1);
+ l2 = strlen(s2);
+
+ c1 = malloc((1 + l1) * sizeof(char));
+ c2 = malloc((1 + l2) * sizeof(char));
+
+ for (i=0; i<l1; i++){
+ c1[i] = tolower(s1[i]);
+ }
+ c1[i] = '\0';
+
+ for (i=0; i<l2; i++){
+ c2[i] = tolower(s2[i]);
+ }
+ c2[i] = '\0';
+
+ res = strcmp(c1, c2);
+ free(c2);
+ free(c1);
+ return res;
+}
+
diff --git a/src/ws/Makefile.am b/src/ws/Makefile.am
new file mode 100644
index 0000000..feae397
--- /dev/null
+++ b/src/ws/Makefile.am
@@ -0,0 +1,5 @@
+include ../common.mk
+bin_PROGRAMS = ws
+ws_SOURCES = ws.c ../utils/utils.c ../include/utils.h
+ws_LDADD = -lm
+
diff --git a/src/ws/Makefile.in b/src/ws/Makefile.in
new file mode 100644
index 0000000..9e716e4
--- /dev/null
+++ b/src/ws/Makefile.in
@@ -0,0 +1,578 @@
+# 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 = :
+bin_PROGRAMS = ws$(EXEEXT)
+subdir = src/ws
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_ws_OBJECTS = ws.$(OBJEXT) ../utils/utils.$(OBJEXT)
+ws_OBJECTS = $(am_ws_OBJECTS)
+ws_DEPENDENCIES =
+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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(ws_SOURCES)
+DIST_SOURCES = $(ws_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+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 = @docdir@
+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@
+AM_CFLAGS = -I../include -O2 -std=c99 -Wall
+ws_SOURCES = ws.c ../utils/utils.c ../include/utils.h
+ws_LDADD = -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../common.mk $(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 src/ws/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/ws/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;
+$(srcdir)/../common.mk $(am__empty):
+
+$(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-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+../utils/$(am__dirstamp):
+ @$(MKDIR_P) ../utils
+ @: > ../utils/$(am__dirstamp)
+../utils/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ../utils/$(DEPDIR)
+ @: > ../utils/$(DEPDIR)/$(am__dirstamp)
+../utils/utils.$(OBJEXT): ../utils/$(am__dirstamp) \
+ ../utils/$(DEPDIR)/$(am__dirstamp)
+
+ws$(EXEEXT): $(ws_OBJECTS) $(ws_DEPENDENCIES) $(EXTRA_ws_DEPENDENCIES)
+ @rm -f ws$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ws_OBJECTS) $(ws_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ../utils/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../utils/$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ws.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+ -rm -f ../utils/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ../utils/$(am__dirstamp)
+
+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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ../utils/$(DEPDIR) ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
+ distclean distclean-compile distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binPROGRAMS install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# 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/src/ws/ws.c b/src/ws/ws.c
new file mode 100644
index 0000000..bfbe102
--- /dev/null
+++ b/src/ws/ws.c
@@ -0,0 +1,204 @@
+/**
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * (c) Vincenzo Nicosia 2009-2017 -- <v.nicosia@qmul.ac.uk>
+ *
+ * This file is part of NetBunch, a package for complex network
+ * analysis and modelling. For more information please visit:
+ *
+ * http://www.complex-networks.net/
+ *
+ * If you use this software, please add a reference to
+ *
+ * V. Latora, V. Nicosia, G. Russo
+ * "Complex Networks: Principles, Methods and Applications"
+ * Cambridge University Press (2017)
+ * ISBN: 9781107103184
+ *
+ ***********************************************************************
+ *
+ * This program creates a network using the Watts-Strogatz
+ * small-world network model.
+ *
+ * References:
+ *
+ * D. J. Watts and S. H. Strogatz. "Collective dynamics of
+ * 'small-world' networks". Nature 393 (1998), 440–442.
+ *
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include "utils.h"
+
+void usage(char *argv[]){
+ printf("********************************************************************\n"
+ "** **\n"
+ "** -*- ws -*- **\n"
+ "** **\n"
+ "** Create a graph with 'N' nodes, using the Watts-Strogatz **\n"
+ "** small-world network model. The algorithm starts from a **\n"
+ "** circle graph with 'N' nodes and m*N edges, i.e. by putting **\n"
+ "** the 'N' nodes around a circle, so that each node is **\n"
+ "** connected to the 'm' closest nodes in the circle on each **\n"
+ "** direction. Then, each edge is rewired at random with **\n"
+ "** probability equal to 'p'. **\n"
+ "** **\n"
+ "** The output is an edge list in the format: **\n"
+ "** **\n"
+ "** I_1 J_1 **\n"
+ "** I_2 J_2 **\n"
+ "** I_3 J_3 **\n"
+ "** ... ... **\n"
+ "** I_K J_K **\n"
+ "** **\n"
+ "** If 'SHOW' is specified as a fourth parameter, the program **\n"
+ "** prints on STDERR the number of edges that were actually **\n"
+ "** rewired. **\n"
+ "** **\n"
+ "********************************************************************\n"
+ " This is Free Software - You can use and distribute it under \n"
+ " the terms of the GNU General Public License, version 3 or later\n\n"
+ " (c) Vincenzo Nicosia 2010-2017 (v.nicosia@qmul.ac.uk)\n\n"
+ "********************************************************************\n\n"
+ );
+ printf("Usage: %s <N> <m> <p> [SHOW]\n\n" , argv[0]);
+}
+
+
+
+/**
+ *
+ * This function checks if j is a neighbour of i, looking into the
+ * m positions of J starting at i*m
+ *
+ * In practice, the assumption is that J contains the m neighbours of
+ * node 0 in the first m positions, then the m neighbours of node 1,
+ * and to forth
+ *
+ */
+
+int __ws_is_neigh(unsigned int i, unsigned int j, unsigned int *J, unsigned int m){
+
+ int k;
+
+ for(k = i*m; k< (i+1)*m; k++){
+ if (J[k] == j)
+ return 1;
+ }
+ return 0;
+}
+
+
+int create_circle(unsigned int N, unsigned int m, unsigned int **J){
+
+ int K;
+ int i, j, l;
+
+ K = N *m;
+
+ *J = malloc(K * sizeof(unsigned int));
+
+ K = 0;
+
+ for(i=0; i<N; i++){
+ for(j=0; j < m; j++){
+ l = (i + j + 1) % N;
+ (*J)[K] = l;
+ K += 1;
+ }
+ }
+ return K;
+}
+
+
+
+int ws(unsigned int *J, unsigned int N, unsigned int m, double p){
+
+ unsigned int i, j, l, l1, num_rewire;
+
+ double xi;
+
+ num_rewire = 0;
+
+ for(i=0; i<N; i++){
+ for(j=0; j<m; j++){
+ l = (i+j) % N;
+ xi = 1.0 * rand() / RAND_MAX;
+ if (xi < p){
+ l1 = (int)(rand() % N);
+ if( (l1 != i) &&
+ (l1 != l) &&
+ !(__ws_is_neigh(i, l1, J, m))){
+ /* replace (i,l) with (i,l1) */
+ J[m * i + j] = l1;
+ num_rewire += 1;
+ }
+ else{
+ /* do nothing */
+ }
+ }
+ }
+ }
+ return num_rewire;
+}
+
+
+void dump_edges(unsigned int *J, unsigned int N, unsigned int m){
+
+ int i, j;
+
+ for(i=0; i<N; i++){
+ for(j=0; j<m; j++){
+ printf("%d %d\n", i, J[(m*i)+j]);
+ }
+ }
+}
+
+
+int main(int argc, char *argv[]){
+
+ int N, m, num_rewire;
+ unsigned int *J;
+ double p;
+
+ if(argc < 4){
+ usage(argv);
+ exit(1);
+ }
+
+ J = NULL;
+
+ N = atoi(argv[1]);
+ m = atoi(argv[2]);
+ p = atof(argv[3]);
+
+ create_circle(N, m, &J);
+
+
+ srand(time(NULL));
+
+ num_rewire = ws(J, N, m, p);
+ if (argc > 4 && !my_strcasecmp("SHOW", argv[4])){
+ fprintf(stderr, "Rewired edges: %d\n", num_rewire);
+ }
+ dump_edges(J, N, m);
+ free(J);
+}