You are overthinking it. There are only six (3*2*1) possible paths through the three intermediate nodes. Just check them all.
For larger instances, you could reduce your problem to the TSP as follows:
If s
is the starting node and t
is the final node, add a zero-weight edge between s
and t
and an infinitely-heavy edge between s
and every other node, and between t
and every other node.
The problem is NP-hard, but is extremely well-researched. There is a plethora of exact and approximate algorithms that you could explore.