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]
This commit is contained in:
Simon Tatham
2012-06-01 18:41:24 +00:00
parent 9f87d6fda5
commit a46f06e90e

View File

@ -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);