AccurateEstimate
AccurateEstimate

Reputation: 383

Pathfinding Visualizer in python

I'm writing a pathfinding visualizer in python and Pygame. I intend to write a visualizer that can simultaneously simulate multiple pathfinding algorithms. I have two possible approaches

  1. I write a server part of the application, that will calculate path and will send it to client part, that will use pygame to draw grid and render simulation.

  2. I write a master thread, that will do pathfinding and will send information to grid thread using pipes.

Which approach should I use?

Upvotes: 0

Views: 668

Answers (1)

Louis Thibault
Louis Thibault

Reputation: 21420

You're overthinking this. Either method is fine, but you probably don't want to use threads for CPU-bound operations. Use the multiprocessing module instead if you're shooting for concurrency.

But really, the pygame code should be negligible in terms of processing. Focus on making your pathfinding efficient (perhaps implemented in C?) instead.

Upvotes: 2

Related Questions