[Swift-commit] r5996 - SwiftApps/SciColSim
wilde at ci.uchicago.edu
wilde at ci.uchicago.edu
Sat Oct 27 08:57:03 CDT 2012
Author: wilde
Date: 2012-10-27 08:57:02 -0500 (Sat, 27 Oct 2012)
New Revision: 5996
Added:
SwiftApps/SciColSim/trimgraph.sh
Log:
Tool to create test subsets of Andrey's big 1.3M node graph.
Added: SwiftApps/SciColSim/trimgraph.sh
===================================================================
--- SwiftApps/SciColSim/trimgraph.sh (rev 0)
+++ SwiftApps/SciColSim/trimgraph.sh 2012-10-27 13:57:02 UTC (rev 5996)
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+vertices=${1:-100}
+fraction=${2:-1.0}
+
+tmp=$(mktemp)
+
+awk '
+NR == 1 { }
+
+(NR > 1) && ($1 < n) && ($2 < n) && (rand() < fraction) { print $1, $2 }
+' n=$vertices fraction=$fraction <graph.big >$tmp
+
+edges=$(wc -l <$tmp)
+
+echo $vertices $edges
+cat $tmp
+rm $tmp
+
+
+
+
Property changes on: SwiftApps/SciColSim/trimgraph.sh
___________________________________________________________________
Added: svn:executable
+ *
More information about the Swift-commit
mailing list