chiark / gitweb /
graphviz: label the edges
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 6 Feb 2014 00:55:22 +0000 (00:55 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 6 Feb 2014 00:55:22 +0000 (00:55 +0000)
compute

diff --git a/compute b/compute
index 4021eb7db6c56537ca59f7b69449a643bc4cc83f..f7f3f679ea0bf1a4711011f0256b7d4a09e2fe99 100755 (executable)
--- a/compute
+++ b/compute
@@ -304,6 +304,11 @@ foreach my $ia (chremain()) {
        print "defeat: $choices[$ia] beats $choices[$ib]",
            " ($vab > $vba = +$diff)\n";
        $defeats->add_edge($choices[$ia],$choices[$ib]);
        print "defeat: $choices[$ia] beats $choices[$ib]",
            " ($vab > $vba = +$diff)\n";
        $defeats->add_edge($choices[$ia],$choices[$ib]);
+       my $label = "$diff($vab:$vba)";
+       $label .= "\n". join ' ', @{ $vab[$ia][$ib] };
+       $label .= "\n/". join ' ', @{ $vab[$ib][$ia] };
+       $defeats->set_edge_attribute($choices[$ia],$choices[$ib],
+                                    label => $label);
     }
 }
 
     }
 }