diff louvain/main_random.cpp @ 0:1d1b9e1b2e2f draft

Uploaded
author petr-novak
date Thu, 19 Dec 2019 10:24:45 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/louvain/main_random.cpp	Thu Dec 19 10:24:45 2019 -0500
@@ -0,0 +1,19 @@
+using namespace std;
+
+char *outfile  = NULL;
+
+int
+main(int argc, char **argv) {
+  srand(time(NULL)+getpid());
+
+  int n = atoi(argv[1]);
+  int degree = atoi(argv[2]);
+
+  for (unsigned int i=0 ; i<n ; i++) {
+    for (unsigned int j=0 ; j<n ; j++) {
+      int r  = rand()%n;
+      if (r<degree)
+        cout << i << " " << j << endl;
+    }
+  }
+}