### Highlights from Solving Symmetrical and DisSymmetrical TSP base on Ant Colony Algorithm

Join the 15-year community celebration.

Play games and win prizes!

4.34483
4.3 | 30 ratings Rate this file 39 Downloads (last 30 days) File Size: 28.2 KB File ID: #14543 Version: 1.0

# Solving Symmetrical and DisSymmetrical TSP base on Ant Colony Algorithm

by

### wang h (view profile)

08 Apr 2007 (Updated )

Using Ant Colony Optimization Algorithm to solve Traveling Salesman Problem

### Editor's Notes:

This file was a File Exchange Pick of the Week

File Information
Description

In this M-file, the implementation of ACO Algorithm is given with the support of reference papers listed. You can easily use it as following command to see the pictures of result and the playing iterative course.
ACO('filename.tsp');
filename.tsp is the problem file of the Symmetrical or Asymmetrical TSP problem which you can download from the following site: http://elib.zib.de/pub/mp-testdata/tsp/tsplib/tsp/index.html
As there is several type of ACO algorithm, the basic one Ant System(AS) is given, which is original. For more problems or other ACO algorithms, you can contact me by the email codstar@126.com. plealse make me known if you want to use it commercially.
And many thanks for Doug Hull's advice!

MATLAB release MATLAB 7.2 (R2006a)
14 Oct 2015 idris anjolaiya

### idris anjolaiya (view profile)

good day i am writing in request for the source code on ant colony optimization ... i will be glad if you can write me back ... thank you

Comment only
10 Dec 2014 rafat alhanani

### rafat alhanani (view profile)

Hello Mr.Wang,
But when I call the ACO function as u mentioned in line 1 and line 4 with 'ch150.tsp', I still get the same error :
"Error: File: ACO.m Line: 1 Column: 14
Unexpected MATLAB expression."
And the first line show this massage "Invalid syntax at 'ch150.tsp'.Possibly,a ),} or ]is missing".
Thank u very much.

26 Aug 2013 Nimmy Cleetus

### Nimmy Cleetus (view profile)

kindly please send me the matlab code for antcolony optimization

Comment only
22 Aug 2013 Hock Hung

### Hock Hung (view profile)

Error: File: ACO.m Line: 1 Column: 14
Unexpected MATLAB expression.
Why this could happen? izit bacause of the matlab's version?

24 May 2013 Liber Eleutherios

### Liber Eleutherios (view profile)

It's very slow even with 22 nodes and the results can be pretty inefficient. Maybe the author could try to improve the performance from both points of view of speed and efficiency.

07 May 2013 Zainab ASUS

### Zainab ASUS (view profile)

it works

24 Nov 2012 Bharath

### Bharath (view profile)

Could someone tell me where can I get the code for solving the same MTSP using ACO in MATLAB?

15 Nov 2012 Ayman Esmat

### Ayman Esmat (view profile)

Hello Mr.Wang,
Its a very useful code. Thank u very much.
But when I call the ACO function as u mentioned in line 1 and line 4, I still get the same error :
"Error: File: ACO.m Line: 1 Column: 14
Unexpected MATLAB expression."

Thank u very much

15 Mar 2012 Megha Aggarwal

### Megha Aggarwal (view profile)

In program where 2 call d ACO('ulysses22.tsp')....plz help me i need ths urgently......

Comment only
14 Mar 2012 Megha Aggarwal

### Megha Aggarwal (view profile)

i hv corrected d program by changing d ACO('filename') to ACO('ulysses22.tsp'). but still it gives error like
Error: File: ACO.m Line: 1 Column: 14
Unexpected MATLAB expression.
plz guide me....i shall b highly thankful 2 u.....

Comment only
24 May 2011 LUKAS

:)

Comment only
29 Apr 2011 Jeci

### Jeci (view profile)

for those getting "Input argument "inputfile" is undefined." errors, you need to call the function with ACO('filename'). filename must include the extension name.
for example, I'm using ACO('ch150.tsp')

07 Jan 2011 amit singh

### amit singh (view profile)

I got an error
Input argument "inputfile" is undefined.

Error in ==> ACO at 4
[Dimension,NodeCoord,NodeWeight,Name]=FileInput(inputfile);

wat will i do?
this will help my M.Tech project.

Comment only
24 Jun 2010 Amirah 'Aisha

### Amirah 'Aisha (view profile)

I need a solution for solving ant colony optimization to solve travelling salesman problem.

05 Jun 2010 ravi teja

### ravi teja (view profile)

I got an error
Input argument "inputfile" is undefined.
wat will i do?
this will help my M.Tech project.

Comment only
24 Apr 2010 neeti saxena

### neeti saxena (view profile)

my project is ant colony algorithms for web page classification pls provide source code in C/C++/java language

Comment only
11 Dec 2009 poof

11 Dec 2009 poof

### poof (view profile)

19 Jan 2009 sameh abd elhaleem

### sameh abd elhaleem (view profile)

Hi Wang H, I want to make a toolbox of Ant Colony Algorithm. currently, I have implemented only ACS, MMAS for TSP and several versions of CACA for continous optimization, and there were other kinds of problem which ACA can solve, but I dont konw them very well, who has the same interest, please contact me to complete it!

Comment only
27 Sep 2008 ? ?

??

Comment only
21 Sep 2008 xiaoping ren

thank you for your job,i am now studying the ant algorithm

20 Aug 2008 Yong Lee
09 Jul 2008 zhou jin

excellent

Comment only

Hi
Very tanks

26 May 2008 gou sheng

good

30 Apr 2008 hamoudi samir

salut

04 Mar 2008 liu bing
14 Feb 2008 wang jia

it 's good but i meet some error

Comment only
15 Jan 2008 k m

i am a studenta also interested in tsp problems. thanks in advanse

16 Dec 2007 Alvin Guo

Nice program! Many thanks! I want to combine it with Bayesian network learning!
my mail: gwq66@yahoo.com.cn

06 Nov 2007 jaesung lee

thank you

16 Oct 2007 Thanh Nguyen

Now, I am a student and I am very interested in ant colony. Because, the part of my thesis have to use this algorithm to solve some problem...

13 Oct 2007 11 1111

Thank you so much!

30 Sep 2007 jack newly

pretty good! many thanks for your files!

14 Sep 2007 shivangi singhal

this site is very helpful for me

Comment only
23 Aug 2007 stty satty

simpler implimentation is the the greatest adv of this paper

01 Jun 2007 wojciech mastalerz

Wang H. I have used them for 2 years to the FAP (frequency asign problem) with very good result.
I have this unfortunately implemented in SCILAB, but I serve help.

10 May 2007 chuanli zhuang

thanks

27 Apr 2007 Wang H

Hi, I want to make a toolbox of Ant Colony Algorithm. currently, I have implemented only ACS, MMAS for TSP and several versions of CACA for continous optimization, and there were other kinds of problem which ACA can solve, but I dont konw them very well, who has the same interest, please contact me to complete it!

Comment only
27 Apr 2007 haed tavakkoli
18 Apr 2007 vahid majazi

very excellent

17 Apr 2007 chin hang

did very well...........

17 Apr 2007 Wang H

The link in the introduce is corrected to
http://elib.zib.de/pub/mp-testdata/tsp/tsplib/tsp/index.html

Comment only