Skip to content

Commit 3496148

Browse files
committed
Header output fixed, Readme updated
1 parent 548df6d commit 3496148

File tree

2 files changed

+30
-19
lines changed

2 files changed

+30
-19
lines changed

README.md

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Original sources:
3030
- [Changelog](#changelog)
3131
- [Related Projects](#related-projects)
3232

33-
## Compilation
33+
## Compilation
3434

3535
In order to compile, type: `$ make`
3636

@@ -41,22 +41,31 @@ To run the program, type:
4141
./benchmark [FLAG] [P]
4242
4343
[FLAG] [P]
44-
-N number of nodes
45-
-k average degree
46-
-maxk maximum degree
47-
-mut mixing parameter for the topology
48-
-muw mixing parameter for the weights
49-
-beta exponent for the weight distribution
50-
-t1 minus exponent for the degree sequence
51-
-t2 minus exponent for the community size distribution
52-
-minc minimum for the community sizes
53-
-maxc maximum for the community sizes
54-
-on number of overlapping nodes
55-
-om number of memberships of the overlapping nodes
56-
-C [average clustering coefficient]
44+
-N [number of nodes]
45+
-k [average degree]
46+
-maxk [maximum degree]
47+
-mut [mixing parameter for the topology]
48+
-muw [mixing parameter for the weights]
49+
-beta [exponent for the weight distribution]
50+
-t1 [minus exponent for the degree sequence]
51+
-t2 [minus exponent for the community size distribution]
52+
-minc [minimum for the community sizes]
53+
-maxc [maximum for the community sizes]
54+
-on [number of overlapping nodes]
55+
-om [number of memberships of the overlapping nodes]
56+
-C [Average clustering coefficient]
57+
-cnl [output communities as strings of nodes (input format for NMI evaluation)]
58+
-name [base name for the output files]. It is used for the network, communities and statistics; files extensions are added automatically:
59+
.nsa - network, represented by space/tab separated arcs
60+
.nse - network, represented by space/tab separated edges
61+
{.cnl, .nmc} - communities, represented by nodes lists '.cnl' if '-cnl' is used, otherwise as a nodes membership in communities '.nmc')
62+
.nst - network statistics
63+
-seed [file name of the random seed, default: seed.txt]
64+
-a [yield directed network (arcs) rather than undirected (edges), default: edges]
65+
5766
```
5867

59-
In this program you can assign the number of overlapping nodes (option -on) and assign the number of memberships for them (option `-om`). The other nodes will have only one membership. For instance, typing
68+
In this program you can assign the number of overlapping nodes (option -on) and assign the number of memberships for them (option `-om`). The other nodes will have only one membership. For instance, typing
6069
```
6170
./benchmark [flags...] -N 1000 -on 20 -om 2
6271
```
@@ -109,7 +118,9 @@ Thanks to:
109118

110119
## Changelog
111120
Additionally implemented features on top of the original LFR Benchmark are the following:
112-
- Parameter `-cnl` (ommunity nodes list) added to output communities (clusters) as lists of
121+
- Parameter `-a` added to specify directed (arcs) / undirected (edges) output network
122+
- Parameter `-seed` added for the custom seed filename
123+
- Parameter `-cnl` (community nodes list) added to output communities (clusters) as lists of
113124
nodes to be compatible with NMI evaluation input format (.cnl)
114125
- Parameter `-name` added to give custom name for the output files
115126
- `maxk` is automatically decreased if required for the network generation with the specified `k`

Sources/benchm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ int print_network(deque<set<int> > & E, const deque<deque<int> > & member_list,
105105

106106

107107
ofstream out1(fnameNetwork.c_str());
108+
// Output the header
109+
out1 << "# Nodes: " << num_nodes << ", " << (directed ? "Arcs" : "Edges") << ": "
110+
<< (directed ? arcs : arcs / 2) << " Weighted: 1" << endl;
108111
for (int u=0; u<E.size(); u++) {
109112

110113
set<int>::iterator itb=E[u].begin();
111114

112-
// Output header
113-
out1 << "# Nodes: " << num_nodes << ", " << (directed ? "Arcs" : "Edges") << ": "
114-
<< (directed ? arcs : arcs / 2) << " Weighted: 1" << endl;
115115
while (itb!=E[u].end())
116116
if(directed || u <= *itb)
117117
out1<<u+1<<"\t"<<*(itb++)+1<<"\t"<<neigh_weigh[u][*(itb)]<<endl;

0 commit comments

Comments
 (0)