aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2012-06-01 18:41:24 +0000
committerSimon Tatham <anakin@pobox.com>2012-06-01 18:41:24 +0000
commita46f06e90e6fc8e229c13437135b61ad97871174 (patch)
tree83371c33bf18b9e918f8ca36f7c256e22060f4f9
parent9f87d6fda5f1880881ea14ab54802fcd5581a02c (diff)
downloadpuzzles-a46f06e90e6fc8e229c13437135b61ad97871174.zip
puzzles-a46f06e90e6fc8e229c13437135b61ad97871174.tar.gz
puzzles-a46f06e90e6fc8e229c13437135b61ad97871174.tar.bz2
puzzles-a46f06e90e6fc8e229c13437135b61ad97871174.tar.xz
Remove the speed optimisation in the stage 3 solver which makes the
first loop only handle rightward or downward bridges (on the basis that that way every bridge is looked at once rather than twice). This seems to be breaking in the wake of recent changes to the solver, in cases such as when island A is left of island B and has enough other outgoing edges that only one bridge remains to potentially go to B, but B is as yet unconstrained. In this situation the only code which is able to adjust the maximum bridge count for that edge is the stage 3 solver (nothing else calls solve_join with is_max true), but it will only do so if it _tries_ putting two bridges there and finds it impossible, and when it starts from island A it won't even try. Game ID which was insoluble just before this commit: 15x15m2:2a4d3b3c2h2d2a2a3c3w4a3m1d1a4a5a2d4d6e4q3e6a2a1e1b2g3a3o2g1d32l4b2c3a4c2b22l4a This probably means I've done something else in recent checkins which was not in accordance with the original solver design. However, this fix will do for the moment. [originally from svn r9548]
-rw-r--r--bridges.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/bridges.c b/bridges.c
index 441173c..0717a88 100644
--- a/bridges.c
+++ b/bridges.c
@@ -1538,10 +1538,6 @@ static int solve_island_stage3(struct island *is, int *didsth_r)
if (missing <= 0) return 1;
for (i = 0; i < is->adj.npoints; i++) {
- /* We only do right- or down-pointing bridges. */
- if (is->adj.points[i].dx == -1 ||
- is->adj.points[i].dy == -1) continue;
-
x = is->adj.points[i].x;
y = is->adj.points[i].y;
spc = island_adjspace(is, 1, missing, i);