any of your sources to a target location, otherwise you either need to suboptimally pick a source to move before path finding or run the search for each source to find out which has a shortest path to a target.
If you want to move all sources to their closest target location I have found the best thing to do is a bfs with all of your target locations starting as sources then moving any ant you find into the square you found it from (or into its own square if the square you're moving it into already contains an ant or food).
If however you want to iteratively collect targets (so you don't send two ants towards the same target) then things become a little more complicated. For collecting food I iteratively collect uncollected food items using a new multi source and multi target A* search from moveable ant locations to uncollected food.
I'm still not entirely sure what the best way to iteratively collect targets is when your target set is larger, as my heuristic function for multi target A* doesn't really work very well then.
Statistics: Posted by antimatroid — Wed Nov 30, 2011 10:52 am