]> granicus.if.org Git - graphviz/commitdiff
Fix script to avoid loops and store multiple edge count in multiplicity rather than...
authorEmden Gansner <emdenrg@google.com>
Wed, 21 Oct 2015 18:16:33 +0000 (14:16 -0400)
committerEmden Gansner <emdenrg@google.com>
Wed, 21 Oct 2015 18:16:33 +0000 (14:16 -0400)
cmd/gvpr/lib/binduce

index c644f7b191d556ce8b41e6e2b1d9bc4a26b4ec9f..847a905e078556544e42861aa9775034c9cc60da 100644 (file)
@@ -29,7 +29,7 @@ N[aget($,aname)==value] {
       else if ($G.directed && (e = isEdge(nbrs[i+1],nbrs[i],""))) {
         wt[e] += 1;
       }
-      else {
+      else if (nbrs[i] != nbrs[i+1]) { // avoid loops
         e = edge(nbrs[i],nbrs[i+1],"");
         wt[e] = 1;
       }
@@ -40,6 +40,6 @@ N[aget($,aname)==value] {
 }
 END_G{
   for (wt[e]) {
-    e.weight = sprintf ("%d", wt[e]);
+    e.multiplicity = sprintf ("%d", wt[e]);
   }
 }