## 3 Analysis of Students' Consumption Behavior
### Clustering Process
#### 3.4.2 Determining Clustering Center  
A notable shortcoming of the conventional k-means algorithm is its considerable sensitivity to the selection of initial clustering centers. The selection of different centers has the potential to yield significantly divergent clustering outcomes. The proposed solution to this problem is an innovative approach that employs the fractional-order firefly algorithm (FFA) to optimize the clustering center search process in the k-means algorithm. This fusion effectively mitigates the inherent defects of the k-means algorithm and improves its clustering performance. The firefly algorithm mimics the information exchange patterns of fireflies, which attract mates and potential prey. It can also serve as a protective warning mechanism. The firefly algorithm idealizes the flashing characteristics of fireflies based on the following three idealized rules: (1) All fireflies are unisex, meaning one firefly can attract another regardless of gender. (2) Attractiveness is directly proportional to brightness; thus, a dimmer firefly will move towards a brighter one. (3) A firefly's brightness is determined by the objective function. In the firefly algorithm, brighter fireflies attract less bright fireflies. Each firefly will fly towards those of a brighter hue in order to ascertain a superior position. It has been demonstrated that the brightness of a firefly has a direct correlation with the strength of its attraction to other fireflies. Concurrently, the attraction between fireflies is inversely proportional to the spatial distance, signifying that the farther apart two fireflies are, the weaker the attraction between them. Define the position of each firefly as \(X\) (\(x1\), \(x2\),\(\ldots\), \(xD\)), and represent the relative luminous intensity of the firefly as shown in Equation (8). \[I=I_{0}e^{-\gamma^{\prime}i\gamma} \tag{8}\]  
where \(I_{0}\) indicates the brightness of the brightest firefly, that is, its own (\(=0\)) fluorescence brightness; \(\gamma\) indicates the light absorption coefficient, which reflects the fact that the fluorescence gradually weakens as the distance increases due to the effect of the transmission medium. \(r_{ij}\) indicates the distance between firefly \(i\) and firefly \(j\). The formula for calculating the relative attraction between fireflies is as Equation (9):  
\[\beta(r)=\beta_{0}e^{-\gamma^{\prime}i\gamma} \tag{9}\]  
In Equation (9), \(\beta_{0}\) represents the initial attraction, that is, the attraction when the distance between two fireflies is 0. During the operation of the algorithm, each firefly will move toward all fireflies with higher brightness than itself, and its position update Equation is as Equation (10). \[X_{\text{i}}=X_{\text{i}}+\beta_{0}\text{e}^{-\gamma^{\prime}i\gamma}\big{(}X _{j}-X_{\text{i}}\big{)}+\alpha(rand-0.5) \tag{10}\]  
where \(X_{i}\) denotes the location of a firefly that is brighter than the \(i\)th individual, _rand()_ is a random perturbation, \(\alpha\) is the step factor of the perturbation, and generally _rand()_ is a random number generator uniformly distributed in [0, 1]. The basic process of the firefly algorithm is as follows: Compare the brightness of fireflies. Fireflies with lower brightness will be attracted by those with higher brightness and move towards them. Their positions are updated according to Equation (10), and this process is repeated in a loop until all individuals converge to the brightest firefly, indicating the optimal position [49]. The main principle of the Firefly Algorithm is shown in Algorithm 1. Fractional-order calculus generalized the classical theory of differentiation by introducing the concepts of real or complex order integrals and derivatives [38; 50]. Fractional-order calculus dates back to the beginning of calculus theory, but it is only in recent decades that it has been found to play an important role in modeling physical, biological, and social phenomena [51].