## 2 Optimization Algorithm of TMD  
### Artificial Fish Swarm Algorithm  
Swarm intelligence algorithms have a wide application in many areas to solve different problems. Swarm intelligence algorithms consist of many algorithms that are developed by imitating the behavior of animals in nature [35; 36]. The artificial fish swarm algorithm (AFSA) is one of the swarm intelligence algorithms. The actions of individual fish and the information interactions among them, when they are foraging and preying, are focused by the AFSA [42]. The AFSA is inspired by the individual, group and social behaviors of the fish. In a social form, it is searching for food, immigration, dealing with dangers and interactions between the fish in a swarm that result in intelligent group behavior [43; 44]. The AFSA has many advantages such as flexibility, great convergence speed, great accuracy, fault tolerance and so on [45]. Fish do not have the complex logical reasoning ability and comprehensive judgment ability of human beings. Their purpose is achieved through the simple behavior of individuals or groups. It can be found through observing fish activities that they have four basic behaviors which are preying, swarming, following and random behavior. The four behaviors can be interchanged under different conditions. By evaluating their behavior, fish can choose an optimal behavior to achieve higher food concentration. Among the four behaviors of artificial fish, the preying behavior is a fundamental behavior, which focuses mainly on searching of food. It is usually taken into consideration that artificial fish generally find the tendency to perceive the amount or concentration of food in the water by sight or taste. \(X_{i}\) is the artificial fish current state and in its visual distance, it will select a new state \(X_{j}\) randomly. \(Y\) is the food concentration, which means the value of the objective function. The artificial fish will find the global extreme value when the _Visual_ is greater, and it will converge more easily. \(Rand()\) is a random number between 0 and 1. \[X_{j}=X_{i}+Visual\cdot Rand() \tag{1}\]  
In the maximum problem, if \(Y_{i}<Y_{j}\), the artificial fish will go forward a \(Step\), which is a preset number in this direction. \[X_{i}^{t+1}=X_{i}^{t}+\frac{X_{j}-X_{i}^{t}}{\|X_{j}-X_{i}^{t}\|}\cdot Step \cdot Rand() \tag{2}\]  
If not, the artificial fish will choose a new state \(X_{j}\) randomly and judge whether it fits for the progressive condition. If the \(X_{j}\) still cannot fit it, the artificial fish will move a \(Step\) randomly. In the process of swarming, fish usually congregate in groups, which is a kind of life habit formed to guarantee the survival of the colony and keep away from danger. Each artificial fish is made as follows: it tries to swarm to the center of the neighboring partner and avoid overcrowding. \(n_{f}\) is the number of the center position artificial fish's companions in its _Visual_ distance (\(\|X_{j}-X_{i}^{t}\|\leq\textit{Visual}\)) and \(X_{center}\) is the center position. \[X_{center}=\frac{\sum\limits_{j=1}^{n_{f}}X_{j}}{n_{f}} \tag{3}\]  
If \(Y_{center}>Y_{i}\) and \(\frac{n_{f}}{n}<\delta\) (\(n\) is the number of total fish and \(\delta\) is the crowding factor which is preset), this means that the center position has more food, which means that the value of fitness function is higher, and it is not very crowded, so the artificial fish will move a \(Step\) to the center. \[X_{i}^{t+1}=X_{i}^{t}+\frac{X_{center}-X_{i}^{t}}{\|X_{center}-X_{i}^{t}\|} \cdot Step\cdot Rand() \tag{4}\]If not, it will execute the preying behavior. In the swarming factor, the function of the crowd factor is to limit the scale of swarms. Therefore, more artificial fish only cluster at the best area, and a situation in which the artificial fish moves to optimum in a wide field is ensured. When a fish finds more food and less crowded areas, nearby artificial fish will follow and quickly swim to the food.