8-puzzle solver with flexible node selection