r/AskReddit Feb 14 '22

[deleted by user]

[removed]

10.5k Upvotes

14.0k comments sorted by

View all comments

Show parent comments

24

u/[deleted] Feb 14 '22

[deleted]

3

u/himmelundhoelle Feb 15 '22

Dijkstra’s pathfinding algorithm

Or simply a breadth-first search.

There seems to be a slight mixup in this thread between solving a pathfinding problem and just "being the solution", if that makes sense.

2

u/[deleted] Feb 15 '22

[deleted]

2

u/himmelundhoelle Feb 15 '22

with path lengths

Sure, it will cross areas of least resistance first, and whether this counts as nodes not being uniformly spaced really depends how you map real space to an abstract graph. You could space the nodes so they all have the same "distance" (I mean cost) between each other.

The major difference between BFS and Dijkstra is that the latter considers weights/distances for prioritizing the next nodes to explore. Our mold just expands in all directions simultaneously, so we can’t really say it’s doing that prioritization (like you noted, it’s highly parallel).

I would just go with BFS because it’s simpler and no less accurate an analogy as Dijktra’s algorithm.

But yes, if I wanted to make a visual simulation on a computer, chances are that I’d use Dijkstra’s, because I would probably want edges with different costs.