Skip to content

BERATCANS/Ant-Colonisation-Method

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ant-Colonisation-Method

This Java program, named "AntColonisation", implements two algorithms for finding the shortest path between nodes in a graph representing locations: the Ant Colony Optimization method and the Brute-Force method.

Ant Colony Optimization Method:

-This method utilizes a heuristic based on the pheromone trails left by artificial ants traversing the graph.
-The ants probabilistically choose the next node to visit based on both the intensity of the pheromone trail and a heuristic function representing the desirability of each potential node.
-The pheromone levels are updated based on the paths taken by the ants, with the aim of reinforcing the paths of shorter distances over time.
-Parameters such as the number of iterations, the number of ants, pheromone intensity, and degradation factor are customizable to fine-tune the optimization process.
-The program visualizes the nodes and the pheromone trails on a canvas for visualization.

Brute-Force Method: -This method exhaustively searches through all possible routes to find the shortest path by calculating the distance for each permutation.
-It systematically generates permutations of node indices and calculates the total distance for each permutation.
-The shortest path and its distance are updated whenever a shorter route is found during the search process.
-The program also reads node coordinates from a file, performs necessary computations, and visualizes the results using the StdDraw library.

Here is the table comparing the execution times and the results of the shortest paths found by the two codes: Screenshot 2024-05-13 at 05 08 48

Here is the samples of outputs of code: ss of 4 ant-colony 05 36 23 ss of 5 ant-colony2

About

This Java program, named "AntColonisation", implements two algorithms for finding the shortest path between nodes in a graph representing locations: the Ant Colony Optimization method and the Brute-Force method.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages