Read “Surely You’re Joking, Mr. Feynman!” by Richard Feynman. He has a whole chapter about his home experiments with ants.
If you’ve ever seen ants in your house when they’ve found something, you’ll see them marching along a fixed trail that starts from a hole in the wall or floor. It can wander from one room to the next, up onto furniture, over sinks, into medicine cabinets, etc., finally terminating on the one little goody they’ve found, like a piece of a cookie or something.
Ants “communicate” using a pheromone trail. The entire system is designed to locate good stuff in the environment of the colony, and to establish a logistical chain that carries it back. As they walk they excrete the pheromone. If an ant has found something great, like a piece of food on the floor, it excretes much more of the pheromone than ants who have just been scouting around and haven’t found anything. “Punishing” ants, by killing or injuring them, is unlikely to affect their behavior- their behavior is based on rewards, not avoidance.
Subsequent ants sniff for the trail and try to follow it- eventually ending up at either the goody or the colony. Ants in North America don’t know whether they’re going forwards or backwards on the trail, unlike the ants in South America who CAN tell. They also don’t follow it exactly- they go too fast and carelessly wander off the trail, and sometimes their path brings them back onto it. (Otherwise they hunt around for it until they pick it up again.) When they smell that they’re on the trail, they excrete greater amounts of pheromone. As a result of this imperfect tracking behavior, the trail between the colony and the goody they’ve found gradually becomes shorter and straighter, more concentrated with pheromone, and more heavily trafficked. The actual pheromone itself continuously evaporates off the floor, and without any reinforcement by continued ant traffic, it evaporates completely in a half hour or so.
This system generally works very well for the ants- it’s simple and yet incredibly efficient. One trick that you can do, if you are very patient and resourceful, is to get the ants to march around in a big circle. Once this is set up, they blindly follow the track around and around, reinforcing it as they go, until they drop dead of exhaustion.