Skip to content

Implemented Ant Colony Optimization (ACO) to solve a combinatorial optimization problem, applying nature-inspired computation techniques. Developed from scratch with a focus on algorithm design, parameter tuning, and performance evaluation. It uses the brazil and burma dataset.

Notifications You must be signed in to change notification settings

ao452/Nature-inspired-computation-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This Jupyter Notebook contains Python code implementing Ant Colony Optimization (ACO) for the Traveling Salesman Problem (TSP). The ACO algorithm is designed to find an optimal or near-optimal solution for the TSP by simulating the foraging behavior of ants.

The following ACO approaches are used:

  • Standard ACO
  • MMAS
  • Elitist

Before running the code, make sure you have the following dependencies installed:

  • Python 3
  • Jupyter Notebook

You can install Jupyter Notebook using the following command: pip install notebook

The following libraries will need to be installed:

  • numpy
  • xml.etree.ElementTree
  • matplotlib.pyplot
  • pandas

Getting Started

  1. Clone or download the repository to your local machine:

git clone [repository_url]

  1. Navigate to the project directory:

cd [project_directory]

  1. Open Jupyter Notebook:

jupyter notebook

In Jupyter Notebook, open the ipynb file you want to run. There are 2, brazil.ipynb and burma.ipynb

Running the Code

  1. Inside the notebook, execute the code cells by selecting each cell and pressing Shift + Enter.

  2. Customize the parameters: input_data: Path to the XML file containing TSP data. num_iterations: Number of iterations for the ACO algorithm. max_evaluations: Maximum number of evaluations before terminating the algorithm. Other ACO parameters such as num_ants, alpha, beta, rho, Q, and elitist_percentage can be adjusted as needed.

  3. Monitor the output: The algorithm will print progress information, including the best path and distance, at regular intervals.

  4. View Results: The final results, including the best path and distance, will be displayed after the algorithm completes.

License This code is provided under the MIT license.

About

Implemented Ant Colony Optimization (ACO) to solve a combinatorial optimization problem, applying nature-inspired computation techniques. Developed from scratch with a focus on algorithm design, parameter tuning, and performance evaluation. It uses the brazil and burma dataset.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published