# Multiclass Interactive Martial Arts Teaching Optimization Method Based on Euclidean Distance

Authors: Zhechun Hu; Yunxing Wang
Journal: Security and Communication Networks
 (2022)

---

## Abstract

Aiming at the problems of low optimization accuracy, poor optimization effect, and long running time in current teaching optimization algorithms, a multiclass interactive martial arts teaching optimization method based on the Euclidean distance is proposed. Using the K-means algorithm, the initial population is divided into several subgroups based on the Euclidean distance, so as to effectively use the information of the population neighborhood and strengthen the local search ability of the algorithm. Imitating the school's selection of excellent teachers to guide students with poor performance, after the “teaching” stage, the worst individual in each subgroup will learn from the best individual in the population, and the information interaction in the evolutionary process will be enhanced, so that the poor individuals will quickly move closer to the best individuals. According to different learning levels and situations of students, different teaching stages and contents are divided, mainly by grade, supplemented by different types of learning groups in the form of random matching, so as to improve the learning ability of members with weak learning ability in each group, which effectively guarantees the diversity of the population and realizes multiclass interactive martial arts teaching optimization. Experimental results show that the optimization effect of the proposed method is better, which can effectively improve the accuracy of algorithm optimization and shorten the running time of the algorithm.


---

## Body

## 1. Introduction

With the development and progress of science, people are facing more and more problems, and the solutions to these problems are becoming more and more difficult. Many of them have become optimization problems [1–3]. People also put forward various optimization methods based on the phenomena in life, such as the gradient method, hill climbing method, linear programming method, simplex method, and so on. However, these traditional optimization algorithms show different defects in solving some complex optimization problems. Therefore, with the development of scientific research and the improvement of cognition level, many intelligent optimization algorithms with enlightening properties have appeared one after another [4–6].As a population-based heuristic algorithm, teaching optimization algorithm simulates the process of teachers teaching students in the class, so as to gradually improve the knowledge level of students in the class [7]. The algorithm is widely used in solving optimization problems because of its simplicity, easy understandability, less parameters and no specific information, fast optimization speed and strong convergence ability. The algorithm is very suitable for solving low-dimensional problems and high-dimensional single-peak optimization problems, but it is easy to lose the global optimal solution for high-dimensional multipeak optimization problems. Therefore, scholars in related fields have studied the teaching optimization algorithm. Zhu et al. [8] proposed a multiobjective teaching optimization algorithm based on Pareto advantage theory. Based on Pareto dominance theory, external archives are used to guide the search direction of the population. The hybrid mechanism of teacher selection strategy, student stage, and evolutionary search of external file population is improved. This method is effective. Zhang and Jin [9] proposed a group teaching optimization algorithm based on metaheuristic algorithm. According to the group teaching mechanism, this paper constructs a group teaching model composed of teacher distribution stage, ability grouping stage, teacher stage, and student stage. The solution quality of this method is good. However, the above methods still have the problems of poor optimization effect, low optimization accuracy, and long running time.In view of the above problems, a multiclass interactive Wushu teaching optimization method based on Euclidean distance is proposed. Euclidean distance is a centralized method, which can divide students into several subgroups, select students with different grades according to the school, make the worst individual in each subgroup learn from the best individual of the population after the “teaching” stage, make the poor individual quickly approach the best individual, and optimize the effect of multiclass interactive Wushu teaching as a whole. The optimization effect of this method is good, It can effectively improve the optimization accuracy of the algorithm and shorten the running time of the algorithm.


## 2. Related Algorithms

### 2.1. Basic Teaching Optimization Algorithm

Teaching-learning-based optimization (TLBO) is a new intelligent optimization algorithm that simulates the teaching process [10–12]. TLBO algorithm is a group-based heuristic optimization algorithm, which does not need any specific parameters of the algorithm. The algorithm simulates the process of teachers teaching students. Teachers and students are equivalent to individuals in evolutionary algorithm, students’ learning performance is fitness value, teachers are the individuals with the best fitness value, and each subject studied by students is equivalent to a decision variable. The algorithm has the advantages of simple algorithm and good convergence performance.


#### 2.1.1. Basic Theory of TLBO Algorithm

The so-called optimization problem is to find a set of parameter values under certain constraints, so that certain optimality metrics can be satisfied, even if certain performance indicators of the system reach the best or minimum. Optimization problems can be divided into many categories according to their objective function, the nature of the constraint function, and the value of the optimization variable. Each type of optimization problem has a specific solution method according to its nature [13–15]. Without loss of generality, suppose the considered optimization problem is(1)z=minfXs.t.X∈S=X|giX≤0,j=1,2,…,d,where z=minfX is the objective function, giX is the constraint function, S is the constraint domain, and X is the optimization variable. In order to use the TLBO algorithm to solve the optimization problem, the concepts in the algorithm correspond to the parameters in the optimization problem. The search space in the optimization problem is the entire class in the algorithm, namely:(2)S=X|xiL≤xi≤xiU,i=1,2,3,…,d,where X=x1,x2,…,xd is a student in the class in the algorithm, d is the number of subjects each student learns, that is, the number of decision variables corresponding to the feasible solution in the optimization problem, xiL and xiU are, respectively, the highest and lowest scores of each subject studied by the students, which are equivalent to the upper and lower limits of the feasible solution decision variables in each dimension of the optimization problem, and fX is the objective function in the optimization problem, that is, the fitness value or evaluation function for evaluating student performance in the algorithm [16–18]. Suppose Xj=x1j,x2j,…,xdj,j=1,2,…,NP, is a point in the entire search space in the optimization problem, and xiji=1,2,…,d is a decision variable at point Xj, that is, the learning subject in the algorithm. NP is the number of searches in the search space in the optimization problem, that is, the size of the population, which is equivalent to the number of students in the class in the algorithm. The optimization problem corresponds to the following mathematical model:(1)
Class: in the TLBO algorithm, the set of all points in the search space is used as the entire class.(2)
Student: at a certain point in the class, that is, a feasible solution in the search space,Xj=x1j,x2j,…,xdj is a student, and d is the subject the student is studying.(3)
Teacher: studentXi with the best performance in the class, that is, the student with the best fitness value, is called the teacher, denoted by Xteacher. Therefore, the matrix of a class can be expressed as(3)X1X2⋮XNP|fx1fx2⋮fxNP=x11x21⋯xd1|fX1x12x22⋯xd2|fX2⋮⋮⋮x1NPx2NP⋯xdNP|fXNP.


#### 2.1.2. Basic Flow of TLBO Algorithm

Assuming that the distribution of students in a class conforms to the normal distribution, the distribution density function is as follows:(4)fX=1σ2πe−x−μ2/2σ2,where σ is the standard deviation and μ is the mathematical expectation of X. The steps of the basic TLBO algorithm are as follows.Initialize the performance of each student in the entire class and the main parameters of the algorithm. Each studentXj=x1j,x2j,…,xdj,j=1,2,…,NP, in the class is randomly generated in the search space.(5)xij=xiL+rand0,1×xiU−xiL,j=1,2,…,NP;i=1,2,…,d.(1)
“Teaching” stage: in the “teaching” stage of the TLBO algorithm, each studentXjj=1,2,…,NP in the class will learn according to the difference between the teacher Xteacher and the student's average grade mean. The score distribution model of “teaching” stage is shown in Figure 1.As shown in Figure1, the average grade meanA of the class at the beginning is at a low level, and the grades are widely distributed and scattered. After many “teaching” classes by the teacher, the average grade of the class gradually increased from the lower meanA to the higher meanB, and the distribution of grades became relatively concentrated. The “teaching” process in the TLBO algorithm can be expressed by the following formula:(6)Xnewi=Xoldi+difference,difference=ri×Xteacher−TFi×mean,mean=1NP∑i=1NPXi,whereXoldi and Xnewi are the values of the ith student before and after the teacher's teaching, mean is the average of all students in the entire class, and TFi=round1+rand0,1 and ri=rand0,1 are the teacher's teaching factor and learning step length, respectively. After the “teaching” is over, update each student's grades. According to the comparison between the results after study and the results before study, update each student:(7)Xoldi=Xnewi,iffXnewi>fXoldi.(2)
“Learning” stage: for each studentXii=1,2,…,NP, randomly select a student in the class as the learning object Xjj=1,2,…,NP,j≠i, and student Xi makes learning adjustment after analyzing and understanding the differences of student Xj. The improved learning method is similar to the differential mutation operator in the difference algorithm. The difference is that the learning step r in the TLBO algorithm is different for each student [19–21]. Use the following formula to realize the student's “learning” process:(8)Xnewi=Xoldi+ri×Xi−Xj,fXi<fXj,Xnewi=Xoldi+ri×Xj−Xi,fXj<fXi,whereri=U0,1 represents the learning factor of the ith student, that is, the learning step length. Update student actions:(9)Xoldi=Xnewi,iffXnewi≤fXoldi.Figure 1
Achievement distribution model in “teaching” stage.If the end conditions are met, the optimization process ends; otherwise, it jumps to the “teaching” stage to continue. The fitness function used by the TLBO algorithm is as follows:(1)
Using Euclidean distance formula [22–24] for all class centers Cij, the formula for calculating distance dz,pvij is as follows:(10)dz,pvi=∑j=1sz−jpvji2,wherezjp is the jth attribute of zp and vji is the jth attribute of vi. Assign zp to Cij according to the following:(11)dz,pvij=mindz,pvic,∀c=1,2,…,C.(2)
Calculate the fitness function and measure the quantization error formula of the candidate class center:(12)Je=∑j=1C∑∀z∈pCijdz,pvj/CijC,whereCij is the number of zp contained in Cij. The flow of the TLBO algorithm is shown in Figure 2.Figure 2
TLBO algorithm flowchart.It can be found from Figure2 that the “teaching” stage of this algorithm is similar to the social search part of particle swarm optimization algorithm. When every student is learning knowledge from teachers, the whole class (i.e., population) is easy to get close to teachers, and the search speed is relatively fast. However, it affects the diversity of the whole population and is very easy to fall into local search, that is, what we find is the local optimal solution rather than the global optimal solution [25–27].The “learning” stage among students is the exchange of learning between students, learning from each other, and improving each other's achievements. At this stage, students learn from each other, so that the whole search will not prematurely approach the direction of the global best, so as to effectively maintain the diverse characteristics of the whole students, that is, individuals in the population, and ensure the global search ability of the algorithm in the whole search space.


### 2.2. K-Means Clustering Algorithm

The K-means algorithm realizes the overall adjustment and optimization of cluster centers by adjusting the minimum mean square error function corresponding to the optimized distance as the objective function [28–30]. The similarity measurement of K-means algorithm usually uses the Euclidean distance as the benchmark and uses the error square sum clustering criterion function Jc as the evaluation function [31–33], which is defined as(13)Jc=∑i=1k∑p∈cjp−Vi2,where Vi is the center of the ith class. The specific steps of the algorithm are as follows.Step 1.
Randomly selectk sample data points from the dataset X=x1,x2,…,xn⊂Rd as the initial clustering center, denoted as C=c1,c2,…,ck, and denote the cluster with cj as the clustering center as wj.Step 2.
Calculate the Euclidean distanceDxi,cm,i=1,2,…,n,m=1,2,…,k, from each sample data object to the cluster center, if it satisfies(14)Dxi,cj=minDxi,cm,m=1,2,…,k.
Then, divide theith data into the jth cluster, namely, xi∈wj.Step 3.
Calculate the average value of all data objects in each cluster as the new cluster centercj′. If the data in cluster wj are xij,i=1,2,…,nj, nj is the number of data in cluster wj, namely:(15)cj′=1n∑i=1njxij,j=1,2,…,k.Step 4.
Calculate the error square sum clustering criterion objective function [34] Jc, namely:(16)Jc=∑j=1k∑i=1njxij−cj2.Step 5.
Determine whether the criterion objective functionJc is convergent. If it converges, the algorithm ends and the clustering result is output; otherwise, go to Step 2 and continue the calculation.


## 2.1. Basic Teaching Optimization Algorithm

Teaching-learning-based optimization (TLBO) is a new intelligent optimization algorithm that simulates the teaching process [10–12]. TLBO algorithm is a group-based heuristic optimization algorithm, which does not need any specific parameters of the algorithm. The algorithm simulates the process of teachers teaching students. Teachers and students are equivalent to individuals in evolutionary algorithm, students’ learning performance is fitness value, teachers are the individuals with the best fitness value, and each subject studied by students is equivalent to a decision variable. The algorithm has the advantages of simple algorithm and good convergence performance.


### 2.1.1. Basic Theory of TLBO Algorithm

The so-called optimization problem is to find a set of parameter values under certain constraints, so that certain optimality metrics can be satisfied, even if certain performance indicators of the system reach the best or minimum. Optimization problems can be divided into many categories according to their objective function, the nature of the constraint function, and the value of the optimization variable. Each type of optimization problem has a specific solution method according to its nature [13–15]. Without loss of generality, suppose the considered optimization problem is(1)z=minfXs.t.X∈S=X|giX≤0,j=1,2,…,d,where z=minfX is the objective function, giX is the constraint function, S is the constraint domain, and X is the optimization variable. In order to use the TLBO algorithm to solve the optimization problem, the concepts in the algorithm correspond to the parameters in the optimization problem. The search space in the optimization problem is the entire class in the algorithm, namely:(2)S=X|xiL≤xi≤xiU,i=1,2,3,…,d,where X=x1,x2,…,xd is a student in the class in the algorithm, d is the number of subjects each student learns, that is, the number of decision variables corresponding to the feasible solution in the optimization problem, xiL and xiU are, respectively, the highest and lowest scores of each subject studied by the students, which are equivalent to the upper and lower limits of the feasible solution decision variables in each dimension of the optimization problem, and fX is the objective function in the optimization problem, that is, the fitness value or evaluation function for evaluating student performance in the algorithm [16–18]. Suppose Xj=x1j,x2j,…,xdj,j=1,2,…,NP, is a point in the entire search space in the optimization problem, and xiji=1,2,…,d is a decision variable at point Xj, that is, the learning subject in the algorithm. NP is the number of searches in the search space in the optimization problem, that is, the size of the population, which is equivalent to the number of students in the class in the algorithm. The optimization problem corresponds to the following mathematical model:(1)
Class: in the TLBO algorithm, the set of all points in the search space is used as the entire class.(2)
Student: at a certain point in the class, that is, a feasible solution in the search space,Xj=x1j,x2j,…,xdj is a student, and d is the subject the student is studying.(3)
Teacher: studentXi with the best performance in the class, that is, the student with the best fitness value, is called the teacher, denoted by Xteacher. Therefore, the matrix of a class can be expressed as(3)X1X2⋮XNP|fx1fx2⋮fxNP=x11x21⋯xd1|fX1x12x22⋯xd2|fX2⋮⋮⋮x1NPx2NP⋯xdNP|fXNP.


### 2.1.2. Basic Flow of TLBO Algorithm

Assuming that the distribution of students in a class conforms to the normal distribution, the distribution density function is as follows:(4)fX=1σ2πe−x−μ2/2σ2,where σ is the standard deviation and μ is the mathematical expectation of X. The steps of the basic TLBO algorithm are as follows.Initialize the performance of each student in the entire class and the main parameters of the algorithm. Each studentXj=x1j,x2j,…,xdj,j=1,2,…,NP, in the class is randomly generated in the search space.(5)xij=xiL+rand0,1×xiU−xiL,j=1,2,…,NP;i=1,2,…,d.(1)
“Teaching” stage: in the “teaching” stage of the TLBO algorithm, each studentXjj=1,2,…,NP in the class will learn according to the difference between the teacher Xteacher and the student's average grade mean. The score distribution model of “teaching” stage is shown in Figure 1.As shown in Figure1, the average grade meanA of the class at the beginning is at a low level, and the grades are widely distributed and scattered. After many “teaching” classes by the teacher, the average grade of the class gradually increased from the lower meanA to the higher meanB, and the distribution of grades became relatively concentrated. The “teaching” process in the TLBO algorithm can be expressed by the following formula:(6)Xnewi=Xoldi+difference,difference=ri×Xteacher−TFi×mean,mean=1NP∑i=1NPXi,whereXoldi and Xnewi are the values of the ith student before and after the teacher's teaching, mean is the average of all students in the entire class, and TFi=round1+rand0,1 and ri=rand0,1 are the teacher's teaching factor and learning step length, respectively. After the “teaching” is over, update each student's grades. According to the comparison between the results after study and the results before study, update each student:(7)Xoldi=Xnewi,iffXnewi>fXoldi.(2)
“Learning” stage: for each studentXii=1,2,…,NP, randomly select a student in the class as the learning object Xjj=1,2,…,NP,j≠i, and student Xi makes learning adjustment after analyzing and understanding the differences of student Xj. The improved learning method is similar to the differential mutation operator in the difference algorithm. The difference is that the learning step r in the TLBO algorithm is different for each student [19–21]. Use the following formula to realize the student's “learning” process:(8)Xnewi=Xoldi+ri×Xi−Xj,fXi<fXj,Xnewi=Xoldi+ri×Xj−Xi,fXj<fXi,whereri=U0,1 represents the learning factor of the ith student, that is, the learning step length. Update student actions:(9)Xoldi=Xnewi,iffXnewi≤fXoldi.Figure 1
Achievement distribution model in “teaching” stage.If the end conditions are met, the optimization process ends; otherwise, it jumps to the “teaching” stage to continue. The fitness function used by the TLBO algorithm is as follows:(1)
Using Euclidean distance formula [22–24] for all class centers Cij, the formula for calculating distance dz,pvij is as follows:(10)dz,pvi=∑j=1sz−jpvji2,wherezjp is the jth attribute of zp and vji is the jth attribute of vi. Assign zp to Cij according to the following:(11)dz,pvij=mindz,pvic,∀c=1,2,…,C.(2)
Calculate the fitness function and measure the quantization error formula of the candidate class center:(12)Je=∑j=1C∑∀z∈pCijdz,pvj/CijC,whereCij is the number of zp contained in Cij. The flow of the TLBO algorithm is shown in Figure 2.Figure 2
TLBO algorithm flowchart.It can be found from Figure2 that the “teaching” stage of this algorithm is similar to the social search part of particle swarm optimization algorithm. When every student is learning knowledge from teachers, the whole class (i.e., population) is easy to get close to teachers, and the search speed is relatively fast. However, it affects the diversity of the whole population and is very easy to fall into local search, that is, what we find is the local optimal solution rather than the global optimal solution [25–27].The “learning” stage among students is the exchange of learning between students, learning from each other, and improving each other's achievements. At this stage, students learn from each other, so that the whole search will not prematurely approach the direction of the global best, so as to effectively maintain the diverse characteristics of the whole students, that is, individuals in the population, and ensure the global search ability of the algorithm in the whole search space.


## 2.1.1. Basic Theory of TLBO Algorithm

The so-called optimization problem is to find a set of parameter values under certain constraints, so that certain optimality metrics can be satisfied, even if certain performance indicators of the system reach the best or minimum. Optimization problems can be divided into many categories according to their objective function, the nature of the constraint function, and the value of the optimization variable. Each type of optimization problem has a specific solution method according to its nature [13–15]. Without loss of generality, suppose the considered optimization problem is(1)z=minfXs.t.X∈S=X|giX≤0,j=1,2,…,d,where z=minfX is the objective function, giX is the constraint function, S is the constraint domain, and X is the optimization variable. In order to use the TLBO algorithm to solve the optimization problem, the concepts in the algorithm correspond to the parameters in the optimization problem. The search space in the optimization problem is the entire class in the algorithm, namely:(2)S=X|xiL≤xi≤xiU,i=1,2,3,…,d,where X=x1,x2,…,xd is a student in the class in the algorithm, d is the number of subjects each student learns, that is, the number of decision variables corresponding to the feasible solution in the optimization problem, xiL and xiU are, respectively, the highest and lowest scores of each subject studied by the students, which are equivalent to the upper and lower limits of the feasible solution decision variables in each dimension of the optimization problem, and fX is the objective function in the optimization problem, that is, the fitness value or evaluation function for evaluating student performance in the algorithm [16–18]. Suppose Xj=x1j,x2j,…,xdj,j=1,2,…,NP, is a point in the entire search space in the optimization problem, and xiji=1,2,…,d is a decision variable at point Xj, that is, the learning subject in the algorithm. NP is the number of searches in the search space in the optimization problem, that is, the size of the population, which is equivalent to the number of students in the class in the algorithm. The optimization problem corresponds to the following mathematical model:(1)
Class: in the TLBO algorithm, the set of all points in the search space is used as the entire class.(2)
Student: at a certain point in the class, that is, a feasible solution in the search space,Xj=x1j,x2j,…,xdj is a student, and d is the subject the student is studying.(3)
Teacher: studentXi with the best performance in the class, that is, the student with the best fitness value, is called the teacher, denoted by Xteacher. Therefore, the matrix of a class can be expressed as(3)X1X2⋮XNP|fx1fx2⋮fxNP=x11x21⋯xd1|fX1x12x22⋯xd2|fX2⋮⋮⋮x1NPx2NP⋯xdNP|fXNP.


## 2.1.2. Basic Flow of TLBO Algorithm

Assuming that the distribution of students in a class conforms to the normal distribution, the distribution density function is as follows:(4)fX=1σ2πe−x−μ2/2σ2,where σ is the standard deviation and μ is the mathematical expectation of X. The steps of the basic TLBO algorithm are as follows.Initialize the performance of each student in the entire class and the main parameters of the algorithm. Each studentXj=x1j,x2j,…,xdj,j=1,2,…,NP, in the class is randomly generated in the search space.(5)xij=xiL+rand0,1×xiU−xiL,j=1,2,…,NP;i=1,2,…,d.(1)
“Teaching” stage: in the “teaching” stage of the TLBO algorithm, each studentXjj=1,2,…,NP in the class will learn according to the difference between the teacher Xteacher and the student's average grade mean. The score distribution model of “teaching” stage is shown in Figure 1.As shown in Figure1, the average grade meanA of the class at the beginning is at a low level, and the grades are widely distributed and scattered. After many “teaching” classes by the teacher, the average grade of the class gradually increased from the lower meanA to the higher meanB, and the distribution of grades became relatively concentrated. The “teaching” process in the TLBO algorithm can be expressed by the following formula:(6)Xnewi=Xoldi+difference,difference=ri×Xteacher−TFi×mean,mean=1NP∑i=1NPXi,whereXoldi and Xnewi are the values of the ith student before and after the teacher's teaching, mean is the average of all students in the entire class, and TFi=round1+rand0,1 and ri=rand0,1 are the teacher's teaching factor and learning step length, respectively. After the “teaching” is over, update each student's grades. According to the comparison between the results after study and the results before study, update each student:(7)Xoldi=Xnewi,iffXnewi>fXoldi.(2)
“Learning” stage: for each studentXii=1,2,…,NP, randomly select a student in the class as the learning object Xjj=1,2,…,NP,j≠i, and student Xi makes learning adjustment after analyzing and understanding the differences of student Xj. The improved learning method is similar to the differential mutation operator in the difference algorithm. The difference is that the learning step r in the TLBO algorithm is different for each student [19–21]. Use the following formula to realize the student's “learning” process:(8)Xnewi=Xoldi+ri×Xi−Xj,fXi<fXj,Xnewi=Xoldi+ri×Xj−Xi,fXj<fXi,whereri=U0,1 represents the learning factor of the ith student, that is, the learning step length. Update student actions:(9)Xoldi=Xnewi,iffXnewi≤fXoldi.Figure 1
Achievement distribution model in “teaching” stage.If the end conditions are met, the optimization process ends; otherwise, it jumps to the “teaching” stage to continue. The fitness function used by the TLBO algorithm is as follows:(1)
Using Euclidean distance formula [22–24] for all class centers Cij, the formula for calculating distance dz,pvij is as follows:(10)dz,pvi=∑j=1sz−jpvji2,wherezjp is the jth attribute of zp and vji is the jth attribute of vi. Assign zp to Cij according to the following:(11)dz,pvij=mindz,pvic,∀c=1,2,…,C.(2)
Calculate the fitness function and measure the quantization error formula of the candidate class center:(12)Je=∑j=1C∑∀z∈pCijdz,pvj/CijC,whereCij is the number of zp contained in Cij. The flow of the TLBO algorithm is shown in Figure 2.Figure 2
TLBO algorithm flowchart.It can be found from Figure2 that the “teaching” stage of this algorithm is similar to the social search part of particle swarm optimization algorithm. When every student is learning knowledge from teachers, the whole class (i.e., population) is easy to get close to teachers, and the search speed is relatively fast. However, it affects the diversity of the whole population and is very easy to fall into local search, that is, what we find is the local optimal solution rather than the global optimal solution [25–27].The “learning” stage among students is the exchange of learning between students, learning from each other, and improving each other's achievements. At this stage, students learn from each other, so that the whole search will not prematurely approach the direction of the global best, so as to effectively maintain the diverse characteristics of the whole students, that is, individuals in the population, and ensure the global search ability of the algorithm in the whole search space.


## 2.2. K-Means Clustering Algorithm

The K-means algorithm realizes the overall adjustment and optimization of cluster centers by adjusting the minimum mean square error function corresponding to the optimized distance as the objective function [28–30]. The similarity measurement of K-means algorithm usually uses the Euclidean distance as the benchmark and uses the error square sum clustering criterion function Jc as the evaluation function [31–33], which is defined as(13)Jc=∑i=1k∑p∈cjp−Vi2,where Vi is the center of the ith class. The specific steps of the algorithm are as follows.Step 1.
Randomly selectk sample data points from the dataset X=x1,x2,…,xn⊂Rd as the initial clustering center, denoted as C=c1,c2,…,ck, and denote the cluster with cj as the clustering center as wj.Step 2.
Calculate the Euclidean distanceDxi,cm,i=1,2,…,n,m=1,2,…,k, from each sample data object to the cluster center, if it satisfies(14)Dxi,cj=minDxi,cm,m=1,2,…,k.
Then, divide theith data into the jth cluster, namely, xi∈wj.Step 3.
Calculate the average value of all data objects in each cluster as the new cluster centercj′. If the data in cluster wj are xij,i=1,2,…,nj, nj is the number of data in cluster wj, namely:(15)cj′=1n∑i=1njxij,j=1,2,…,k.Step 4.
Calculate the error square sum clustering criterion objective function [34] Jc, namely:(16)Jc=∑j=1k∑i=1njxij−cj2.Step 5.
Determine whether the criterion objective functionJc is convergent. If it converges, the algorithm ends and the clustering result is output; otherwise, go to Step 2 and continue the calculation.


## 3. Multiclass Interactive Martial Arts Teaching Optimization Method

In order to effectively improve the accuracy and stability of algorithm optimization, this paper proposes a multiclass interactive martial arts teaching optimization algorithm (multiclass interaction TLBO (MCITLBO)). First, the K-means algorithm is used to divide the initial population into several subgroups based on the Euclidean distance, so as to effectively use the information of the population neighborhood and strengthen the local search ability of the algorithm. Then, follow the example of the school by selecting excellent teachers to tutor students who have poor performance. After the “teaching” stage, make the worst individual of each subgroup learn from the best individual of the population, enhance the information interaction in the process of evolution, and quickly make the poor individual close to the best individual. Finally, according to students’ different learning levels and situations, at the end of the “learning” stage, different types of learning groups are divided according to their learning levels, and all learning members in the group are randomly matched to ensure the diversity of members in the group.


### 3.1. Multiclass Division

According to the K-means algorithm, the initial grade is divided into multiple classes based on the Euclidean distance. The specific steps are as follows.Step 1.
Generate an initial population and randomly generate a correlation pointR in the search space.Step 2.
Find the closest individualx between R (i.e., the smallest Euclidean distance).Step 3.
Form a subgroup ofx and the M−1 closest individuals to x.Step 4.
EvaluateM individuals.Step 5.
Repeat Steps1 to 4 until the initial population is divided into NP/M subgroups.


### 3.2. Communication between the Worst Students and the Best Teachers

In real life, in order to improve the performance of poor students, the school will organize the best teachers to provide after-school guidance. Based on this principle, after the “teaching” stage, select the worst individual in each subgroup to communicate with the best individual in the whole population and accelerate the poor individual to approach the best individual. The specific steps are as follows.Step 1.
For thekth iteration, find the best individual Tk in the population.Step 2.
Find the worst individualxii=1∼M in each subgroup.Step 3.
Let the worst individual learn from the best individual; the method is as follows:(17)xnew,i=xold,i+randTk−xold,i.Step 4.
Ifxnew,i is better than xold,i, then accept xnew,i; otherwise, keep xold,i.


### 3.3. Students Learning from Each Other between Classes

In schools, students in different classes will flow to each other and have an impact. In order to strengthen the information interaction between different classes in the process of evolution and enhance the population diversity, after the “learning” stage, a random student in each class will communicate with the students in the other two classes. The specific steps are as follows.Step 1.
In thekth iteration, randomly select a student xM1 from class M1.Step 2.
Randomly generate another two classesM2 and M3 and random students xM2 and xM3 in each class.Step 3.
UpdatexM1 as follows:(18)xnew,M1=xold,M1+randxM2−xM3,iffxM2<fxM3,xnew,M1=xold,M1+randxM3−xM2,iffxM2<xM3.Step 4.
Ifxnew,M1 is better than xold,M1, accept xnew,M1; otherwise, keep xold,M1.


### 3.4. Proof of Convergence of the Algorithm

Without loss of generality, it may as well set the global optimal value of the problem to be solved asxgbest. In the iterative process of the TLBO algorithm, the optimal solution of the current population can be set as xteachert, which is the individual teacher. If the TLBO algorithm is convergent, it should have(19)limt⟶∞xteachert=xgbest.After clustering, the original feasible region is divided intoM subregions, denoted as Ω1,Ω2,…,ΩM, and the local optimal individual of Ωi is set to xi,teachert, and then there should be(20)xteachert=minx1,teachert,x2,teachert,…,xM,teachert.Each class completes “teaching” and “learning” independently. Due to the convergence of the TLBO algorithm, after a certain number of iterations, each region must converge to the local optimum [35], that is, for the subregion Ωi, there must be(21)limt⟶∞xi,teachert=xi,gbest.In the improved algorithm, the introduction of two learning methods establishes the individual communication between each subregion, makes each subgroup evolve synchronously, avoids the phenomenon of “lag” or “precocity,” and ensures the global convergence of the algorithm [36]. Therefore, after the algorithm meets a certain number of iterations, there must be(22)xgbest=minx1,gbest,x2,gbest,…,xM,gbest.To sum up, MCITLBO algorithm is convergent.


### 3.5. Diversity Measurement of Algorithm

Through the above description of the MCITLBO algorithm, the flow of the MCITLBO algorithm is shown in Figure3.Figure 3
MCITLBO algorithm flowchart.In order to explain the performance of the MCITLBO algorithm in terms of population diversity more accurately, population entropy is introduced to measure the diversity of the algorithm. If thetth generation population has Q subsets S1t,S2t,…,SQt, the number contained in each subset is recorded as(23)S1t,S2t,…,SQt,Q≤N,Spt∩Sqt=∅,∪q=1QSqt=At,where p,q∈1,2,…,Q and At represent the set of the tth generation population, and the entropy of the tth generation population is defined as(24)E=−∑j=1Qpjlgpj,where Q is the population size and pj=Sj/N. It can be seen from the definition that when all individuals in the population have the same fitness value, the entropy takes the minimum value E=0. The larger the individual fitness value, the more uniform the individual distribution and the larger the entropy value.


## 3.1. Multiclass Division

According to the K-means algorithm, the initial grade is divided into multiple classes based on the Euclidean distance. The specific steps are as follows.Step 1.
Generate an initial population and randomly generate a correlation pointR in the search space.Step 2.
Find the closest individualx between R (i.e., the smallest Euclidean distance).Step 3.
Form a subgroup ofx and the M−1 closest individuals to x.Step 4.
EvaluateM individuals.Step 5.
Repeat Steps1 to 4 until the initial population is divided into NP/M subgroups.


## 3.2. Communication between the Worst Students and the Best Teachers

In real life, in order to improve the performance of poor students, the school will organize the best teachers to provide after-school guidance. Based on this principle, after the “teaching” stage, select the worst individual in each subgroup to communicate with the best individual in the whole population and accelerate the poor individual to approach the best individual. The specific steps are as follows.Step 1.
For thekth iteration, find the best individual Tk in the population.Step 2.
Find the worst individualxii=1∼M in each subgroup.Step 3.
Let the worst individual learn from the best individual; the method is as follows:(17)xnew,i=xold,i+randTk−xold,i.Step 4.
Ifxnew,i is better than xold,i, then accept xnew,i; otherwise, keep xold,i.


## 3.3. Students Learning from Each Other between Classes

In schools, students in different classes will flow to each other and have an impact. In order to strengthen the information interaction between different classes in the process of evolution and enhance the population diversity, after the “learning” stage, a random student in each class will communicate with the students in the other two classes. The specific steps are as follows.Step 1.
In thekth iteration, randomly select a student xM1 from class M1.Step 2.
Randomly generate another two classesM2 and M3 and random students xM2 and xM3 in each class.Step 3.
UpdatexM1 as follows:(18)xnew,M1=xold,M1+randxM2−xM3,iffxM2<fxM3,xnew,M1=xold,M1+randxM3−xM2,iffxM2<xM3.Step 4.
Ifxnew,M1 is better than xold,M1, accept xnew,M1; otherwise, keep xold,M1.


## 3.4. Proof of Convergence of the Algorithm

Without loss of generality, it may as well set the global optimal value of the problem to be solved asxgbest. In the iterative process of the TLBO algorithm, the optimal solution of the current population can be set as xteachert, which is the individual teacher. If the TLBO algorithm is convergent, it should have(19)limt⟶∞xteachert=xgbest.After clustering, the original feasible region is divided intoM subregions, denoted as Ω1,Ω2,…,ΩM, and the local optimal individual of Ωi is set to xi,teachert, and then there should be(20)xteachert=minx1,teachert,x2,teachert,…,xM,teachert.Each class completes “teaching” and “learning” independently. Due to the convergence of the TLBO algorithm, after a certain number of iterations, each region must converge to the local optimum [35], that is, for the subregion Ωi, there must be(21)limt⟶∞xi,teachert=xi,gbest.In the improved algorithm, the introduction of two learning methods establishes the individual communication between each subregion, makes each subgroup evolve synchronously, avoids the phenomenon of “lag” or “precocity,” and ensures the global convergence of the algorithm [36]. Therefore, after the algorithm meets a certain number of iterations, there must be(22)xgbest=minx1,gbest,x2,gbest,…,xM,gbest.To sum up, MCITLBO algorithm is convergent.


## 3.5. Diversity Measurement of Algorithm

Through the above description of the MCITLBO algorithm, the flow of the MCITLBO algorithm is shown in Figure3.Figure 3
MCITLBO algorithm flowchart.In order to explain the performance of the MCITLBO algorithm in terms of population diversity more accurately, population entropy is introduced to measure the diversity of the algorithm. If thetth generation population has Q subsets S1t,S2t,…,SQt, the number contained in each subset is recorded as(23)S1t,S2t,…,SQt,Q≤N,Spt∩Sqt=∅,∪q=1QSqt=At,where p,q∈1,2,…,Q and At represent the set of the tth generation population, and the entropy of the tth generation population is defined as(24)E=−∑j=1Qpjlgpj,where Q is the population size and pj=Sj/N. It can be seen from the definition that when all individuals in the population have the same fitness value, the entropy takes the minimum value E=0. The larger the individual fitness value, the more uniform the individual distribution and the larger the entropy value.


## 4. Experimental Analysis

In order to verify the effectiveness of the multiclass interactive martial arts teaching optimization method based on the Euclidean distance, the MCITLBO algorithm is simulated and tested by the test function.


### 4.1. Experimental Environment and Dataset

The algorithm operating platform conditions are as follows: the operating system is Windows 7 (x32), the CPU is Intel Celeron CPU B815 (1.60 GHz), and the programming language operating environment is MATLAB (2016a). The algorithm parameter is set to the number of students in class (i.e., the number of populations)NP=10, the number of subjects for each student (that is, the dimensionality of the search space) is 30, the maximum value of the teaching factor is TFmax=2, and the minimum value is TFmin=1. Since students face a teacher, their self-confidence will be relatively low, and when they face classmates, they are more likely to believe in their own knowledge, so the self-confidence takes the experience constant w1=0.1,w2=0.5 and the maximum number of iterations maxGen=100.


### 4.2. Comparison Results of Optimization Effects

In order to verify the optimization effect of the proposed method, the algorithm runs 20 times independently, selects the average value of 20 iterations as the comparison standard, compares the proposed method with the method in reference [8] and the method in reference [9], and obtains the optimization effect comparison results of different methods as shown in Figure 4.Figure 4
Comparison results of optimization effects of different methods.As can be seen from Figure4, as the number of iterations increases, the function fitness values of different methods decrease. Among them, the convergence of the proposed method is obviously better than the methods in reference [8] and reference [9]. At 50, it has achieved convergence, and its optimization effect is good, which can effectively improve the convergence of the algorithm.


### 4.3. Comparison Results of Optimization Accuracy

On this basis, the optimization accuracy of the proposed method is further verified, and the algorithm including the standard deviation of the optimal solution is used as the evaluation index. The smaller the standard deviation, the higher the optimization accuracy of the method. By comparing the method in reference [8], the method in reference [9], and the proposed method, the optimization accuracy of different methods is obtained, and the comparison results are shown in Figure 5.Figure 5
Comparison results of optimization accuracy of different methods.It can be seen from Figure5 that the standard deviation of the optimal solution of different methods gradually increases with the increase of the number of iterations. When the number of iterations is 100, the standard deviation of the optimal solution of the method in reference [8] is 9.1, the standard deviation of the optimal solution of the method in reference [9] is 14.2, and the standard deviation of the optimal solution of the proposed method is 6.5. It can be seen that compared with the method in reference [8] and the method in reference [9], the standard deviation of the optimal solution of the proposed method is smaller, indicating that the optimization accuracy of the proposed method is higher. This is because in the “learning” stage, the cluster partition method of euclidean distance is adopted to cover different types of individual members into different learning groups, which improves the utilization rate of resource information and effectively improves the technical accuracy of the optimal solution.


### 4.4. Comparison Results of Running Time

As can be seen from Figure6, with the increase of the number of iterations, the running time of different methods increases. When the number of iterations is 100, the running time of the method in reference [8] is 39 s, the running time of the method in reference [9] is 55 s, and the running time of the proposed method is only 21 s. It can be seen that the running time of the proposed method is shorter than that of the method in reference [8] and the method in reference [9]. Because the proposed method selects K-means algorithm, the teaching optimization algorithm has good global search ability, effectively shortening the running time of the method.Figure 6
Comparison results of running time of different methods.


## 4.1. Experimental Environment and Dataset

The algorithm operating platform conditions are as follows: the operating system is Windows 7 (x32), the CPU is Intel Celeron CPU B815 (1.60 GHz), and the programming language operating environment is MATLAB (2016a). The algorithm parameter is set to the number of students in class (i.e., the number of populations)NP=10, the number of subjects for each student (that is, the dimensionality of the search space) is 30, the maximum value of the teaching factor is TFmax=2, and the minimum value is TFmin=1. Since students face a teacher, their self-confidence will be relatively low, and when they face classmates, they are more likely to believe in their own knowledge, so the self-confidence takes the experience constant w1=0.1,w2=0.5 and the maximum number of iterations maxGen=100.


## 4.2. Comparison Results of Optimization Effects

In order to verify the optimization effect of the proposed method, the algorithm runs 20 times independently, selects the average value of 20 iterations as the comparison standard, compares the proposed method with the method in reference [8] and the method in reference [9], and obtains the optimization effect comparison results of different methods as shown in Figure 4.Figure 4
Comparison results of optimization effects of different methods.As can be seen from Figure4, as the number of iterations increases, the function fitness values of different methods decrease. Among them, the convergence of the proposed method is obviously better than the methods in reference [8] and reference [9]. At 50, it has achieved convergence, and its optimization effect is good, which can effectively improve the convergence of the algorithm.


## 4.3. Comparison Results of Optimization Accuracy

On this basis, the optimization accuracy of the proposed method is further verified, and the algorithm including the standard deviation of the optimal solution is used as the evaluation index. The smaller the standard deviation, the higher the optimization accuracy of the method. By comparing the method in reference [8], the method in reference [9], and the proposed method, the optimization accuracy of different methods is obtained, and the comparison results are shown in Figure 5.Figure 5
Comparison results of optimization accuracy of different methods.It can be seen from Figure5 that the standard deviation of the optimal solution of different methods gradually increases with the increase of the number of iterations. When the number of iterations is 100, the standard deviation of the optimal solution of the method in reference [8] is 9.1, the standard deviation of the optimal solution of the method in reference [9] is 14.2, and the standard deviation of the optimal solution of the proposed method is 6.5. It can be seen that compared with the method in reference [8] and the method in reference [9], the standard deviation of the optimal solution of the proposed method is smaller, indicating that the optimization accuracy of the proposed method is higher. This is because in the “learning” stage, the cluster partition method of euclidean distance is adopted to cover different types of individual members into different learning groups, which improves the utilization rate of resource information and effectively improves the technical accuracy of the optimal solution.


## 4.4. Comparison Results of Running Time

As can be seen from Figure6, with the increase of the number of iterations, the running time of different methods increases. When the number of iterations is 100, the running time of the method in reference [8] is 39 s, the running time of the method in reference [9] is 55 s, and the running time of the proposed method is only 21 s. It can be seen that the running time of the proposed method is shorter than that of the method in reference [8] and the method in reference [9]. Because the proposed method selects K-means algorithm, the teaching optimization algorithm has good global search ability, effectively shortening the running time of the method.Figure 6
Comparison results of running time of different methods.


## 5. Conclusion

In order to further optimize the effect of Wushu teaching, this paper gives full play to the advantages of the basic teaching and learning optimization algorithm and designs a multiclass interactive Wushu teaching optimization method combined with the clustering division method based on Euclidean distance. The algorithm has good optimization effect, high convergence and optimization accuracy, and short running time. However, the tacit understanding between teachers and students only depends on the function of the number of iterations. Therefore, in the next research, we need to find a function not only dependent on the number of iterations but also related to the difference between teachers and students, so as to further intelligentize the tacit understanding value.



---

*Source: 7272048-2022-01-06.xml*