Ask HN: Pathfinding algorithm to find all shortest k paths between two nodes?

3 points by eezurr ↗ HN
Im developing a city builder game and want to simulate citizens walking from point A to point B, but have each citizen take a random k shortest path to reach their destination. This is to avoid clumping that you'll see if you use Dijkstra's or flow fields (since these return only one available path). I will also use this for cars, so the algorithm must handle weighted and directed edges.

I have created my own solution, but I'm always looking for more optimal algorithms.

2 comments

[ 3.6 ms ] story [ 19.7 ms ] thread
What is your solution?
I'll make a show HN post once I am done testing it!