Artificial Bee Colony Algorithm
This repository contains an implementation of the Artificial Bee Colony (ABC) algorithm in Rust. The ABC algorithm is a nature-inspired metaheuristic optimization algorithm used to solve optimization problems. It simulates the foraging behavior of honey bees to find the best solution to a given problem.
Getting Started
To use this program, follow the steps below:
- Clone the repository:
git clone https://github.com/DaLaw2/Artificial-Bee-Colony.git
- Install Rust programming language and Cargo build system. Refer to the official Rust documentation for installation instructions: https://www.rust-lang.org/tools/install
- Navigate to the project directory:
cd Artificial-Bee-Colony
- Build the project:
cargo build --release
- Run the program:
cargo run --release -- --input=<input_file_path> --output=<output_file_path> --config=<config_file_path>
Replace <input_file_path>, <output_file_path>, and <config_file_path> with the respective file paths for your input data, output file, and configuration file.
Program Arguments
The program accepts the following command-line arguments:
--input: Path to the input data file (Excel format).--output: Path to the output file where the results will be saved.--config: Path to the configuration file.
Dependencies
The program relies on the following external libraries:
rand: For generating random numbers.rayon: For parallel processing.calamine: For reading Excel files.
Algorithm Configuration
The configuration file (config.txt) specifies the parameters for the ABC algorithm. The available configuration options are as follows:
colony_size: The number of bees in the colony.candidate_amount: The number of candidate solutions generated by employed bees.max_unimproved: The maximum number of iterations without improvement before a bee abandons its solution.max_iterations: The maximum number of iterations for the algorithm.improvement_threshold: The minimum improvement threshold required to continue the algorithm.concurrent_count: The number of threads used for parallel processing.generation_method: The method used to generate candidate solutions. Options:Swap,Insert,Reverse,PartialShuffle.
Input Data
The input data should be provided in an Excel file format (.xlsx). The data should be organized in rows, where each row represents a city and each column represents a dimension of the city. The distance between cities is calculated using the Euclidean distance formula.
Output
The program will output the best solution found by the ABC algorithm, the length of the best solution, and the elapsed time. The results will be saved to the specified output file.