my point is that cost "thru nodes" can be drastically different than cost "around nodes"
For example, picture this
B
A C E
D
Cost to got thru C to get to E is much smaller than looping around B or D to get to E.
For the latter, you cant just do sqrt((Ex-Ax)^2+(Ey-Ay)^2) because the Y component could be as small as 0
you would need to do A to offset B + offset B to E to get to get true cost of that path.
What if
B
A C E
D
A, offset B, E has a different cost than A, offset D, E...so need true cost of each path to find shortest.
these examples ignore the possibility that B,C,D are spread out enough that you can go thru one of the gaps
maybe what you need to do is
1) realign nodes to the nearest 20mm or introduce fixed gaps for very close nodes (ie bring some order to node location)
2) compute lowest cost that should be different enough that some of the cases can be dismissed quickly.
3) maybe draw a multi segment line you can see what your algorithm pickrf as lowest cost path
maybe add curves at the bends for appearance (pretty simple for multi segment lines - 1 shape sheet cell).
or maybe calculate straight line from start node to end node...add some line ends and may place on a layer "below" node layer
so that as line pass below intermediate node, user knows line did not terminate on that intermediate node.
This a very complex problem but there are many many academic papers that have looked at this problem for 50 years.
Good luck.
good luck