15 puzzle solver: Difference between revisions

Content added Content deleted
Line 4,610: Line 4,610:
Normally A* sums the heuristic (h) + steps travelled (t) so far.
Normally A* sums the heuristic (h) + steps travelled (t) so far.


In this solution, we added additional weighting A* = wH * h + wT * t. The reason behind adding this weighting is so that we can fiddle with how much state exploration we want to do. For example, for the main task weighting chosen is wH = 5, wT = 4 so we manage to converge to find one of the 52 steps solution. For the extra credits we choose wH = 2, wT = 1, because it seems to be much higher and we just wanted to find one solution although it is not optimum.
In this solution, we added additional weighting A* = wH * h + wT * t. The reason behind adding this weighting is so that we can fiddle with how much state exploration we want to do. For example, for the main task weighting chosen is wH = 5, wT = 4 so we manage to converge to find one of the 52 steps solution. For the extra credits we choose wH = 2, wT = 1, because we wanted to find fast a solution without exploring much (well I tried, not much luck yet).


The more weight given to the heuristics, the less number of states are explored, with the trade off that solution becomes not optimal (longer than expected). As you can see on the output, we found minimum solution for the easy problem, meanwhile with above setting the hard problem was not really solved, it explore only few states and found an unoptimal solution with 106 length.
The more weight given to the heuristics, the less number of states are explored, with the trade off that solution becomes not optimal (longer than expected). As you can see on the output, we found minimum solution for the easy problem, meanwhile with above setting the hard problem was not really solved, it explore only few states and found an unoptimal solution with 106 length.