15 puzzle solver: Difference between revisions

Content added Content deleted
Line 4,607:
=={{header|Scala}}==
 
===Idea===
 
Using a weighted A* (not sure if this is the right terminology).
Normally A* sums the heuristic (h) + steps travelled (t) so far. Here we added additional weighting A* = wH * h + wT * t
 
 
===Solver===
<lang Scala>
import scala.collection.mutable
Line 4,705 ⟶ 4,712:
 
{{out}}
 
===Main task===
<pre>
Exploring 698181 states, found solution with length 52 for board:
Line 4,715 ⟶ 4,724:
Total time: 48.884 seconds
</pre>
===Extra credits ===
 
Extra credits, not optimum solution but fast, using heuristic twice as the travel weight.