I recently finished up my final seminar for The MathWorks before transitioning to a new position at the MathWorks. (My old job is now available, you can have my title and office, but not the blog!) One of the books that I read during the journey was Emergence: The Connected Lives of Ants, Brains, Cities, and Software. It appealed to me because of the complex behavior that can emerge from many agents following simple rules.
One of the examples was discussing Ant Colony Optimization as used to solve the Traveling Salesman Problem. I was intrigued enough that I wanted to program it up in MATLAB to see how it works. Once I got on to The File Exchange here at MATLAB Central, Wang had already implemented it. We discussed it over e-mail; he made some changes to show the iterative nature of the solution graphically. Now we can watch as the ants go about their work. It turns out that the solution converges very quickly so the animation is not as active as I had hoped. However, often you will be able to see a potential optimization, and within a few iterations that optimization will “pop” through.
You can get the files here. Then try this example:
It didn’t work for me either, so I did some digging and found randint in the Communications toolbox. I wrote a simple randint function and it works now. This will work for this case, but it doesn’t exactly mimic the functionality of the Comm Toolbox randint
function out = randint(m,n,range)
% RANDINT(m,n,range) generates a m x n matrix of random integers from range(1) to range(2) inclusive
a = range(1);
b = range(2);
out = floor((b-a+1)*rand(m,n)) +a;
alslam alikm;
dear friend i search for program solving any of data mining techniques by matlab i prefer “classification”
i hope you can provide me any links thanks;
best regrades;
dr_sara
I get the error message “??? Undefined function or method ‘randint’ for input arguments of type ‘double’.”
Am I doing something stupid?
I’m running Matlab R2007a. Do I need a specif toolbox?
It didn’t work for me either, so I did some digging and found randint in the Communications toolbox. I wrote a simple randint function and it works now. This will work for this case, but it doesn’t exactly mimic the functionality of the Comm Toolbox randint
function out = randint(m,n,range)
% RANDINT(m,n,range) generates a m x n matrix of random integers from range(1) to range(2) inclusive
a = range(1);
b = range(2);
out = floor((b-a+1)*rand(m,n)) +a;
I’m running Matlab 7.0.4. Do I need a specif toolbox for ant colony model? I want to use classification algorithm
Masoud,
According to the author’s notes on the page where you download, you will need R2006a. You can tell what version you have with the VER command.
Doug
I have a problem about ant colony optimization. I do not know this algorithm because I have nothing to read. Please, help me.
If you have any code about application Ant Colony to find Minimum, please send me.
I am looking forward to your letter
thank you very much.
Try the wikipedia article:
http://en.wikipedia.org/wiki/Ant_colony_optimization
Dogu
alslam alikm;
dear friend i search for program solving any of data mining techniques by matlab i prefer “classification”
i hope you can provide me any links thanks;
best regrades;
dr_sara
is there any code in MATLAB to calculate any fitness’ values using ACO ?thanx
Hello,
This is a very nice site.
Btw do u have any matlab code Ant Colony Optimisation for Vehicle Routing Problem?
Thk You very much