Jump to content

15 puzzle solver: Difference between revisions

Line 4,610:
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 itwe seemswanted to befind muchfast highera andsolution wewithout justexploring wantedmuch to(well findI onetried, solutionnot althoughmuch it is notluck optimumyet).
 
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.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.