Ant Track Algorithms

by Peter W McOwan and Paul Curzon, Queen Mary University of London

(Updated from the archive)

A single ant on a rock
Image by vlada11 from Pixabay

Ants communicate by leaving trails of chemicals that other ants can follow to sources of food they’ve found. Very quickly after a new source of food is found ants from the nest are following the shortest path to get to it, even if the original ant trail was not that direct and wiggled around. How do they do that? And how come computers are copying them?

Bongo playing physicist, Richard Feynman, better known for his Nobel Prize for Physics, wondered about this one day watching ants in his bath. The marvellous thing about science is it can be done anywhere! He grabbed some crayons and started marking the paths each ant followed by drawing a line behind it. He quickly discovered from the trails that what was happening was that each ant was following earlier trails but hurriedly so not sticking to it exactly. Instead it was leaving its own trail. As this was done over and over again the smooth direct route emerged as having the strongest line from the superimposed hurried trails. It’s a bit like when you sketch – you do a series of rough lines to start, but as you do that over and over the final line is much smoother.

From very simple behaviour the ants are able to achieve complex things that might otherwise need complex geometrical skills. As a result, Computer Scientists have been inspired by the ants. Marco Dorigo, Université Libre de Bruxelles first came up with the idea of ‘ant algorithms’: ways of programming separate software agents to do complex things that otherwise would bog down even fast computers. They are part of a more general idea of swarm computing. Finding shortest routes, whether for taxi drivers or for messages sent over networks, is a very common problem of the kind ant algorithms can solve. An ant algorithm solution involves programming lots of software agents to behave a bit like ants leaving digital trails for other agents to pick up. Over time, their simple individual behaviour yields a good solution to the otherwise complex problem of finding the shortest route. Another use is to detect the edges of objects in images – the first step in understanding a picture. Here the virtual ants wander from pixel to pixel based on the differences between nearby pixels, with the result that the strongest trail is left along edges of things shown in the image.

So ants are helping to solve real problems. Not bad for such a tiny brain.


More on …

Related Magazines …

cs4fn issue 4 cover

EPSRC supports this blog through research grant EP/W033615/1, and through EP/K040251/2 held by Professor Ursula Martin. 

The optical pony express

Suppose you want to send messages as fast as possible. What’s the best way to do it? That is what Polina Bayvel, a Professor at UCL has dedicated her research career to: exploring the limits of how fast information can be sent over networks. It’s not just messages that it’s about nowadays of course, but videos, pictures, money, music, books – anything you can do over the Internet.

Cowboys at dawn crossing the range

Send a text message and it arrives almost instantly. Sending message hasn’t always been that quick, though. The Greeks used runners – in fact the Marathon athletic event originally commemorated a messenger who supposedly ran from a battlefield at Marathon to Athens to deliver the message “We won” before promptly dying. The fastest woman in the world at the time of writing, 2011, Paula Radcliffe, at her quickest could deliver a message a marathon distance away in 2 hours 15 minutes and 25 seconds (without dying!) … ( now in 2020, Brigid Kosgei, a minute or so faster).

Horses improved things (and the Greeks in fact normally used horseback messengers, but hey it was a good story). Unfortunately, even a horse can’t keep up the pace for hundreds of miles. The Pony Express pushed horse technology to its limits. They didn’t create new breeds of genetically modified fast horses, or anything like that. All it took was to create an organised network of normal ones. They set up pony stations every 10 miles or so right across North America from Missouri to Sacramento. Why every 10 miles? That’s the point a galloping horse starts to give up the ghost. The mail came thundering in to each station and thundered out with barely a break as it was swapped to a new fresh pony.

The pony express was swiftly overtaken by the telegraph. Like the switch to horses, this involved a new carrier technology – this time copper wire. Now the messages had to be translated first though, here into electrical signals in Morse code. The telegraph was followed by the telephone. With a phone it seems like you just talk and the other person just hears but of course the translation of the message into a different form is still happening. The invention of the telephone was really just the invention of a way to turn sound into an electrical code that could be sent along copper cables and then translated back again.

The Internet took things digital – in some ways that’s a step back towards Morse code. Now, everything, even sound and images, are turned into a code of ones and zeros instead of dots and dashes. In theory images could of course have been sent using a telegraph tapper in the same way…if you were willing to wait months for the code of the image to be tapped in and then decoded again. Better to just wait for computers that can do it fast to be invented.

In the early Internet, the message carrier was still good old copper wire. Trouble is, when you want to send lots of data, like a whole movie, copper wire and electricity are starting to look like the runners must have done to horse riders: slow out-of-date technology. The optical fibre is the modern equivalent of the horse. They are just long thin tubes of glass. Instead of sending pulses of electricity to carry the coded messages, they now go on the back of a pulse of light.

Up to this point it’s been mainly men taking the credit, but this is where Polina’s work comes in. She is both exploring the limits of what can be done with optical fibres in theory and building ever faster optical networks in practice. How much information can actually be sent down fibres and what is the best way to do it? Can new optical materials make a difference? How can devices be designed to route information to the right place – such ‘routers’ are just like mail sorting depots for pulses of light. How can fibre optics best be connected into networks so that they work as efficiently as possible – allowing you and everyone else in your street to be watching different movies at the same time, for example, without the film going all jerky? These are all the kinds of questions that fascinate Polina and she has built up an internationally respected team to help her answer them.

Multiple streams of binary data flowing in an optical cable.

Why are optical fibres such a good way to send messages? Well the obvious answer is that you can’t get much faster than light! Well actually you can’t get ANY faster than light. The speed of light is the fastest anything, including information, can travel according to Einstein’s laws. That’s not the end of the story though. Remember the worn out Marathon runner. It turns out that signals being sent down cables do something similar. Well, not actually getting out of breath and dying but they do get weaker the further they travel. That means it gets harder to extract the information at the other end and eventually there is a point where the message is just garbled noise. What’s the solution? Well actually it’s exactly the one the Pony Express came up with. You add what are called ‘repeaters’ every so often. They extract the message from the optical fibre and then send it down the next fibre, but now back at full strength again. One of the benefits of fibre optics is that signals can go much further before they need a repeater. That means the message gets to its destination faster because those repeaters take time extracting and resending the message. That, in turn, leaves scope for improvement. The Pony Express made their ‘repeaters’ faster by giving the rider a horn to alert the stationmaster that they were arriving. He would then have time to get the next horse ready so it could leave the moment the mail was handed over. Researchers like Polina are looking for similar ways to speed up optical repeaters.

You can do more than play with repeaters to speed things up though. You can also bump up the amount of information you carry in one go. In particular you can send lots of messages at the same time over an optical fibre as long as they use different wavelengths. You can think of this as though one person is using a torch with a blue bulb to send a Morse code message using flashes of blue light (say), while someone else is doing the same thing with a red torch and red light. If two people at the other end are wearing tinted sunglasses then depending on the tint they will each see only the red pulses or only the blue ones and so only get the message meant for them. Each new frequency of light used gives a new message that can be sent at the same time.

The tricky bit is not so much in doing that but in working out which people can use which torch at any particular time so their aren’t any clashes, bearing in mind that at any instant messages could be coming from anywhere in the network and trying to go anywhere. If two people try to use the same torch on the same link at the same time it all goes to pot. This is complicated further by the fact that at any time particular links could be very busy, or broken, meaning that different messages may also travel by different routes between the same places, just as you might go a different way to normal when driving if there is a jam. All this, and together with other similar issues, means there are lots of hairy problems to worry about if coming up with a the best possible optical network as Polina is aiming to do.

Polina’s has been highly successful working in this area. She has been made a Fellow of the Royal Academy of Engineering for her work and is also a Royal Society Wolfson Research Merit Award holder. It is only given to respected scientists of outstanding achievement and potential. She has also won the prestigious Patterson Medal awarded for distinguished research in applied physics. It’s important to remember that modern engineering is a team game, though. As she notes she has benefited hugely by having inspiring and supporting mentors, as well as superb students and colleagues. It is her ability to work well with other people that allowed her build a critical mass in her research and so gain all the accolades. All that achieved and she is a mother of two boys to boot. Bringing up children is, of course, a team game too.

Paul Curzon, Queen Mary University of London, Autumn 2011

Download the special issue of the cs4fn magazine “The women are here”.

Download Electronic Engineering For Fun Magazine Issue 1.