As autonomous cars become an increasingly interesting transport alternative, there will be a growing need for artificial intelligence applications to prevent traffic congestion and accidents. In simplest terms, this could mean that driverless cars will need to communicate and work together. That is why researchers see some promise in preventing both traffic jams and collisions by learning from ants, which are social insects.
Ant colony optimisation (ACO) was proposed in the early 1990s by Italian researcher Marco Dorigo. During his PhD thesis, he aimed to search for an optimal path in a graph based on the behaviour of ants searching for a path between the colony and a food source. The basic premise of the ant algorithm is to mimic the behaviour of ant colonies found in the real world. In contrast, their counterparts in digital reality are generated ants that will make limited evaluations of alternative options in the decision-making process.  To understand this phenomenon we need to delve into what “swarm intelligence” is. It is actually the collective behavior of any set of decentralized, self-organizing systems that are natural or artificial. It is now commonly used to describe work on artificial intelligence. Swarm intelligence refers to a general set of algorithms. How are such algorithms developed? Based on observations of animal behavior in the wild. This may be direct observation, as was the case in the development of the ant colony optimization algorithm, or it may result from analysis of data from other scientific papers describing the social behavior of selected animal species.
Algorithms inspired by ant behavior are expected to enable autonomous vehicles to communicate with each other in real time and behave as a “one” organism, which has been described as “swarm intelligence.” It is envisioned that cars will instead “communicate” about traffic jams and warn of other problems. For example, loaded trucks will know in advance if they are approaching a significant rise or a hill, thanks to digital maps and satellite navigation. The trucks’ artificial intelligence will be able to calculate that their journey will be slowed down. This can then relay this information to other vehicles in the vicinity, who, alerted by this message, will be able to make an immediate overtake, which in turn will greatly ease traffic.
Other examples of use cases:
In Polish law, the definition of an autonomous vehicle and the conditions for the use of roads for the purposes of research work on autonomous vehicles were introduced by the Act of 11 January 2018 on electromobility and alternative fuels (Journal of Laws of 2021, item 110), which amended the Act of 20 June 1997 – Road Traffic Law (Journal of Laws of 2021, item 450) by adding Section 6 “Use of roads for research work on autonomous vehicles” to Chapter 5 “Traffic order and safety on roads”.
The definition of autonomous vehicle in Article 65k reads as follows: Whenever this section refers to an autonomous vehicle, it shall mean a motor vehicle equipped with systems that exercise control over the movement of that vehicle and allow it to move without the intervention of the driver, who can take control of that vehicle at any time.In accordance with Article 65l, paragraph 1 of the Polish Road Traffic Law, on Polish roads it is possible to carry out tests on vehicles in accordance with the principles set out in the Act: Conducting research work related to the testing of autonomous vehicles in road traffic on public roads, in particular for the application of autonomous vehicles in public transport and the implementation of other public tasks, is possible provided that the safety requirements are met and a permit to carry out this work is obtained.
Experts at the Polish Institute of Motor Transport indicate that fully autonomous vehicles will appear on our roads around 2030. They point out, however, that by that time appropriate regulations should be implemented. However, there are doubts as to who, in a situation of collision, danger or even loss of life, becomes the subject of a dispute, possible lawsuit or compensation. Who is to bear primary responsibility in a situation where people die in an accident involving autonomous vehicles? This example shows that technological possibilities are ahead of the legal system. There is no doubt that product liability and product liability will become one of the more topical legislative issues, including Polish legal system, in the near future. 
 M. Dorigo, L.M Gambardella Ant Colony System: A Cooperative Learning Approach to The Traveling Salesman Problem, IEEE Transactions on Evolutionary Computation, 1997;