# An Improvement of a Mapping Method Based on Ant Colony Algorithm Applied to Smart Cities
## 1 Introduction
The evaluation index of node load balancing is the node load variance:  
\[\mathrm{VAR(N)}=\frac{\sum_{i=1}^{n}\left(\mathrm{k_{i}-\bar{k}}\right)^{2}}{n} \tag{4}\]In the formula, VAR(N) is the node load variance, k\({}_{i}\) is the load on the i-th node, that is, the number of neurons, \(\widetilde{\mathbf{k}}\) is the average node load, and n is the total number of links. Energy consumption. In a neuromorphic computing architecture computer, the energy consumption of the system can come from a variety of sources, including:  
Computational energy consumption: neuron processing impulse data inevitably brings energy consumption. Suspended state node energy consumption: In a scenario where a neuromorphic computer simulates a large-scale biological nervous system, many nodes will wait for the arrival of pulse data due to relatively sparse connections and other reasons. Therefore, in order to save energy, such nodes should be suspended state; the end of the suspended state is triggered by the arrival of the node. Communication energy consumption: The energy consumption caused by the propagation of pulse data between nodes, including routing units, links, etc. ; this part of the energy consumption is determined by factors such as the generation frequency and hop count of the system's pulse data packets. A pulse data from generation to response corresponds to its delay. In the biological nervous system, this delay also exists, whether it is the response time of biological neurons to electrical signals or the transmission time of electrical signals in axons and other parts, all of which cause delays in biological nervous systems. In neuromorphic computing, this time delay can be simulated by code inside the node. However, the delay caused by the forwarding of pulse data is difficult to predict, and this part of the delay may include the waiting time of the pulse data caused by the congestion problem, the delay caused by the communication link, and so on. Therefore, the forwarding delay is also one of the indicators to measure the system performance. Considering the above factors, the average hop count is the most important indicator to measure the entire system. The smaller the average hop count, the less the pulse data needs to be forwarded, which can reduce the communication pressure of the system, reduce congestion, reduce the energy consumption caused by communication, and reduce the delay from the generation of pulse data to the response, etc. Therefore, this paper chooses the average hop count as the optimization objective, and reduces the average hop count by designing a mapping algorithm. In 1991, [PERSON] proposed a simulated evolutionary algorithm, Ant Colony Optimization (ACO), inspired by the behavior of ant groups in finding the optimal path in their search for food [16; 17]. As shown in Figure 1, the colonies travel to and from points A and E (e.g., nest and food), following the shortest route. When an obstacle between A and E emerges, ants need to choose a side to pass around the obstacle. As ants leave pheromomes on their path initially, without any pheromones on either side, the colony will make a random decision. However, as time passes, after more and more ants pass around the shorter edge of the obstacle, the pheromone concentration on that side becomes higher, resulting in more ants following this path. Eventually, the entire colony will adopt this new path from point A to point E.  
The ant colony algorithm can be roughly divided into three stages:  
Initialization. The initialization includes two parts. One refers to the related hyperparameters, including the number of ants in the ant colony and the pheromone updates, among others. The other pertains to heuristic information: the decision basis of the ants, without any historical information. Solution construction. The most critical point in the algorithm is how each ant chooses a path based on the available information. (3) Pheromone update.