I'm trying to write 8-puzzle solver but I couldn't yet: I use Manhattan priority function and I wonder, how to make choice between descendant board arrangements if they have the equal priority values.
For example:
this is initial board arrangement:
8 1 3
4 2
7 6 5
and its descendants board arrangements:
I
8 1 3
4 6 2
7 5
Manhattan distance + move Number = 10
II
8 3
4 1 2
7 6 5
Manhattan distance + move Number = 12
III
8 1 3
4 2
7 6 5
Manhattan distance + move Number = 10
which board arrangement should program choose? I or III ???