chiark / gitweb /
Prune by symmetry: constrain 1st adj row to all 1s at low end. v1
authorSimon Tatham <anakin@pobox.com>
Sat, 8 Mar 2014 00:19:41 +0000 (00:19 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 8 Mar 2014 00:19:41 +0000 (00:19 +0000)
main.c

diff --git a/main.c b/main.c
index 83728fa..6f0df72 100644 (file)
--- a/main.c
+++ b/main.c
@@ -329,6 +329,8 @@ static void iterate_recurse(int i, AdjWord min) {
        adjmatrix[i]++) {
     if (count_set_adj_bits(adjmatrix[i]) > maxhamweight)
       goto again;
        adjmatrix[i]++) {
     if (count_set_adj_bits(adjmatrix[i]) > maxhamweight)
       goto again;
+    if (i == 0 && (adjmatrix[i] & (1+adjmatrix[i])))
+      goto again;
 
     iterate_recurse(i+1, adjmatrix[i]);
 
 
     iterate_recurse(i+1, adjmatrix[i]);