📄 readme
字号:
AAAA CCCC OOOO TTTTTT SSSSS PPPPP AA AA CC OO OO TT SS PP PP AAAAAA CC OO OO TT SSSS PPPPP AA AA CC OO OO TT SS PP AA AA CCCC OOOO TT SSSSS PP################################################################ ACO algorithms for the TSP ################################################################ Version: 1.0 Author: Thomas Stuetzle Copyright (c) Thomas Stuetzle, 2002This is the README file to the software package ACOTSP.This software package was developed by Thomas Stuetzle in connectionwith the Book [DorStu04] Marco Dorigo and Thomas Stuetzle, "Ant ColonyOptimization", MIT Press, Cambridge, MA, USA, 2004.The software package is freely available subject to the GNU General Public Licence, which is included in file gpl.txt.If you use ACOTSP in your research, I would appreciate a citation inyour publication(s). Please cite it asThomas Stuetzle. ACOTSP, Version 1.0. Available fromhttp://www.aco-metaheuristic.org/aco-code, 2004.This software package provides an implementation of various Ant ColonyOptimization (ACO) algorithms for the symmetric TravelingSalesman Problem (TSP). The ACO algorithms implemented are Ant System,Elitist Ant System, MAX-MIN Ant System, Rank-based version of AntSystem, Best-Worst Ant System, and Ant Colony System. This is Version1.0 of ACOTSP; it is in large part identical to the software used toproduce the results in [DorStu04], but it has been slightly adapted tomake the code more readable, more comments were added, and a newcommand line parser was generated with opag.AIMS OF THE SOFTWARE: This software was developed to have one commoncode for the various known ACO algorithms that were at some pointapplied to the TSP in the literature. The software tries to provide areasonably efficient implementation of these ACO algorithms while atthe same time aiming for readability and understandability of thecode.=========CONTENTS=========The GNU General Public Licence:gpl.txtThe main control routines, main:acotsp.cProcedures to implement the ants behaviour:ants.cants.hInput / output / statistics routines:InOut.cInOut.hProcedures specific to the TSP:TSP.cTSP.hLocal search procedures:ls.cls.hAdditional useful / helping procedure:utilities.cutilities.hCommand line parser:parse.cparse.hTime measurement:timer.c (you only need this one)timer.h (and this one)dos_timer.c (same as timer.c)dos_timer.h (same as timer.c)unix_timer.c (in case you want to use rusage instead, use this one)unix_timer.h (in case you want to use rusage instead, use this one)MakefileInstances: Some problem instances from TSPLIB: eil51.tsp kroA100.tsp d198.tsp lin318.tsp pcb442.tsp att532.tsp rat783.tsp pcb1173.tsp d1291.tsp pr2392.tsp. Other TSP instances are available from TSPLIB, the webpage for the 8th DIMACS Implementation Challenge on the TSP (http://www.research.att.com/~dsj/chtsp/) or the webpage on "Solving TSP"=====Code=====The software was developed in ANSI C under Linux, using the GNU 2.95.3gcc compiler and extensively tested in this environment. The softwareis distributed as a gzipped tar file.To install the code, first obtain the file ACOTSP.V1.0.tar.gz. Unzipthe file by typinggunzip ACOTSP.V1.0.tar.gzand then unpack it by typing tar -xvf ACOTSP.V1.0.tarThe software will unpack in a new folder ACOTSP.V1.0 To compile it under Linux just type 'make' and the executable 'acotsp'is produced.Note: The code is written in ANSI C. Hence, the code should bereasonable portable to other Operating Systems than Linux or Unix.======USAGE======Given the large number of ACO algorithms, also the number of commandline options is relatively large.The default parameter settings are such, that MAX-MIN Ant System willbe run using a 3-opt local search, using alpha = 1, beta = 2, rho =0.5 for a maximum of 10 seconds per each trial for 10 independenttrials. (guess who developed MAX-MIN Ant System ;-)The executable 'acotsp' provides the following command line options(given are the short and the long options):-r, --tries # number of independent trials-s, --tours # number of steps in each trial-t, --time # maximum time for each trial-i, --tsplibfile f inputfile (TSPLIB format necessary)-o, --optimum # stop if tour better or equal optimum is found-m, --ants # number of ants-g, --nnants # nearest neighbours in tour construction-a, --alpha # alpha (influence of pheromone trails)-b, --beta # beta (influence of heuristic information)-e, --rho # rho: pheromone trail evaporation-q, --q0 # q_0: prob. of best choice in tour construction-c, --elitistants # number of elitist ants-f, --rasranks # number of ranks in rank-based Ant System-k, --nnls # No. of nearest neighbors for local search-l, --localsearch 0: no local search 1: 2-opt 2: 2.5-opt 3: 3-opt-d, --dlb 1 use don't look bits in local search-u, --as apply basic Ant System-v, --eas apply elitist Ant System-w, --ras apply rank-based version of Ant System-x, --mmas apply MAX-MIN ant system-y, --bwas apply best-worst ant system-z, --acs apply ant colony system-h, --help display the help text and exitOptions -u --as, -v --eas, -w --ras, -x --mmas, -y --bwas, -z --acs,-h, --help don't need arguments, while all the others do. A Mandatory option is only the option "-i, --tsplibfile". Here, mandatorymeans that without specifying this option, the program won't work,since there is no input file. All the other options take some default values. The default values forthese are:-r, --tries : 10-s, --tours : 100-t, --time : 10 /* seconds */-o, --optimum : 1-m, --ants : 25-g, --nnants : 20-a, --alpha : 1-b, --beta : 2-e, --rho : 0.5-q, --q0 : 0.0-c, --elitistants : 100-f, --rasranks : 6-k, --nnls : 20-l, --localsearch : 3 /* use 3-opt */-d, --dlb : 1 -u, --as : 0-v, --eas : 0-w, --ras : 0 -x, --mmas : 1 /* apply MAX-MIN Ant System */-y, --bwas : 0-z, --acs : 0The default settings imply that as default MAX-MIN Ant System is runusing a 3-opt local search procedure. Please note that these defaultvalues do not really make sense for some of the algorithms (e.g.,typically an evaporation of 0.2 is recommended vor MAX-MIN AntSystem); that is, for some of the algorithms the default parametersettings lead to poor performance (an example is ACS). Hence, when youuse any of the ACO algorithms, make sure you set the appropriateparameter values. Typically, one may want to adjust the parameters-t, --time-o, --optimum-m, --ants-b, --beta-e, --rho -q, --q0-l, --localsearchNote that only one option among -u --as, -v --eas, -w --ras,-x --mmas, -y --bwas, -z --acs, is to be specified.Examples for running an experiments are:./acotsp -i lin318.tsp -v -t 60. -o 42029 -m 50 -b 5or./acotsp --tsplibfile lin318.tsp --acs --rho 0.1 --q0 0.95 --time 60. --optimum 42029 --ants 10=======OUTPUT=======Every experiment produces three files. These files are best.tsplibfilenamecmp.tsplibfilenamestat.tsplibfilenamewhere tsplibfilename is the instance identifier of the instance undersolution. The most important of these is the file "cmp.tsplibfilename". Thisfile starts with a specification of the parameter settings used to runthe experiment. The section with the comprehensive experimental datastarts withbegin problem tsplibfilenameNext the random number seed for the next trial is givenThen, for each trial statistical information on the development of thebest-so-far solution is given. Each section for a trial starts withbegin try <trial_number>Then, each time the algorithm finds a new best solution a line best <number> iteration <number> tours <number> time <number>is added, where "best" is the tour length of the best-so-far solution;iteration is the iteration number in which this solution is found;tours is the number of solutions constructed so far (typically this issimple iteration X n_ants); and time is the time at which a newbest-so-far solution is foundEach trial is ended by end try <trial_number>Once all trials are run the line end problem tsplibfilenameis added to end the file. The file best.tsplibfilenamecollects the information about parameter settings, the best solutionfound in each trial, and some additional statistical information.The file stat.tsplibfilename may be used for the output of statistical information on a trial asgenerated by the procedure population_statistics(); in InOut.c;however, it is not heavily used in ACOTSP V1.0. Have fun, and if you have any comments please write to stuetzle no@spam informatik.tu-darmstadt.de
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -