Input/Output Issue

The input file represents the network. It should be formatted as a space-delimited file, where each line contains the start node, destination node, and an optional edge weight.

testNetwork

The test network. It is undirected and unweighted.

testIn

The input file for the test network.

Let s denote the start node, d the destination node, and w the weight of the edge connecting s and d. The Java implementation only accepts a line if s < d. For example, a line containing 0 1 will be accepted, but a line of 1 0 will not. This issue became apparent when Christina and I tried to run the karate network, which was formatted such that s > d.

To fix this, I removed the pieces of code that reject lines where s > d. However, other parts of the code depended on the fact that s < d. So, I included code that accepts the line but flips the two nodes. That is, if s > d, then the code will switch the nodes so that, (s = d) < (d = s). This isn’t a perfect solution since it doesn’t correctly deal with directed graphs, but it’s consistent to what the implementation of the CNM algorithm does. And like the implementation of the CNM algorithm, the input file should contain no self loops, no duplicates, and no multi-edges.

I’ve also standardized the output to the previous data I’ve collected. The left column of the output file lists the vertices, and the right column lists the community ID to which the vertices belong

testOutThe output file for the test network.