With giving an initial 4 digit number (each digit in [1,4]) by shifting the digits and finding the number 1234 with a Breadth First Search approach.
The left child shifts first and second , middle child shifts second and third, right child shifts the third and fourth digits until it reaches 1234 as shown in the figure.