TheSwamp
Code Red => .NET => Topic started by: themethodman on November 01, 2021, 08:32:50 AM
-
Anyone seen a solution for solving for the shortest path from point A to point B along a network of polylines for c# .NET?
Have only been able to find LISP examples.
A little surprised this hasn't been asked before (or I haven't been able to find a relevant previous post).
For reference, this implementation linked below is example what I'm after (just not in lisp!)
https://www.cadforum.cz/en/the-shortest-path-between-two-points-on-a-network-tip10383 (https://www.cadforum.cz/en/the-shortest-path-between-two-points-on-a-network-tip10383)
-
I thought there was a challenge with this once.
You should be able to port lisp to C#, i know it can be difficult the way some lisp routines are written lol.
-
There should be several examples of generic A* pathfinding in C# out there. The bulk of your work (and it won't be much) would be interpreting the network of plines into nodes and edges.
-
https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
There are many examples on the internet, but I believe this one can help you.
Enjoy.
https://www.codeproject.com/Articles/1221034/Pathfinding-Algorithms-in-Csharp (https://www.codeproject.com/Articles/1221034/Pathfinding-Algorithms-in-Csharp)
-
A lisp solution that could be converted to C#
https://www.theswamp.org/index.php?topic=45092.msg503957#msg503957