Introduction
$ \begin{array}{} \begin{array}{c|c|c} \text{1} & \text{SIZE}\\ \hline 2 & \\ 3 & \\ 4 & \\ 5 & \\ \hline 6 & \text{RANK} \end{array} & \begin{array}{c|c|c} 1 & \text{SIZE}\\ \hline 2 & \text{SINE} \\ 3 & \text{LINE} \\ 4 & \text{LINK} \\ 5 & \text{RINK} \\ \hline 6 & \text{RANK} \end{array} \end{array} $
On the left is an example of a Word Ladder puzzle, invented (allegedly) by Lewis Carroll. One possible solution is on the right. The aim is to place a valid word in each row that is the same as the one preceding it except for one letter change. There are four words to fill in, so there are five letter changes between the start and end: at least one additional letter must be introduced (the L in line 3 of my example.)
I got to wondering how many possible solutions a given puzzle may have. Puzzles vary in this because of the restriction that all words must be valid, but if we use numbers instead of words that restriction disappears. Furthermore, in the word problem all eight of the given letters are different, but in my digital version I want to allow duplicates.
So I am attempting to calculate the number of ways that one $4$-digit number may be changed into another, changing one digit at a time, such that all the $4$-digit numbers are different, and five changes are made (so over six lines). Leading $0$'s and duplicate digits are allowed.
First case and a solution
The easiest case to enumerate is where none of the digits in the final row are in the same position in the starting row (e.g. changing $1234$ into $5678$ or changing $1234$ into $4321$). Four of the five digit changes are "fixed" in that once a digit is placed in its correct position in the final row it can't be changed. The other change I call "free" in that it doesn't appear in that position in the final row, so any valid digit will do.
Here is an example using numbers: \begin{array}{ll} 1234 & \text{ Start}\\ \hline 5234 & 5 \text{ is fixed}\\ 5634 & 6 \text{ is fixed}\\ 5639 & 9 \text{ is free}\\ 5679 & 7 \text{ is fixed}\\ \hline 5678 & 8 \text{ is fixed} \end{array}
The four fixed digits can appear in any order, and so these lines contribute a factor of $4!$ to the total.
Which leaves the line containing the free digit. The number of possibilities for this line depends on when it is introduced: as more of the fixed digits are put in position, there are fewer places for the free digit to go. Although all 10 digits are theoretically available, each line must be different to the one(s) preceding it (i.e. one digit must change each time), and the free digit must not be the same as the digit in the same position in the final line (or it wouldn't be free). So only eight digits are available.
The possibilities of what can happen where are:
\begin{array}{clcc}
\text{Line}^1 & \text{Positions available} & \text{Possible lines}\\
\hline
2 & 4 & 32\\
3 & 3 & 24\\
4 & 2 & 16\\
5 & 1 & \phantom{0}8
\end{array}
$^1$ i.e. the line in which the free digit is introduced.
So the line containing the free digit can appear in $32+24+16+8 = 80$ ways.
Putting all this together, there are $24 \cdot 80 = 1920$ possible ways to complete each game.
Other cases
The next case is where one of the target digits is already in position, e.g. changing $1234$ into $1678$. There are two cases here:
i) force the target digit already in position to change. Another line then has to be used up to change it back again, so there is room for only one free digit.
ii) do not change the target digit already in position. The problem becomes one of changing the other three digits over five lines, so two free digits are required. There are $\binom42 = 6$ ways in which they can be introduced (the final change must be fixed, not free). This gives six sub-cases of varying complexity. As above, the number of possibilities depends on when the free digits come in. I shan't take up time and space describing them here.
The remaining cases (changing $1234$ into $1278$ (up to three free digits) and changing $1234$ into $1238$ (up to four free digits)) have increasing complexity.
My question
Is there an easier way to enumerate all this? Maybe consider the whole problem in one go rather than considering all these cases? Or a different way to divide into cases that makes for easier computation?