Skip to content

Instantly share code, notes, and snippets.

@vasia
Created March 7, 2015 12:30
Show Gist options
  • Save vasia/ad68268118b6f895cf7c to your computer and use it in GitHub Desktop.
Save vasia/ad68268118b6f895cf7c to your computer and use it in GitHub Desktop.
@Test
public void testFullyConnectedUndirected() throws Exception {
final String testEdges = "1 2\n" + "2 1\n" +
"1 3\n" + "3 1\n" +
"1 4\n" + "4 1\n" +
"2 3\n" + "3 2\n" +
"2 4\n" + "4 2\n" +
"3 4\n" + "4 3\n";
String edgesPath = createTempFile(testEdges);
LocalClusteringCoefficientExample.main(new String[] {edgesPath, resultPath});
expectedResult = "1,1\n" +
"2,1\n" +
"3,1\n" +
"4,1\n";
}
@Test
public void testFullyConnectedDirected() throws Exception {
/*
* Test Local Clustering Coefficient on the default data
*/
final String testEdges = "1 2\n" +
"1 3\n" +
"1 4\n" +
"2 3\n" +
"2 4\n" +
"3 4\n" ;
String edgesPath = createTempFile(testEdges);
LocalClusteringCoefficientExample.main(new String[] {edgesPath, resultPath});
expectedResult = "1,0.5\n" +
"2,0.5\n" +
"3,0.5\n" +
"4,0.5\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment