TheSwamp

Code Red => .NET => Topic started by: themethodman on November 01, 2021, 08:32:50 AM

Title: Shortest Path along a network
Post 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)
Title: Re: Shortest Path along a network
Post by: It's Alive! on November 01, 2021, 08:07:54 PM
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.

 
Title: Re: Shortest Path along a network
Post by: dgorsman on November 04, 2021, 11:50:23 AM
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.
Title: Re: Shortest Path along a network
Post by: Augusto on November 06, 2021, 10:48:29 AM
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)
Title: Re: Shortest Path along a network
Post by: kirby on November 08, 2021, 07:58:39 AM
A lisp solution that could be converted to C#
https://www.theswamp.org/index.php?topic=45092.msg503957#msg503957