Skip to content

Latest commit

 

History

History
86 lines (65 loc) · 5.45 KB

File metadata and controls

86 lines (65 loc) · 5.45 KB

Modules

This folder contains supporting modules for the heuristic algorithm framework. These provide the underlying data structures, configuration, initialisation logic, and utilities that are used by the genetic algorithm, greedy solution generator, local search, and CPLEX-based solver.

  • Genetic algorithm and greedy solution generator rely on all core modules for data modeling, configuration, and logging.
  • Local search modules use the same data classes and configuration utilities for iterative solution improvement.
  • CPLEX files interface with the same data structures and configuration to solve the problem using mathematical programming.

This modular setup ensures consistency and reusability across all implemented solution approaches.

📂 modules/Shared modules & utilities

Configuration: config.py

The config.py file centralises all adjustable parameters for experiments and algorithm runs.
It defines values such as:

  • Cost settings (e.g., trenching, fibre, node costs)
  • Coverage radius options
  • Bandwidth requirements and limits
  • Other experiment-specific variables

To change how the algorithms behave or to tune experiments, edit the relevant values in config.py.
This ensures consistent configuration across all modules and solution approaches.


Usage by Algorithms

  • The greedy solution generator relies on config.py for parameters and logger.py for logging.
  • The genetic algorithm uses all modules in this folder: data classes, configuration (config.py), population initialisation, logging (logger.py), and results saving.
  • The local search algorithm also uses the shared data classes, configuration (config.py), and logging utilities (logger.py) for iterative solution improvement.
  • The CPLEX-based solver uses only the shared configuration (config.py) and the CPLEX results handling module (save_cplex_results.py) to solve the problem via mathematical programming.

Logging

Detailed logging statements are included in all heuristic algorithm files (genetic algorithm, greedy solution generator, and local search).

  • These log lines are commented out by default to keep runs clean.
  • To enable step-by-step tracing of heuristic behaviour, simply uncomment the relevant lines.
  • This provides fine-grained visibility into intermediate values, execution flow, and decision-making within the heuristics.

This approach allows you to easily switch between standard runs and verbose, exploratory debugging for heuristic development and analysis.


Workflow

  1. Configure experiment parameters in config.py.
  2. Choose and run an algorithm:
    • Greedy solution generator (uses configuration and logging modules)
    • Genetic algorithm (uses all modules)
    • Local search (uses shared modules)
    • CPLEX-based solver (uses configuration and CPLEX results handler)
  3. View generated results in the results/ directory.
  4. For detailed runtime insights, uncomment logging statements in relevant files.

This modular structure ensures a clear separation of configuration, data modelling, and algorithm logic, while still making the entire process transparent through optional logs.