private Solution depthFirstSearch(Node selectedNode, Puzzle puzzle,
			int currentCostBound) {
		if (puzzle.getGoalTest().isGoalState(selectedNode.getState()))
			return new Solution(selectedNode, nodeExpanded);
		nodeExpanded++;
		LinkedList<Node> expansion = selectedNode.expandNode();
		for (Node n : expansion) {
			n.setH(heuristic.h(n));
			n.setF(n.getG() + n.getH());
			int value = n.getF();
			if (value <= currentCostBound) {
				Solution result = depthFirstSearch(n, puzzle, currentCostBound);
				if (result.getN() != null)
					return result;
			}
		}
		return new Solution(null, 0);
	}