Talk:LA - Eyeball Benders

No team was able to solve this problem at the ICPC world finals. With a little thought, however, some aspects of the algorithm can be reasoned out.

There are at most 50 line segments in both the puzzle and solution images. We are guaranteed that one of the endpoints in the puzzle is a valid endpoint in the solution (if the puzzle is valid). Attempting to match each endpoint in the puzzle image to an endpoint in the solution image is only O(n2), on the order of 10,000 in the worst case.

Furthermore, the segments are all rectilinear (parallel to the x-axis or y-axis). By creating sorted arrays of x-coordinates and y-coordinates, the line segments could be mapped out like on a sheet of graph paper. The rows are the y-coordinates and the columns are the x-coordinates observed in the input data. By observing the consecutive differences in x's and y's for the puzzle and solution arrays, we can calculate a list of possible magnification factors. Testing each magnification factor at each endpoint-to-endpoint matching may, in fact, run in time. (But this doesn't mean that it's trivial to program!) --Jeff 14:10, 9 Sep 2005 (EDT)