Army ants are a predatory nomadic species: they raid other insect colonies and are always on the move, without a permanent nest.
In this lifestyle, finding the shortest foraging path - with sufficient workforce left over - is crucial.
The new research shows they adjust their bridges to find that balance.
Writing in the Proceedings of the National Academy of Sciences, the scientists say their findings have implications for creating intelligent, self-assembling systems.
Many species of ants show many complex, collective behaviours. Fire ants form rafts, bridges and tower structures, while weaver ants in Australia build chains that "sew" leaves together to make nests.
The American and German researchers behind the new study focussed on the army ant, Eciton hamatum.
They travelled to Panama to observe this species in its natural environment, hoping "to understand the simple rules that allow them to communicate and build the complex bridge structures", said co-first author Matthew Lutz.
The team used a 3D-printed, angled platform that mimicked the ants' natural environment but also allowed the scientists to adjust the path for their experiments.
"The ants started to form a small bridge at the tip of the angle, which then moved away, making the bridge bigger and bigger so as to shorten the path," explained Mr Lutz, a PhD student at Princeton University in the US.
"What was even more interesting was that the bridge didn't move as far away as it possibly could. It tended to stop at some intermediate point."
If the angle to be bridged was wider, that "bridge migration" ceased even sooner.
In the wild, a foraging trail contains several such bridges, and they respond to the intensity of the traffic overhead: "If you stop the traffic across the bridge, it breaks in 1-2 minutes," Mr Lutz said.
He and his colleagues reasoned that the ants were facing a trade-off between a shorter, faster path and the number of ants that had to be immobilised in building the structure - which would otherwise boost the community' foraging power.
From a foraging perspective, the shortest path is not necessarily the most efficient one.
"This is an elegant, quantitative study of the wonderful adaptive abilities of army ants," commented Prof Nigel Franks, who runs an ant research lab at the University of Bristol.
"The army ants are such effective raiders that they deplete their prey as they go.  They are here today, gone tomorrow.
"Using their bodies to build dynamic bridges and to cover "potholes" in their route makes sense to them, as opposed to spending time and energy bulldozing obstacles out of their way."
Mr Lutz, an architect by training, is interested in self-assembling structures. "I started doing this PhD in biology to study more specifically the structures that are formed by these ants," he said.
Contemporary architecture and robotics are turning to natural self-assembling systems like the army ants to learn how to design and produce such dynamic structures in the future.
"In 10-15 years, this sort of stuff will be more common," Mr Lutz predicted.
Chris Reid, his co-author on the study, expressed similar hopes.
"Artificial systems made of independent robots operating via the same principles as the army ants could build large-scale structures," said Dr Reid, who was working at the New Jersey Institute of Technology when the study was conducted but is now at the University of Sydney in Australia.
"Such swarms could accomplish remarkable tasks, such as creating bridges to navigate complex terrain, plugs to repair structural breaches, or supports to stabilise a failing structure."

The result meant The Bees are without a win in their last four matches and they have slipped to 18th in League Two.
Allen told BBC Radio London: "I thought it was a slow start but Orient started very well. As the game grew, we got stronger and stronger.
"Second half we were the dominant team, but I don't think we created too much. We had to keep our concentration."
Barnet lost 5-1 at Portsmouth the previous weekend and then drew 2-2 with Morecambe.
"We've had a long week," added Allen. "We played well at Portsmouth but ran out of legs. Losing 5-1 hurts and hurts anyone with a brain.
"On Tuesday night against Morecambe we played very well and were very dominant.
"But we freshened it up here and brought some new players, with fresh legs into the squad."
Ants are well-known for building with their bodies, but a new study has shown that army ants can optimise traffic flow using bridges that move.
[NEXT_CONCEPT]
Barmet manager Martin Allen says his side did not create enough chances in their 0-0 draw with Orient.