Added random choice for equal nodes to greedy, should solve any puzzle.