NUmber of ways of going from A to D are : multiplication of number of ways of going from A to B, and number of ways of going from B to C, and the number of ways of going from C to D....
This is because each of the routes or ways of travelling is independent of others.
So ways of going from A to D are 4 * 2 * 3 = 24
Now, on the way return from D to A, If no part of the route is to be traced back, then the possible ways left are 2 from D to C, 1 from C to B, and 3 from B to A.
Hence number of ways of choosing new routes on the return are :
2 * 1 * 3 = 6.
The total number of ways of going from A to D and returning back to A, are :
24 * 6 = 144.
This answer will change if a part of the route can be traced back.. like A to B or B to C etc.. That number will be much more.