Variable-Length Multiobjective Social Class Optimization for Trust-Aware Data Gathering in Wireless Sensor Networks

Data gathering in wireless sensor networks (WSNs) is vital for deploying and enabling WSNs with the Internet of Things (IoTs). In various applications, the network is deployed in a large-scale area, which affects the efficiency of the data collection, and the network is subject to multiple attacks that impact the reliability of the collected data. Hence, data collection should consider trust in sources and routing nodes. This makes trust an additional optimization objective of the data gathering in addition to energy consumption, traveling time, and cost. Joint optimization of the goals requires conducting multiobjective optimization. This article proposes a modified social class multiobjective particle swarm optimization (SC-MOPSO) method. The modified SC-MOPSO method is featured by application-dependent operators named interclass operators. In addition, it includes solution generation, adding and deleting rendezvous points, and moving to the upper and lower class. Considering that SC-MOPSO provides a set of nondominated solutions as a Pareto front, we employed one of the multicriteria decision-making (MCDM) methods, i.e., simple additive sum (SAW), for selecting one of the solutions from the Pareto front. The results show that both SC-MOPSO and SAW are superior in terms of domination. The set coverage of SC-MOPSO is 0.06 dominant over NSGA-II compared with only a mastery of 0.04 of NSGA-II over SC-MOPSO. At the same time, it showed competitive performance with NSGA-III.


Introduction
Data gathering in wireless sensor networks (WSNs) is a process of collecting data from a field equipped with many sensors and occupying a wide area using single-or multisink WSNs [1,2]. This process is not effective in a large-scale environment due to the increasing cost of deploying a large number of stationary links. Multiple sinks and multiple mobile sinks are more sustainable approaches to managing data transmission to multiple endpoints in a WSN [3]. However, deploying multisink or multiple mobile sinks in a WSN for data gathering is a mathematically complex process. It involves various determinations, namely, the number of mobile sinks [4]; their trajectories, which consist of a sequence of rendezvous points; and selecting [5] the depth or number of hops that are required for collecting the data [6]. The above-stated challenges have encouraged development of a simulator to optimize the performance of wireless sensor networks' data gathering [7]. This study aimed to compute an optimal decision support algorithm by considering cost, energy consumption, traveling time, and trust [8]. Trust-aware data gathering is regarded as a multiobjective optimization problem because it involves simultaneously optimizing multiple objectives, which are often in conflict with each other. The main objectives of trust-aware data gathering are maximizing the accuracy of the collected data, minimizing the impact of unreliable or malicious sources, maximizing the amount of collected data, and minimizing the cost of data collection. These objectives often conflict with each other, as potential for sliding into local minima when the total amount of virtual forces reaches zero is a limitation of this approach. The model used also only supports one mobile collector. Additionally, the total trust makes the erroneous assumption that there is a linear relationship between several components. In one study [20], it was recommended to use a probabilistic graphical model to completely evaluate the dependability of the sensor nodes utilizing a mobile edge-computing-based intelligent trust-assessment technique. The suggested approach analyzes data collection and communication behavior to assess the reliability of sensor nodes. The proposed mechanism evaluates trust based on data collection and communication behavior and plans the edge nodes' movement path to increase the likelihood of direct trust evaluation while minimizing travel distance. However, this method ignores the various dimensions of trust and operates with only one mobile collector. Authors [21] also looked at the use of unmanned aerial vehicles (UAVs) as mobile sinks. The problem was recast as a multiobjective joint optimization problem as a result, with a large number of constraints, leading to a typical K-center problem. Then, a lightweight authority authentication model using certain stages was examined to overcome the major security issues with UAV-aided trustworthy data collecting. This architecture needs reliable sensors and UAVs with a tolerable authentication latency to carry out the data-gathering session. Smart data collecting with cloud services (S-SDC), a secure mobile sensor network-based protocol, was suggested in a study using mobile sensors to enable information dissemination in dynamic networks with the least loss and power consumption [22]. Additionally, the method supports authoritative routing and offers network consistency and availability for the collected data with cloud enterprises. The fitness-based fuzzy C-means (Fit-FCM) algorithm, which gathers nodes' residual energy and utilizes the energy to pick new CHs while discarding nodes with the lowest energy, was proposed as a UAV-based CH selection (CHS) technique for usage in WSNs [23]. The created Fit-FCM algorithm, which takes into consideration fitness functions including energy, distance, and trust, is used to conduct CHS after simulating UAV-based WSN nodes. An IoT-based trust evaluation was carried out [24] to determine whether the target object can consistently carry out defined actions. The target object's direct interaction history or other recommenders' suggested data are both considered in the valid time domain. Two types of trust-active trust and recommended trust-were offered to characterize the trust evaluation process for Internet of Things devices. A temperature-aware trusted routing scheme (TTRS), a multifactor routing strategy based on the remaining energy, the hop count, and the trust value of sensor nodes, was proposed [25] to find the shortest and most reliable route. The scheme includes a hotspot node detection algorithm to detect malicious relay nodes and a route discovery and management mechanism. In a study [26], a belief-based trust evaluation mechanism was developed that uses a Bayesian estimation approach to distinguish hostile nodes from trustworthy nodes and protect against attacks such as bad-mouthing, on-off, and denial of service. In the work of [27], an aggregate signature-based trust routing (ASTR) scheme was developed to ensure safe data collection in WSNs. The scheme uses aggregate signatures to maintain data integrity and employs a detour routing scheme to verify the safe delivery of data to the sink. The trustworthiness of a path is determined by its success rate.
In [28], a trust-based data gathering approach is proposed that focuses on collecting data in a sensor-driven environment through data aggregation and reconstruction. The concept of multidimensional trust was introduced, incorporating communication, data, resource, and forwarding trust. However, the approach has limitations as the aggregation method used is based on the weighted average rule, which may lead to suboptimality. In [29], the secure and energy aware data gathering technique (SEEDGT) was proposed as a secure and energy-efficient data gathering technique that combines trust, public key algorithms, and compressive sensing (CS) methods to achieve security while maintaining a fair energy load balance in IoT-WSN. The SEEDGT technique is divided into three phases: cluster formation, network operation, and reconfiguration. During the cluster formation phase, energy-efficient and trust-based methods are used to form clusters and Sensors 2023, 23, 5526 4 of 29 select cluster heads. The network operation phase focuses on securing network data during the data-collection process using a public key algorithm. Additionally, the CS strategy is employed to reduce the size of the original data, thus reducing energy consumption. Finally, the reconfiguration phase considers any changes that may occur during network operations. In [30], for data aggregation, the cluster head is selected using the emperor penguin optimization (EPO) algorithm, and STELR is used to ensure routing security. Secure communication is achieved by determining a node's trustworthiness. In [31], a fog-based hierarchical trust mechanism is proposed, consisting of two components: trust in the underlying structure and trust between cloud service providers (CSPs) and sensor service providers (SSPs). To enhance the trust in the underlying structure, a behaviormonitoring component was established and implemented in wireless sensor networks (WSNs), while the more fine-grained and complex data analysis component was moved to the fog layer. The fog layer focuses on the real-time comparisons of service parameters, gathering exception information in WSNs, performing targeted quantitative evaluations of entities, and performing other aspects to establish trust between CSPs and SSPs. In [32], a trust evaluation model based on trust transitivity along a chain is proposed, which relies on the relatively strong computing and storage capabilities of mobile edge nodes. The authors first designed calculation methods for various trust chains to determine their trust levels. Then, they proposed an improved version of Dijkstra's algorithm for collecting trust information from sensor nodes by the mobile edge nodes. In [33], a method is proposed for encoding returned verification messages in order to reduce the cost of obtaining verification messages for IoT devices. Additionally, the authors applied an adaptive active trust detection technique that considers the varying energy consumption of IoT devices in order to obtain reliable device trust while preserving network lifetime. The cloud distributes tasks to all available mobile edge units (MEUs). The publication includes the topology of the sensor network and the location of each sensor node. Upon receiving the publication, interested MEUs report their evaluation quality, coverage area, and expected price to the cloud. These three factors form a bid. The cloud then determines the winning set of MEUs and assigns tasks based on the bids. The selected MEUs use their mobile capabilities to collect sensor data and determine if object nodes are malicious. The cloud then aggregates the results reported by the MEUs to obtain the final trust evaluation of each sensor.
Nondominated sorting genetic Algorithm 2 (NSGA-II) [34] and nondominated sorting genetic Algorithm 3 (NSGA-III) [35] are both optimization algorithms used for solving multiobjective optimization problems, where multiple conflicting objectives need to be simultaneously optimized. NSGA-II is an improvement over the original NSGA algorithm and has become a benchmark for multiobjective optimization algorithms. It sorts the population of candidate solutions into different levels of nondomination, creating a front of solutions with a tradeoff between objectives. The algorithm uses the crowding distance measure to maintain diversity among the solutions and prevent premature convergence. NSGA-II has been widely used in various engineering and scientific applications.
NSGA-III, on the other hand, is a further improvement over NSGA-II that addresses some of its limitations. It uses an external archive to store the best nondominated solutions found so far, which is used to guide the search process toward the optimal solutions. NSGA-III also uses a K-means clustering method to divide the population into smaller groups, which allows for a more targeted search and faster convergence. Additionally, NSGA-III has a more flexible problem-specific ideal point, which provides a better reference point for the optimization process. These improvements make NSGA-III a more efficient and effective algorithm for solving multiobjective optimization problems.
A summary of the various methods in terms of different comparison criteria is presented in Appendix A.
Overall, none of the current algorithms for trust-aware data collection consider the collection of trust using multiple mobile data collectors or the dynamic adjustment of their trajectories for achieving the optimal trust values and network performance aspects such as Sensors 2023, 23, 5526 5 of 29 cost, energy consumption, delay, and quality of service. Due to the partial conflict between the objectives, dealing with this object requires a multiobjective optimization approach.

MCDM for Data Gathering
The second part of the literature survey presents the usage of MCDM models in various WSN-IoT applications. In [36], entropy-based technique for order preference by similarity to an ideal solution is a multiobjective decision-making method (TOPSIS). the field observation instruments networks (FOINs) clustering routing algorithm (ETC) was proposed in this method. Through several variables, the ETC algorithm selects the perfect cluster head (optimal CH). It primarily addresses the issue that certain multiobjective optimization algorithms in use today cannot assign weights in a dynamic and objective manner. Each decision-making criterion for the issue reflects a characteristic for o multiobjective decision-making problem of CHs selection in the clustering routing method. As a result, the decision-making criteria are treated as characteristics and any node in the FOIN having values for the various criteria is chosen as an alternative.
In [37], the use trusted, energy-and spatial-aware dynamic distance source routing is suggested. The method determines the assessment metrics that are stated in the QoS. In addition, this model introduces a novel hierarchical trust method that uses several features of numerous wireless sensor nodes in accordance with data transfer speed, data size, energy consumption, and suggestions.
In [38], an MCDM framework was used to resolve challenging routing issues under the assumption of metric threshold limitations. Such needs are captured by the mathematical framework, which also determines the routing.
In [39], a hybrid network architecture for disaster area wireless networks (DAWNs) is proposed. To find the ideal next-hop node in DAWNs, researchers applied a multi-criteria decision-making method for emergency communication protocol (MCDM-ECP) that makes use of the analytic hierarchy process (AHP) method and the technique for order preference by similarity to an ideal solution (TOPSIS) method.
Authors [40] put forward a framework for sensor selection and correlation that allows a reported irregularity in the monitored environment to be activated and verified. It frames and solves the sensor selection problem as a multiobjective optimization (MOO) problem, taking into account the edge gateway device's free CPU and RAM, network quality, remaining battery life, sensor correlation value, and power requirement of the sensors. In order to validate the anomaly, the sensor nodes are chosen using a multicriteria decision-making process (MCDM) Authors [41] created a route design technique that is optimized for energy efficiency, extending network lifespan and improving connectivity. The method consists of four steps. The first divides the sensing field into equal sections based on the number of mobile sinks that have been deployed to solve the energy-hole issue. A stable election algorithm (SEA), a heuristic clustering technique, was developed to reduce message transmission between sensor nodes and avoid frequent cluster head rotation. In order to determine the ideal site for the sinks to halt and gather data from cluster heads, a sojourn location determination technique was suggested based on the minimal weighted vertex cover problem (MWVCP). Finally, using multiobjective evolutionary algorithms, three optimization strategies are used to assess the trajectory of the modified mobile sinks (MOEAs). They provided that the multiobjective evolutionary algorithms (MOEAs) may be deemed as an optimum solution for multiple-criteria decision-making (MCDM) problems because MOEAs' evaluation encompasses many metrics. However, no explicit MCDM algorithm was provided for selecting a solution.
Overall, it was found in Table 1 that none of the existing approaches in WSNs applies MCDM for enabling decision makers to select one solution out of the set of nondominated solutions in the data gathering based on the factors of trust, effort, cost, and time. Hence, we aimed filling this gap by using the simple additive weighting (SAW) from MCDM for this purpose.

Methodology
Almost all of the symbols in the paper are represented in Table 2.

Definitions
This section presents several definitions used for building our methodology.

Definition 1: Class
A class is a portion that represents the set of all same size and types solutions in the problem space. More formally, for all x ∈ class C, then length(x) = N C , where N C denotes the length of solutions inside class C, and type(x i ) is the same as type(y i ) for two decision variables x i and y i , belonging to x and y, respectively, where x and y are from the same class.

Definition 2: FAM
The matrix of fitness adjacencies FAM represents a matrix with many columns equal to the number of objective functions and many rows equal to the number of solutions. The fitness value of the solution with each objective function is represented by an entry in the where f am ij denotes fitness solution j with regard to objective i. where ram ij denotes the fitness value of class j concerning objective i.
There are several approaches to depict the fitness value of a given class. We focused on these three: 1. the class's lowest fitness value for solutions; 2. the class's average fitness score; 3. the subject class's set coverage in comparison with that of other classes.

Definition 4: WCT
The weak classes threshold (WCT) is a measure of how many solutions are used in a given class to make it a weak class. When a class has fewer solutions than the WCT, the class becomes weak.

Definition 5: SCT
The strong class threshold (SCT) is a measure of how many solutions are utilized to make a certain class a strong class. When the class has more solutions than the SCT, the class becomes a strong class.

Overview of SC-MOPSO
The pseudocode of SC-MOPSO is presented in Algorithm 1. As shown, the inputs of the algorithms are NumOfParticles, which indicates the number of particles; NumOfIterations, which indicates the number of iterations; Boundary, which identifies the outermost search; DimensionsRange, which indicates the range of dimension; ObjectiveFunctions, which indicates to the objective functions that need to be optimized. In addition, the parameters of the traditional particle swarm optimization, namely, inertia, C 1 , and C 2 are given. Furthermore, the algorithm accepts two thresholds, namely, adaptive timeout and classMinThreshold. The former indicates the threshold that allows moving a particle from one class to another, and the latter indicates the minimum number of particles within a class. The outputs of the algorithm are the Pareto front and Pareto set.
The particle distribution among the classes is the algorithm's foundation. The first step in the distribution of the particles involves employing two random number generators: one to assign each particle in class and the other to generate the values of the decision variables of the particle. In this context, the term "class" refers to a subset of the solution space that only includes solutions from the same dimension and type of decision variable; all other dimension solutions are found in other classes.
The pseudocode for Algorithm 1 presents the first swarm initialization phase (lines 3 to 8). The solutions are projected into their classes using the command on line 8. The algorithm then executes for the specified number of iterations (NumOfIterations). The algorithm runs over each class one by one with each iteration. The algorithm runs through each class's particles one at a time and uses the function selectExemplar (Classes) to choose an exemplar for each particle. Any particle's exemplar is chosen from the same class as the particle. The particle is then moved to a new position by the algorithm depending on its input parameters: (Inertia, C1, and C2) and exemplar. The algorithm evaluates any potential improvement in the fitness functions after transferring the particle. Afterward, the algorithm adds one to the nonimprovement counter if there is no improvement; otherwise, the improvement counter is reset. The improvement counter's purpose is to make it possible for the logic to move the particle from one class to another if no improvement happens after a certain number of repetitions, which is represented by the adaptiveTimeOut threshold. A minimal number of particles must exist within a specific class in order for logic to move particles from one class to another. This is represented by another threshold, which is classMinThreshold.
The existing variant of SC-MOPSO assumes that the solution is homogenous. In other words, it considers that the definition of the decision variable is the same for all components of the solution vector. However, this does not apply to the problem of trust-aware data gathering. In such a problem, the decision variable is different from one component to another, i.e., some components indicate the number of mobile sinks, others indicate the number of rendezvous points, others indicate the number of hops, and others indicate their locations. To resolve this problem, we developed a novel variant of SC-MOPSO. We named it SC-MOPSO for data gathering or SC-MOPSO-DG. It provides application-dependent operators named interclass operators. The operators include solution generation, addition and deletion of rendezvous points, moving to an upper class, and moving to a lower class with an awareness of the representation of data gathering solution. This is presented in the next subsection.

SC-MOPSO-DG
This section presents our novel algorithm SC-MOPSO-DG. First, we present the mathematical model of the objective space in Section 3.3.1. It is composed of the initialization, which is presented in Section 3.3.2. Next, the adding and deletion of RendezVous point RV is presented in Section 3.3.3. Then, the algorithm for moving to an upper class is presented in Section 3.3.4, and the algorithm for moving to a lower class is given in Section 3.3.5. Next, the main algorithm is presented in Section 3.3.6. Lastly, simple additive weighting (SAW) is presented in Section 3.3.7.
The trust of a sensor can be quantified as an integer value between 1 and 10 based on a number of factors: 1, sensor calibration: a sensor that is properly calibrated and periodically maintained is more trustworthy than one that is not; 2, sensor accuracy: a sensor that consistently generates accurate data is more trustworthy than one that generates inaccurate data; 3, sensor reliability: a sensor that consistently operates without interruption is more trustworthy than one that frequently fails; 4, security: a sensor that is secure and protected against tampering is more trustworthy than one that is not; 5, data integrity: a sensor that generates data that are consistent with other sources of information is more trustworthy than one that generates inconsistent data; 6, age and usage: a new sensor that has not been extensively used is generally more trustworthy than an older sensor that has been in use for a long time.
Based on these and other factors, the trust of a sensor can be quantified as an integer value between 1 and 10, with a value of 1 indicating very low trust and a value of 10 indicating very high trust. This quantification provides a simple, intuitive way to express the degree of trust in a sensor and can be used to inform decisions about how to use and rely on the data generated by that sensor within the wireless sensor network.
Trust is calculated based on the number of mobile sinks, the set of a rendezvous points for each one, and the number of assumed hops for each rendezvous point. We also assume that increasing the number of hops implies obtaining trust, which is the minimum among all hops, as provided in Equation (4).
where T i jk denotes the trust of sensor that sending data to mobile sink i at RV j from hop index k, T i jk ∈ {1, 10}. (2) Energy Consumption Second, the energy consumption is calculated based on the energy at each sink and rendezvous point as described in Equation (5).
where Nrv i denotes the number of rendezvous points for mobile sink i; N i,j denotes the number of sensors at the rendezvous point j for mobile sink i; E i,j,k denotes the energy consumption at sensor k, rendezvous point j, and mobile sink i.

(3) Cost
Third, the cost is calculated as the number of mobile sinks. Fourth, the time is calculated as the longest travelling time among all mobile sinks, as described in Equation (6).
The time indicates the longest mobile sink in terms of collecting data from its associated sensors, as described in Equation (7).
where d i denotes the distance travelled by mobile sink i, and it is calculated based on the summation of the distance between every two consecutive distances, as provided in Equation (8).
where RP j denotes the rendezvous point. Noncoverage indicates to the number of sensors that have not been covered by the mobile sink. It is calculated based on subtracting the number of connected sensors Nconn from the total number of sensors Ns, as described in Equation (9).

Initialization
The solution representation is heterogeneous because it combines different types of decision variables. Therefore, the process of constructing solutions should be carefully approached to ensure that the solutions are distributed over the range of each variable. To initialize the process, we use a random process while also considering the boundary information of each variable to ensure that each solution does not violate any constraints. The constraints are defined based on the boundary information given in several variables: 1, lower and upper boundary of positions BP L and BP H respectively; 2, lower and upper boundary of other decision variables BD L and BD H , respectively; 3, index of number mobile sink boundaries within BD L and BD H , and it is denoted by I MS; 4, index of number of rendezvous points boundaries within BD L andBD H , and it is denoted by IR; 5, index of number of hops boundaries within BD L andBD H , denoted by I NH.
The pseudocode is presented in Algorithm 2. As shown, the solution is created as a structure. Next, a random process is used for initializing the number of mobile sinks. Afterward, a for loop is conducted on the mobile sink, and other information is generated including the number of rendezvous points, the location of each rendezvous point, and the number of hops using an internal loop.

Addition and Deletion of Rendezvous Point
An issue with moving a solution from one class to another is the need to add more information to the solution when the destination class is higher or to delete older information from the solution when the destination class is lower. To handle this, an algorithm for addition and deletion was developed. The algorithm receives the destination class as the class input, an exemplar that represents a leader selected from the destination class; and OldSolution, which represents the subject solution that is being moved from the source class to the destination class.
As shown, the Algorithm 3 starts operating by initiating newSolution, which represents the solution after being moved to the destination class. First, newSolution takes all the information of the oldSolution. Next, assuming that all solutions have the same number of mobile sinks, the differences between the number of rendezvous points in the oldSolution and in the corresponding newSolution is calculated. There are two possibilities: (1) the difference is negative, which means that rendezvous points are to be added; (2) the difference is positive, which means that rendezvous points are to be deleted. In the first case, we randomly select one rendezvous point from the exemplar and add it to the solution until equality. In the second case, we select one rendezvous point from the subject solution and delete it until the difference is 0, which means that the solution is already transformed to the new class.

Moving to a Higher Class
Assume that we have an oldParticle, exemplar, class, and difference. Algorithm 4 plays the role of adding the same number provided in the difference in mobile sinks to the oldParticle. In other words, we select a random mobile sink from the exemplar and add it to the oldParticle, then we call the adding and deleting of the rendezvous point until the number of newly added mobile sink values is equal to the difference. Hence, in this case, we consider that the solution has been moved from a lower class to an upper class.

Moving to a Lower Class
Assume that we have an oldParticle, exemplar, class, and difference. Algorithm 5 plays the role of detecting the same number provided in the difference in the mobile sinks from the oldParticle. In other words, we select a random mobile sink from the oldParticle, then we call the deletion of the rendezvous point until the number of deleted mobile sink value is equal to the difference. Hence, in this case, we consider that the solution has been moved from an upper class to a lower class.

Main Algorithm
To accomplish the movement function of social class MOPSO DG, we use the pseudocode provided in the main algorithm. As shown, the algorithm uses the standard movement equation of particle swarm optimization that is provided in Algorithm 6 on line 13.
The pseudocode of the algorithm is presented in Algorithm 6. It accepts the setupParameters as inputs, and it provides the Pareto front as the output. The algorithm starts with the initialization of the population, evaluating the population based on objective functions, determining nondominant solutions, creating the repository, and initializing the AMC and RAM matrices. Next, the algorithm enters a set of iterations until reaching the quantity of iterations. Each time the algorithm iterates, it updates the parameters, then considers the classes one by one, selects a random exemplar within the class, moves the solutions toward their exemplar according to the mobility equations of the algorithm, and checks for crossing the boundary and fixing the solutions, in this case, to be maintained within the boundaries. Afterward, it provides the mutation and updates the solution in case of domination in the new position. In addition, it updates the improvement counter.
The second part of Algorithm 6 considers the classes again and updates the enhancement time out. Next, it considers the solution of each class and checks whether the solution has reached its timeout within the class without improvement. In this case, the solutions are moved from their present class to a different one. This leads to calling the process of moving, which has two functions: (1) moving to the upper class if the destination class has more mobile sinks and (2) moving to the lower class if the new class has a smaller number of mobile sinks. Next, the matrices of FAM and RAM are updated.
Our developed variable-length multiobjective SC-MOPSO-DG optimization algorithm is presented in Algorithm 4. It accepts the solution dimension d, the population size n, the max iteration, and the objective functions. It returns the Pareto front. It operates by starting with an initialization of the population according to its size. Next, it evaluates the member of the population, and it updates the values of FAM and RAM. Afterward, it performs nondominated sorting based on the pseudocode presented in Algorithm 4. Next, it enters the for loop that has a maximum equal to the maximum number of iterations Each time the algorithm iterates, it selects an exemplar for each class, applies the movement equations of SC-MOPSO-DG optimization, and corrects the solution when exceeding the boundary of the solution space. Next, the algorithm updates the improvement counter of each solution. For the nonimproving solutions, the algorithm moves them from their class to another class. Lastly, the algorithm deletes weak classes. Lastly, the algorithm calls the archive controller algorithm and updates FAM and RAM. select exemplar from each class based on FAM based probability density function 8: Update particle positions using algorithm Equations (1)-(4) and selected exemplars 9: Check if any search agent goes beyond the search space and amend it 10: Calculate fitness values of solutions, 11: update improvement counter for each solution 12: move weak solutions from their class to other class in case they are not improving 13: deletes weak class 14: call archive controller and update FAM and RAM 15: Return archive End Algorithm

Simple Additive Weighting (SAW)
Simple additive weighting (SAW) is one approach as in Figure 1 to the multiattribute decision-making problem. The fundamental idea behind the SAW approach is to calculate the average of the weighted performance ratings for each option across all criteria. It calls for a procedure to convert the choice matrix (X) to a scale that can be compared with all the ratings of available options. In our optimization, we have four criteria, namely, cost, energy, time, and trust.

Simple Additive Weighting (SAW)
Simple additive weighting (SAW) is one approach as in Figure 1 to the multiattrib decision-making problem. The fundamental idea behind the SAW approach is to calcul the average of the weighted performance ratings for each option across all criteria. It c for a procedure to convert the choice matrix (X) to a scale that can be compared with the ratings of available options. In our optimization, we have four criteria, namely, c energy, time, and trust. We extract the solutions from the Pareto front (PF), and we provide them to table PF. Next, we require the decision maker to provide the weights of the criteria accord to their preferences. We normalize the matrix, and we perform the ranking based on weighted sum. The solution that accomplishes a higher rank is selected. The weights the criteria are given in Table 3, the Pareto front is given in Table 4, and the overall eva ation is given in the Pareto front in Table 4. The process of SAW is depicted in Figur The ranking of solutions provided in the Table 5.  We extract the solutions from the Pareto front (PF), and we provide them to table the PF. Next, we require the decision maker to provide the weights of the criteria according to their preferences. We normalize the matrix, and we perform the ranking based on the weighted sum. The solution that accomplishes a higher rank is selected. The weights of the criteria are given in Table 3, the Pareto front is given in Table 4, and the overall evaluation is given in the Pareto front in Table 4. The process of SAW is depicted in Figure 2, The ranking of solutions provided in the Table 5.   No ( ) ( ) ( ( )) ( ( )) ( ( )) ( ( )) = ∑ ( ( )) Figure 2. Flowchart of social class multiobjective particle swarm optimization data-gathering alg rithm.
We present the pseudocode of selecting the solution from the Pareto front in Alg rithm 7. We present the pseudocode of selecting the solution from the Pareto front in Algorithm 7.

Example
Assume that we have two solutions, sol 1 and sol 2 . The first solution sol 1 contains two mobile sinks, namely, ms(1,1) and ms (1,2). The second solution sol 2 contains three mobile sinks, namely, ms(1), ms (2), and ms (3). Each mobile sink has its own number of rendezvous points. For the mobile sink ms (1,1) ]. In addition, each RV has its own number of hops. The number of hops of RV(i, j, k) is 2 for i = j = k = 1, as represented in Table 6.

Performance Metrics
For evaluating our developed algorithm, we generated two types of metrics: multiobjective optimization (MOO) and application-oriented metrics. For the first type, we calculated the hyper-volume, set coverage, delta, and the number of nondominated solutions. For the second type, we calculated time-series-based metrics for the packet delivery ratio (PDR), end to end delay (E2E-delay), and energy consumption. The equations of the second type are presented in Section 5 while the equations of the first type are presented in this section.
The effectiveness of search algorithms was assessed using the hyper-volume (HV) metric in evolutionary and swarm multiobjective optimization. In relation to the poorest solution (the reference point), it calculates the volume of the dominated area of the objective space; this region is the union of the hypercube whose diagonal is the separation between the reference point and a solution x from the Pareto set (Ps). More preferable solutions are indicated by higher values of this measure indicator, as shown in Equation (10).
The set coverage, or C metric, which compares the Pareto sets Ps1 and Ps2, is shown in Equation (11). c(Ps1, Ps2) =|{y ∈ Ps2|∃x ∈ Ps1 : x < ¬y} | |Ps2| (11) C is equal to the proportion of Ps2's nondominated solutions to Ps1's nondominated solutions divided by Ps2's total number of solutions. Therefore, it is crucial to reduce the value of C(X, Ps) for all Pareto sets X while assessing a set of Ps.

Experiment and Results
This section presents the experimental methods and results. It consists of two subsections, namely, MOO evaluation, which is presented in Section 4.1, and networking measures, which are presented in Section 4.2. The generation of the experimental results was performed using MATLAB 2020b using a computer i7 core 2.30 GHZ 16GB RAM. The parameters that were used for conducting the experimental evaluation are presented in Table 7. As shown in the table, we used 100 iterations for all algorithms. Furthermore, the boundary dimension of all algorithms ranged between [1,2,2] and [3,4,6], which indicates the range of [number o f mobileSink, number o f RV, number o f hops].

MOO Evaluation
This section presents our experiments and results. We present the set coverage to show the domination performance of the benchmarks and of our created algorithm. A comparison is provided with two benchmarks, namely, NSGA-II and NSGA-III. Afterward, we present the hyper-volume, which shows diverse behavior. Lastly, we present the number of nondominated solutions.

Set Coverage
As shown in Figure 3, the domination of our developed algorithm with those of each of NSGA-II and NSGA-III is presented. It was observed that the set coverage of SC-MOPSO was 0.06 over NSGA-II compared with only a domination of 0.04 of NSGA-II over SC-MOPSO.

Set Coverage
As shown in Figure 3, the domination of our developed algorithm with those of each of NSGA-II and NSGA-III is presented. It was observed that the set coverage of SC-MOPSO was 0.06 over NSGA-II compared with only a domination of 0.04 of NSGA-II over SC-MOPSO. The results show equivalent domination in terms of the median value with value close to 0.01. This provides that the domination is almost the same between the two algorithms. However, there is more interquartile range for the domination of NSGA-III over SC-MOPSO due to the higher distance between minimum and maximum.  Figure 4. The results show equivalent domination in terms of the median value with value close to 0.01. This provides that the domination is almost the same between the two algorithms. However, there is more interquartile range for the domination of NSGA-III over SC-MOPSO due to the higher distance between minimum and maximum.

Hyper-Volume
The hyper-volume results are presented in Figure 5. We observed that SC-MOPSO slightly outperformed NSGA-III in terms of hyper-volume, while NSGA-II produced a result of approximately 2.4 ×10 4 . Reading these figures together with that for set coverage showed that SC-MOPSO outperformed NSGA-II in terms of set coverage, while it outperformed NSGA-III in terms of hyper-volume.

Number of Nondominated Solution
The number of nondominated solutions is presented in Figure 6. All algorithms generated the same level of number of nondominated solutions (NDSs). The size of the population for each algorithm was 200. This led to a number of nondominated solutions of 200. This was interpreted with the high number of objectives, which led to the high number of nondominated solutions.

Hyper-Volume
The hyper-volume results are presented in Figure 5. We observed that SC-MOPSO slightly outperformed NSGA-III in terms of hyper-volume, while NSGA-II produced a result of approximately 2.4 × 10 . Reading these figures together with that for set coverage showed that SC-MOPSO outperformed NSGA-II in terms of set coverage, while it outperformed NSGA-III in terms of hyper-volume.

Hyper-Volume
The hyper-volume results are presented in Figure 5. We observed that SC-MOPSO slightly outperformed NSGA-III in terms of hyper-volume, while NSGA-II produced a result of approximately 2.4 × 10 . Reading these figures together with that for set coverage showed that SC-MOPSO outperformed NSGA-II in terms of set coverage, while it outperformed NSGA-III in terms of hyper-volume.   The number of nondominated solutions is presented in Figure 6. All algorithms generated the same level of number of nondominated solutions (NDSs). The size of the population for each algorithm was 200. This led to a number of nondominated solutions of 200. This was interpreted with the high number of objectives, which led to the high number of nondominated solutions.

Convergence Graphs
For additional evaluation, we present a boxplot convergence curve of each of the objectives with respect to the generation from the starting point of the optimization until the end. We can observe from the figures that SC-MOPSO had fewer outliers than the other two algorithms, namely, NAGA-II and NSGA-III. This was generalizable to the trust results in Figure 7.

Convergence Graphs
For additional evaluation, we present a boxplot convergence curve of each of the objectives with respect to the generation from the starting point of the optimization until the end. We can observe from the figures that SC-MOPSO had fewer outliers than the other two algorithms, namely, NAGA-II and NSGA-III. This was generalizable to the trust results in Figure 7.
erated the same level of number of nondominated solutions (NDSs). The size of the p ulation for each algorithm was 200. This led to a number of nondominated solutions 200. This was interpreted with the high number of objectives, which led to the high nu ber of nondominated solutions.

Convergence Graphs
For additional evaluation, we present a boxplot convergence curve of each of the jectives with respect to the generation from the starting point of the optimization until end. We can observe from the figures that SC-MOPSO had fewer outliers than the ot two algorithms, namely, NAGA-II and NSGA-III. This was generalizable to the trust sults in Figure 7.  Contrary to expectations, the energy consumption profile decreased as the number of iterations increased from 10 to 100 for all three algorithms. The energy consumption for each algorithm started at 0.05 and decreased as the number of iterations increased. A similar pattern can be observed for all three algorithms in Figure 8. However, both NSGA-II and NSGA-III had more outliers than SC-MOPSO-DG.
Contrary to expectations, the energy consumption profile decreased as the num of iterations increased from 10 to 100 for all three algorithms. The energy consumptio each algorithm started at 0.05 and decreased as the number of iterations increased. A ilar pattern can be observed for all three algorithms in Figure 8. However, both NSG and NSGA-III had more outliers than SC-MOPSO-DG. Contrary to expectations, the cost profile decreased as the number of iteration creased from 10 to 100 for all three algorithms. The cost for each algorithm started at and decreased as the number of iterations increased. A similar pattern can be observe all three algorithms in Figure 9. However, both NSGA-II and NSGA-III had more ou than SC-MOPSO-DG.  Contrary to expectations, the cost profile decreased as the number of iterations increased from 10 to 100 for all three algorithms. The cost for each algorithm started at 0.05 and decreased as the number of iterations increased. A similar pattern can be observed for all three algorithms in Figure 9. However, both NSGA-II and NSGA-III had more outliers than SC-MOPSO-DG. of iterations increased from 10 to 100 for all three algorithms. The energy consumption each algorithm started at 0.05 and decreased as the number of iterations increased. A s ilar pattern can be observed for all three algorithms in Figure 8. However, both NSGA and NSGA-III had more outliers than SC-MOPSO-DG. Contrary to expectations, the cost profile decreased as the number of iterations creased from 10 to 100 for all three algorithms. The cost for each algorithm started at 0 and decreased as the number of iterations increased. A similar pattern can be observed all three algorithms in Figure 9. However, both NSGA-II and NSGA-III had more outl than SC-MOPSO-DG.  The outcomes of our study are depicted in Figure 10, where we compare the performance of our newly developed SC-MOPSO-DG algorithm with that of two existing benchmarks. The results demonstrate that the median value of SC-MOPSO-DG significantly improved and reached a level below 1500, which is comparable to that of the other two benchmarks. Moreover, we observed that NSGA-II, one of the benchmark algorithms, had a higher number of outliers and incurred a greater cost than the other two algorithms. Overall, these findings indicate that SC-MOPSO-DG is a promising algorithm that can achieve comparable or better results than the existing benchmarks while being less susceptible to outliers and reducing the overall cost of the optimization process.
proved and reached a level below 1500, which is comparable to that of the other benchmarks. Moreover, we observed that NSGA-II, one of the benchmark algorithms a higher number of outliers and incurred a greater cost than the other two algori Overall, these findings indicate that SC-MOPSO-DG is a promising algorithm tha achieve comparable or better results than the existing benchmarks while being less ceptible to outliers and reducing the overall cost of the optimization process. The final metric that we analyzed was noncoverage, which is shown in Figure 11 results indicate that the noncoverage of SC-MOPSO-DG significantly decreased to which is much lower than that of NSGA-II (48%) and NSGA-III (62%). This finding gests that SC-MOPSO-DG outperforms the other two algorithms in terms of noncove which is a desirable characteristic in multiobjective optimization. Therefore, our re demonstrate the superiority of SC-MOPSO-DG over the other two benchmarks and light its potential for addressing complex optimization problems that involve mu objectives. The final metric that we analyzed was noncoverage, which is shown in Figure 11. The results indicate that the noncoverage of SC-MOPSO-DG significantly decreased to 40%, which is much lower than that of NSGA-II (48%) and NSGA-III (62%). This finding suggests that SC-MOPSO-DG outperforms the other two algorithms in terms of noncoverage, which is a desirable characteristic in multiobjective optimization. Therefore, our results demonstrate the superiority of SC-MOPSO-DG over the other two benchmarks and highlight its potential for addressing complex optimization problems that involve multiple objectives.
Sensors 2023, 23, x FOR PEER REVIEW 24 Figure 11. Boxplot representation of the noncoverage from the first generation until the end. T sign indicates the outliers.

Networking Measures
This section presents the networking evaluation. It is decomposed into four p namely, E2E delay, energy consumption, PDR, and trust.

E2E Delay
The time series is presented in Figure 12 of the E2E delay shows that the best per mance was achieved by SC-MOPSO, which produced a delay with level 0.3; NSGA-II NSGA-III generated a higher E2E delay. In addition, we observed that the behavior of MOPSO produced a transient state that slowly increased until reaching a steady state

Networking Measures
This section presents the networking evaluation. It is decomposed into four parts, namely, E2E delay, energy consumption, PDR, and trust.

E2E Delay
The time series is presented in Figure 12 of the E2E delay shows that the best performance was achieved by SC-MOPSO, which produced a delay with level 0.3; NSGA-II and NSGA-III generated a higher E2E delay. In addition, we observed that the behavior of SC-MOPSO produced a transient state that slowly increased until reaching a steady state case at 0.3, while NSGA-III produced a different pattern of the transient state, which started high and slowly decreased until reaching the steady state of 0.5 s.
sign indicates the outliers.

Networking Measures
This section presents the networking evaluation. It is decomposed into four parts, namely, E2E delay, energy consumption, PDR, and trust.

E2E Delay
The time series is presented in Figure 12 of the E2E delay shows that the best performance was achieved by SC-MOPSO, which produced a delay with level 0.3; NSGA-II and NSGA-III generated a higher E2E delay. In addition, we observed that the behavior of SC-MOPSO produced a transient state that slowly increased until reaching a steady state case at 0.3, while NSGA-III produced a different pattern of the transient state, which started high and slowly decreased until reaching the steady state of 0.5 s.

Energy Consumption
The energy consumption is presented in Figure 13. We found that the solution provided by SC-MOPSO generated a higher level of energy consumption with an increasing pattern than NSGA-II and NSGA-III. This is consistent with the self-conflicting nature of objectives.

Energy Consumption
The energy consumption is presented in Figure 13. We found that the solution provided by SC-MOPSO generated a higher level of energy consumption with an increasing pattern than NSGA-II and NSGA-III. This is consistent with the self-conflicting nature of objectives.

PDR
The other metric that was calculated was the packet delivery ratio (PDR) for the solutions generated from our developed method and the two benchmarks. As shown in Figure 14, SC-MOPSO generated the highest PDR, reaching a value of 100% compared with a PDR of around 90% for NSGA-II and of around 40% for NSGA-III.

PDR
The other metric that was calculated was the packet delivery ratio (PDR) for the solutions generated from our developed method and the two benchmarks. As shown in Figure 14, SC-MOPSO generated the highest PDR, reaching a value of 100% compared with a PDR of around 90% for NSGA-II and of around 40% for NSGA-III.

PDR
The other metric that was calculated was the packet delivery ratio (PDR) for th lutions generated from our developed method and the two benchmarks. As shown in ure 14, SC-MOPSO generated the highest PDR, reaching a value of 100% compared a PDR of around 90% for NSGA-II and of around 40% for NSGA-III.

Trust
The last metric that was calculated was trust, and it is given in Figure 15. The re show that trust reached a value of 10 for NSGA-II, which is higher than the around NSGA-III and around 6 for SC-MOPSO. However, considering that we selected a sol from the Pareto front, it is normal for one objective to be dominant over other object

Trust
The last metric that was calculated was trust, and it is given in Figure 15. The results show that trust reached a value of 10 for NSGA-II, which is higher than the around 8 for NSGA-III and around 6 for SC-MOPSO. However, considering that we selected a solution from the Pareto front, it is normal for one objective to be dominant over other objectives.

Discussion
The problem of gathering data through the use of multiple mobile sinks, multiple rendezvous points, and various numbers of hops is a multiobjective problem. As a result, two types of metrics were used to compare the results. The first type was MOO metrics, where set coverage, hyper-volume, number of nondominated solutions, and convergence graphs were utilized. Networking metrics, including E2E delay, energy consumption, PDR, and trust, were also calculated.
Regarding the first type, the results demonstrated that SC-MOPSO-DG is superior to NSGA-II in terms of most metrics and comparable to NSGA-III in terms of some metrics, while being superior to NSGA-III in terms of hyper-volume. For example, it was competitive with NSGA-III in terms of domination and was superior in terms of hyper-volume.
Regarding the second type, we only chose one solution from the Pareto front of each algorithm and generated the corresponding time series of the solution. The results were superior to those of the benchmarks in terms of PDR and E2E delay, demonstrating an excellent quality of service. Additionally, it showed a higher energy consumption profile

Discussion
The problem of gathering data through the use of multiple mobile sinks, multiple rendezvous points, and various numbers of hops is a multiobjective problem. As a result, two types of metrics were used to compare the results. The first type was MOO metrics, where set coverage, hyper-volume, number of nondominated solutions, and convergence graphs were utilized. Networking metrics, including E2E delay, energy consumption, PDR, and trust, were also calculated.
Regarding the first type, the results demonstrated that SC-MOPSO-DG is superior to NSGA-II in terms of most metrics and comparable to NSGA-III in terms of some metrics, while being superior to NSGA-III in terms of hyper-volume. For example, it was competitive with NSGA-III in terms of domination and was superior in terms of hyper-volume.
Regarding the second type, we only chose one solution from the Pareto front of each algorithm and generated the corresponding time series of the solution. The results were superior to those of the benchmarks in terms of PDR and E2E delay, demonstrating an excellent quality of service. Additionally, it showed a higher energy consumption profile and less trust, which is normal given the domination aspect of the solutions in the Pareto front and the self-conflicting nature between the objectives. The overall superiority of our developed SC-MOPSO-DG is attributable to the developed operators for class interaction, which enables moving solutions among various classes and consequently enabling variablelength searching.

Conclusions and Future Work
In a WSN, sensor nodes are typically deployed to monitor the environment and collect data. Trust-aware data gathering involves determining which nodes can be trusted to reliably collect and transmit data. Social class assignment is a mechanism used to classify sensor nodes into different groups based on their trustworthiness or reliability. Nodes in higher social classes are considered more reliable and are given higher priority in datagathering tasks. The proposed algorithm addresses the challenge of finding an optimal social class assignment for sensor nodes. It introduces a variable-length encoding scheme to represent the social class assignment, allowing for flexibility in the number of social classes and their sizes. This enables the algorithm to adapt to different network conditions and requirements. The optimization problem is formulated as a multiobjective problem, simultaneously considering multiple conflicting objectives. Typical objectives in trustaware data gathering include maximizing data reliability, minimizing energy consumption, and balancing the network load. The algorithm uses a combination of evolutionary particle swarm optimization, solution generation, and addition and deletion of rendezvous points to enable moving to an upper class or a lower class. Once the algorithm converges, it provides a set of multiobjective optimization metrics, namely, set coverage, hyper-volume, and the number of nondominated solutions, representing different trade-offs between the objectives followed by statistical analysis and selecting a suitable solution based on the specific requirements and priorities of the WSN. In an effort to confirm the proposed design's performance, a simulation was run to generate the time series of E2E delay, packet delivery ratio, trust, and energy consumption for each of the proposed designs. The SC-MOPSO set coverage was 0.06 over NSGA II compared with only a domination of 0.04 of NSGA-II over SC-MOPSO, while it showed competitive performance with NSGA-III. We concluded that VL-MOSCO is a promising approach for optimizing social class assignment in trustaware data gathering in wireless sensor networks. By considering multiple objectives and using variable-length encoding, it offers flexibility and adaptability to different network conditions, ultimately improving the overall performance and reliability of the network.

Conflicts of Interest:
The authors declare no conflict of interest.
Appendix A Table A1. An overview of existing methods for data gathering in terms of various comparison criteria.

Multiple
Data Collector