How yorak/verypy works
Project Type and Purpose
• VeRyPy is a specialized library rather than a typical full-stack application. Its primary goal is to provide reproducible implementations of classical CVRP (and some TSP) heuristics.
• The README emphasizes that it is “easy to use” and allows users to avoid reimplementing well-known algorithms. This implies that the library is modular and intended for both direct use (via command line or as a module) and extension by researchers or developers.
• It also provides integration hooks (wrappers) for external solvers such as LKH and Gurobi, and has visualization components.
Key Architectural Components Identified from the File Tree
• Core Library (Directory: verypy)
⁃ Contains the main entry points: VeRyPy.py, VeRyPyGui.py, shared_cli.py, and __main__.py which is used for a command-line interface.
⁃ Submodules here include:
▸ classic_heuristics: Implementations of classical algorithms (e.g., cheapest insertion, savings-based, sweep heuristics).
▸ local_search: Provides intra- and inter-route local search operators.
▸ tsp_solvers: Contains different TSP solvers/wrappers (e.g., LKH, acotsp, gurobi-based TSP solver).
▸ Config and utility modules (config.py, util.py, routedata.py, cvrp_io.py) provide central configuration, data I/O and utility functions.
• Examples (Directory: examples)
⁃ Contains sample problems, demonstration scripts and even an integration example (e.g., using Bing maps API) which utilizes the library.
• Scripts (Directory: scripts)
⁃ Provides helper scripts for running experiments and printing diagnostics (e.g., checking package licenses, printing Python info).
• Tests (Directory: tests)
⁃ Organized with replication tests for verifying algorithm correctness along with additional unit tests.
• Documentation (Directory: doc)
• Installation and Setup Files (e.g., setup.py, requirements.txt, LICENSE, etc.)
⁃ Indicate that the project is packaged for distribution and dependency management.
Relationships and Interactions between Components
• User Entry: Users interact with the system either via the CLI (using VeRyPy.py or the __main__.py module) or by importing modules programmatically in their own Python scripts.
• Data Input/Output: The cvrp_io module reads problem instance files (e.g., TSPLIB or TSPLIB95 formatted files) and formats inputs (such as distance matrices and demand lists) which are then passed into algorithm modules.
• Algorithm Components:
▸ The “classic_heuristics” submodule holds implementations of various deterministic heuristics (like Parallel Savings, Sweep, etc.).
▸ The “local_search” submodule provides neighborhood search and improvement operators that might be invoked as part of enhancing a solution.
▸ The “tsp_solvers” module offers wrappers to delegate TSP subproblems to external solvers like LKH or Gurobi.
• Visualization: The “visualizers” submodule takes the resulting solutions and generates graphical outputs that can be displayed or saved.
• External Dependencies: Certain heuristic implementations require external solvers such as LKH (detailed in LKH_install_notes.md) or Gurobi’s Python bindings. These are referenced within the heuristic modules and are integrated as separate components.
• Testing & Experimentation: The “tests” directory encapsulates unit and replication tests that ensure reliability of each module. There are also example scripts and experiments to compare performance and results.
Final Review for Detail Capture
• Main component is clearly labeled and its role is briefly annotated.
• If applicable, include notes on external dependency requirements and how they are integrated into, for example, the TSP solvers.