Please see attached for details. You can use either A* or Floyd-Warshall algorithm to accomplish this. One way that I think might work is to divide the path into 3 sections. Finding the shortest path from node 16 to 3 then from 3 to 11 and then from 11 to 16. We also need to find the shortest path from 16 to 11 then from 11 to 3 and from 3 to 16. And then compare the two results.
In terms of programming language you can use any language that you are comfortable with.