chiark / gitweb /
graphviz: annotate dropped weakest Schwartz set edges
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 6 Feb 2014 01:19:31 +0000 (01:19 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 6 Feb 2014 01:19:31 +0000 (01:19 +0000)
compute

diff --git a/compute b/compute
index 58b3587d69cc216827e8e7a1f23987f0aae51c60..72e525935e7925b57aa03147c02735fe9f44c146 100755 (executable)
--- a/compute
+++ b/compute
@@ -339,12 +339,12 @@ foreach my $ix (0..$#ch) {
 
 our $schwartz;
 
-for (;;) {
+for (my $dropiter = 1; ; $dropiter++) {
     # loop from A6(5)
 
     print "defeats graph: $defeats\n";
 
-    print "\nTransitive closure A.6(5)\n";
+    print "\nTransitive closure A.6(5) (iteration $dropiter)\n";
 
     my $tdefeats = $defeats->transitive_closure();
 
@@ -400,6 +400,11 @@ for (;;) {
        my ($ca,$cb) = @$weakest;
        print "a weakest defeat is $ca > $cb\n";
        $defeats->delete_edge($ca,$cb);
+       my $label = $showg->get_edge_attribute($ca,$cb,'label');
+       $label .= "\ndropped - weakest in iter.$dropiter";
+       $showg->set_edge_attribute($ca,$cb,'label',$label);
+       $showg->set_edge_attribute($ca,$cb,'style','dotted');
+       $showg->set_edge_attribute($ca,$cb,'graphviz',{constraint=>0});
     }
 
     print "\nDefeats within the Schwartz set, go round again\n";