Which is better for pathfinding: greedy search vs BFS? Pros and cons? or Greedy search vs BFS—when wo

14 Replies, 1654 Views

Greedy search vs BFS comes down to: do you *need* the best answer, or just *an* answer?

BFS is your go-to for puzzles, mazes, etc. Greedy’s better for stuff like recommendation systems where speed > perfection.

If you’re testing, use PyGame to visualize both—it’s eye-opening how differently they behave.

---
Wow, didn’t expect so many great takes! The A* suggestion keeps coming up—guess I’ll dive into that next.

Also, VisuAlgo is *exactly* what I needed to see the diff. Thanks y’all!

One last Q: anyone got examples where greedy search *spectacularly* failed? Like, hilariously bad? Just curious.

Messages In This Thread



Users browsing this thread: 1 Guest(s)