How dmishin/tsp-solver works
Project type and purpose
• This is an open-source Python library and command-line tool for computing sub-optimal solutions to the Travelling Salesman Problem (TSP).
• It comes with core solver modules, demonstration scripts, CLI entrypoints, and visualization utilities.
File structure
• Top-level files:
• setup.py, setup.cfg – installation and packaging
• Makefile, runtest.sh – build/test conveniences
• bin/ – command-line wrappers (tsp_demo, tsp_numpy2svg)
• tests/ – unit and performance tests
• samples/, images/ – demo inputs and assets
• Core package: tsp_solver/
• tsp_solver/greedy.py – pure-Python greedy solver
• tsp_solver/greedy_numpy.py – NumPy- backed solver
• tsp_solver/util.py – cost‐calculation helper
• tsp_solver/demo/ – scripts for generating TSPs and rendering results
Key insights from README
• Two solver implementations (pure Python vs. NumPy-accelerated).
• Demo scripts depend on external libraries: NumPy, PIL, Matplotlib.
• Entry points: “demo_tsp” (random TSP generation -> solve -> save .npy) and “tsp_numpy2svg” (convert .npy to SVG).
• Supports Python 2 & 3, installed via PyPI or manually via setup.py.