{"id":21466957,"url":"https://github.com/thiagodnf/jacof","last_synced_at":"2025-07-15T05:31:11.392Z","repository":{"id":62402013,"uuid":"85520017","full_name":"thiagodnf/jacof","owner":"thiagodnf","description":"Java Ant Colony Optimization Framework","archived":false,"fork":false,"pushed_at":"2018-07-09T17:11:14.000Z","size":320,"stargazers_count":31,"open_issues_count":2,"forks_count":20,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-09T21:14:30.391Z","etag":null,"topics":["ant-colony-optimization","framework","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thiagodnf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-20T00:41:46.000Z","updated_at":"2023-04-12T06:56:37.000Z","dependencies_parsed_at":"2022-11-01T09:01:21.419Z","dependency_job_id":null,"html_url":"https://github.com/thiagodnf/jacof","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodnf%2Fjacof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodnf%2Fjacof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodnf%2Fjacof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodnf%2Fjacof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiagodnf","download_url":"https://codeload.github.com/thiagodnf/jacof/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226017154,"owners_count":17560466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ant-colony-optimization","framework","java"],"created_at":"2024-11-23T08:16:14.306Z","updated_at":"2024-11-23T08:16:15.084Z","avatar_url":"https://github.com/thiagodnf.png","language":"Java","funding_links":[],"categories":["人工智能"],"sub_categories":["元启发式框架"],"readme":"![alt tag](https://raw.githubusercontent.com/thiagodnf/jacof/master/src/main/resources/logo.png)\n\n\nJava Ant Colony Optimization Framework\n=========\n**jacof** is an object-oriented Java-based framework for ant colony optimization (ACO). It implements the most used ACO's implementations.\n\n### Status\n[![Build Status](https://travis-ci.org/thiagodnf/jacof.svg?branch=master)](https://travis-ci.org/thiagodnf/jacof)\n[![codecov](https://codecov.io/gh/thiagodnf/jacof/branch/master/graph/badge.svg)](https://codecov.io/gh/thiagodnf/jacof)\n\nWhat is the ACO?\n-----\n\nDorigo [1] introduces an ant-based algorithm called Ant Colony Optimization (ACO). The algorithm tries to reproduce the behavior of the ants in the search process of solutions from the choice of the path to be followed until the process of updating the pheromone trail.\n\nThe main concepts used in ACO are based on real ants such as an artificial pheromone trail used to communication among the ants, a sequence of local moves to find the shortest path and a stochastic decision policy\n\nThe below figure shows an example of an ant building its solution traversing the graph starting from vertex 6 and reaching\nthe vertex 4, obtaining as solution the path {6-2-3-4}.\n\n![alt tag](https://raw.githubusercontent.com/thiagodnf/jacof/master/src/main/resources/path.png)\n\n\nThe ACOs Developed\n-------\n\nThis framework implements the following ACO's variations:\n\n| Algorithm                  | Abbreviation | Authors | Year | Reference | How to use | \n|---------------------------|----|----------------------|----------------------|----|----|\nAnt System | AS | Dorigo, Maniezzo and Colomi | 1992 |  [1] | [Click here](#ant-system) |\nElitist Ant System | EAS| Dorigo | 1992 |  [1,3] | [Click here](#elitist-ant-system) |\nAnt Colony System | ACS| Dorigo and Gambardella | 1997 |  [2] | [Click here](#ant-colony-system) |\nRank-based Ant System | ASRank | Bullnheimer, Hartl and Strauss | 1997 |  [4] | [Click here](#rank-based-ant-system ) |\nMax-Min Ant System | MMAS | Stützle and Hoos | 2000 |  [5] | [Click here](#max-min-ant-system) |\n\nThe Problems Developed\n-------\n\nThis framework addresses the following problems:\n\n* Next Release Problem (NRP)\n* Symmetric Traveling Salesman Problem (TSP)\n* Knapsack Problem (KP)\n\nObs. 1: This framework supports the TSPLIB library (a library of sample instances for the TSP). [Click here](http://elib.zib.de/pub/mp-testdata/tsp/tsplib/tsp/index.html) to access the problem instances.\n\nObs. 2: For Knapsack Problem, access https://people.sc.fsu.edu/~jburkardt/datasets/knapsack_01/knapsack_01.html \n\nHow To Use\n-------\n\nTo use this framework, it is necessary to define: i) the problem addressed; and ii) the ACO's variation used. After that, the algorithm should be executed. At the following it is shown some examples.\n\n### Defining the Addressed Problem\n\n```java\nProblem nrp = new NextReleaseProblem(\"in/delsagrado20.nrp\");\nProblem tsp = new TravellingSalesmanProblem(\"in/oliver30.tsp\");\nProblem kp = new KnapsackProblem(\"in/p01.tsp\");\n```\n\n### Defining the ACO's variation\n\nSome parameter settings are the same in all ACO's variations such as the number of ants, the number of iterations, alpha, betha and the evaporation rate. However, other algorithms have their own parameter settings. Next it is shown how to instanciate each ACO's variation.\n\n#### Ant System\n\n```java\nAntSystem aco = new AntSystem(problem);\n\naco.setNumberOfAnts(10);\naco.setNumberOfIterations(50);\naco.setAlpha(1.0);\naco.setBeta(2.0);\naco.setRho(0.1);\n```\n\n#### Ant Colony System\n\n```java\nAntColonySystem aco = new AntColonySystem(problem);\n\naco.setNumberOfAnts(10);\naco.setNumberOfIterations(50);\naco.setAlpha(1.0);\naco.setBeta(2.0);\naco.setRho(0.1);\naco.setOmega(0.1);\naco.setQ0(0.9);\n```\n\n#### Elitist Ant System\n\n\n```java\nElitistAntSystem aco = new ElitistAntSystem(problem);\n\naco.setNumberOfAnts(10);\naco.setNumberOfIterations(50);\naco.setAlpha(1.0);\naco.setBeta(2.0);\naco.setRho(0.1);\naco.setWeight(6);\n```\n\n#### Rank-based Ant System\n\n```java\nRankBasedAntSystem aco = new RankBasedAntSystem(problem);\n\naco.setNumberOfAnts(10);\naco.setNumberOfIterations(50);\naco.setAlpha(1.0);\naco.setBeta(2.0);\naco.setRho(0.1);\naco.setWeight(6);\n```\n\n#### Max-Min Ant System\n\n```java\nMaxMinAntSystem aco = new MaxMinAntSystem(problem);\n\naco.setNumberOfAnts(10);\naco.setNumberOfIterations(50);\naco.setAlpha(1.0);\naco.setBeta(2.0);\naco.setRho(0.1);\naco.setStagnation(10);\n```\n\n### Running the algorithm\n\nTo run the algorithm, you can use the ExecutionStats class defined as follows:\n\n```java\nExecutionStats es = ExecutionStats.execute(aco, problem);\nes.printStats();\n```\nThe output will be:\n\n```sh\n2017-03-31 21:01:35 [INFO ] ==================================================\n2017-03-31 21:01:35 [INFO ] Execution Time: 36918.0\n2017-03-31 21:01:35 [INFO ] Best Value: 423.74056313320284\n2017-03-31 21:01:35 [INFO ] Best Solution: [11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 0, 1]\n2017-03-31 21:01:35 [INFO ] ==================================================\n```\n\nReferences\n-------\n[1] M. Dorigo. *Optimization, Learning and Natural Algorithms*. PhD thesis, Politecnico di\nMilano, Italy, 1992. [in Italian].\n\n[2] M. Dorigo and L. M. Gambardella. Ant colony system: A cooperative learning approach\nto the traveling salesman problem. *IEEE Transactions on Evolutionary Computation*,\n1(1):53–66, April 1997.\n\n[3] M. Dorigo, V. Maniezzo, and A. Colorni. Ant system: Optimization by a colony of\ncooperating agents. *IEEE Transactions on Systems, Man, and Cybernetics, Part B:\nCybernetics*, 26(1):29–41, February 1996.\n\n[4] B. Bullnheimer, R. F. Hartl, and C. Strauss. A new rank based version of the ant system - a\ncomputational study. *Central European Journal for Operations Research and Economics*,\n7:25–38, 1997.\n\n[5] T. Stützle and H. H. Hoos. MAX-MIN ant system. *Future Generation Computer Systems*,\n16(9):889–914, June 2000.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagodnf%2Fjacof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiagodnf%2Fjacof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagodnf%2Fjacof/lists"}