# Virtual Pheromone Based Network Flow Control For Modular Robotic Systems
## 2 Problem Formulation
All the modules have no gradients at the beginning but they can be automatically assigned a gradient value in order when any module is activated with the first gradient. Once a designated module is activated as a _root_ by an user, it is initiated with the lowest integer gradient. Gradient of the other modules is automatically increased when the _root_ spreads out its gradient to immediate neighbours. If a module receives more than one gradient from its neighbours, it only selects and processes the lowest one. Eventually, every module in the network has its own gradient, thus a shortest communication path is automatically formed by all the modules following the gradient descent to the _root_. An example of a network of robotic modules with the gradient-based ID can be seen in Figure 1. Note that some robots might have the same gradient because they belong to different communication paths. Using the gradient-based routing as shown in Figure 1, there exist three typical intercommunication models between the _root_ and other modules: (1) one-to-many; (2) many-to-one; (3) one-to-one. In the one-to-many model, the _root_ sends data packets to other modules by a broadcasting communication protocol in which data packets can be relayed and transferred by following the gradient ascent. In the many-to-one model, the _root_ receives data packets following the gradient descent from any other modules. In the one-to-one model, data packets are transmitted to the _root_ by following the gradient descent, similar to the many-to-one model, but cannot be transferred from the _root_ to any other modules by following the gradient ascent because there are more than one communication paths with the same gradient ascent. That is, if the _root_ plays the role as a \"sensor or \"brain\" in the \"sense-think-act\" model of a robotic system, its commands may not properly reach a \"brain\" for data processing or an \"actuator\" for actions. Indeed, an adaptive routing algorithm for a bidirectional communication path in a network of physically connected robotic modules is required to develop practical applications. Figure 1: Gradient-based routing method: A _root_ is the lowest gradient and data packets are transmitted by following gradient descent from any module to the _root_, but not vice versa. In the one-to-one model, the gradient-based routing is only capable of generating an one-way communication path from _any module to the root_, but not from the _root_ to other modules. The intersection module plays a crucial role in relaying and forwarding data packets received from the _root_ to the right directional neighbour of the desired route. However, this module encounters difficulty if it has more than one neighbours with the same gradient. We see two possible technical solutions for the intersection module to handle this issue: broadcasting data packets to all the directional channels and randomly selecting a directional channel to send data packets. The former is a typical case of the one-to-all model in which data packets are forwarded to all the other modules in the network. However, an encoding method must be used to encrypt data packets and communication resource is overloaded, which is not realistic due to limited computing power and communication bandwidth of modular robotic systems. The later relies on randomness of channel selection so it also requires encryption of data packets thus encountering the limitation of overloading bandwidth and missing data packets. Indeed, both the broadcasting and random selection methods are not ideal solutions for generating a directional communication path from _the root to any module_ in the one-to-one model. In order to control data flow on a desired bidirectional communication path, we need to develop a communication mechanism that is simple enough to be executed on robotic modules, especially on intersection modules, but capable of directing data packets to desired destination at the highest possibility.