import java.util.*;

public class Solver
{
    public Solver (boolean debug)
    {
        _debug = debug;
    }

    /**
     * Loop through the tiles and find out how many of them have matching edges. Then,
     * based upon the number of shared edges we do the following:
     * 
     * 0: ERROR!!
     * 1: If a tile has only one matching edge, then it's easy to say where it needs
     * to be placed.
     * 2: Work outwards from the centre.
     */

    public boolean solve (Tile theTile, Tile toCheck)
    {
        for (int i = 0; i < 4; i++)
        {
            if (theTile.connectBottomToTop(toCheck) || theTile.connectTopToBottom(toCheck) ||
                theTile.connectLeftToRight(toCheck) || theTile.connectRightToLeft(toCheck))
            {
                return true;
            }

            if (!toCheck.isFrozen())
                toCheck.rotate();
        }
        
        if (!toCheck.isFrozen())
            toCheck.invert();
    
        for (int i = 0; i < 4; i++)
        {
            if (theTile.connectBottomToTop(toCheck) || theTile.connectTopToBottom(toCheck) ||
                theTile.connectLeftToRight(toCheck) || theTile.connectRightToLeft(toCheck))
            {
                return true;
            }
        }

        return false;
    }

    private boolean _debug;
}
@@ -465,21 +465,174 @@
 lic 
-boolean solve
+Vector%3CTile%3E solve (Vector%3CTile%3E tiles)%0A    %7B%0A        Vector%3CTile%3E cornerTiles = new Vector%3CTile%3E();%0A%0A        return cornerTiles;%0A    %7D %0A%0A    private boolean connects
  (Ti

Update Solver.java