Election Algorithm for Random k Satisfiability in the Hopfield Neural Network

: Election Algorithm (EA) is a novel variant of the socio ‐ political metaheuristic algorithm, inspired by the presidential election model conducted globally. In this research, we will investigate the effect of Bipolar EA in enhancing the learning processes of a Hopfield Neural Network (HNN) to generate global solutions for Random k Satisfiability (RAN k SAT) logical representation. Specifically, this paper utilizes a bipolar EA incorporated with the HNN in optimizing RAN k SAT representation. The main goal of the learning processes in our study is to ensure the cost function of RAN k SAT converges to zero, indicating the logic function is satisfied. The effective learning phase will affect the final states of RAN k SAT and determine whether the final energy is a global minimum or local minimum. The comparison will be made by adopting the same network and logical rule with the conventional learning algorithm, namely, exhaustive search (ES) and genetic algorithm (GA), respectively. Performance evaluation analysis is conducted on our proposed hybrid model and the existing models based on the Root Mean Square Error (RMSE), Mean Absolute Error (MAE), Sum of Squared Error (SSE), and Mean Absolute Error (MAPE). The result demonstrates the capability of EA in terms of accuracy and effectiveness as the learning algorithm in HNN for RAN k SAT with a different number of neurons compared to ES and GA


Introduction
Artificial Neural Networks (ANNs) have emerged as a powerful computational model, developed by modelling the biological brain processing information into systematic procedures of mathematical formulation. ANNs are extensively applied in various computational and prediction tasks such as in pandemic diseases analysis [1], pattern recognition [2], logic extraction [3], function approximation [4], and complex analysis [5]. Over the years, researchers have utilized ANN to solve complex optimization problems suitable to an ANN's capability to provide alternative ways to perform computation and understand information compared to conventional statistical methods.
Hopfield and Tank formulated Hopfield Neural Network (HNN) in 1985 to provide a network for solving combinatorial problems [6]. HNN is a variant of ANN, which demonstrates the structure of feedback and recurrent interconnected neurons with no existence of hidden layers. HNNs exhibit great performance in pattern recognition [7], fault detection [8], and clustering tasks [9]. Several distinctive features of HNNs include Content Addressable Memory (CAM), Minimization of Energy as the neuron state changed, and fault tolerance [10]. Conjointly, HNN complies with the discrete structure of the problem and solves it by minimizing the energy function that corresponds to the solution of the problem. One of the most relevant challenges faced by the HNN is the output representation produced in solving and learning the intended problem. This argument leads to the introduction of a symbolic rule that governs the information embedded in the HNN. One of the earliest pursuits in representing ANN in terms of logical rules was coined by Abdullah [11]. This work implemented a logical rule into the standard HNN by utilizing the relationship of the cost function and the energy function. In pursuing the argument of this paradigm, one may ask: what type of logical rule can be represented in an ANN? Sathasivam [12] proposed Horn Satisfiability (HornSAT) in HNN by implementing nonoscillatory synaptic weight. From this perspective, Kasihmuddin et al. [10] proposed 2 Satisfiability (2SAT) representation in HNN. The proposed network achieved more than 90% of global minimum solutions during the retrieval phase of HNN. Similar observations were made in [13] as 3 Satisfiability (3-SAT) was implemented as the logical rule in HNN. As an extension of k Satisfiability representation, Maximum Satisfiability [14] became the first unsatisfiable logical rule that has been implemented in HNN. Although the cost function obtained is not zero, the performance metric showed that most of the retrieved states achieved global minimum energy. Since the introduction of these logical rules, [15] initiated a hybrid HNN model by implementing 2SAT to verify the properties of the Bezier Curve model. In addition, a work by [16] used an HNN with 3-SAT to optimize pattern satisfiability (Pattern-SAT). The proposed work showed that information embedded in 3SAT yielded a better result for Pattern-SAT. The work by [17] utilized 3SAT integrated with an HNN to configure a Very Large-Scale Integrated (VLSI) circuit. The proposed hybrid network achieved more that 90% accuracy in terms of circuit verification. In another development, Hamadneh et al. [18] proposed logic programming in a Radial Basis Function Neural Network (RBFNN). Logic programming is embedded in RBFNN by calculating the width and the centre of the hidden layer. These studies were extended by Alzaeemi et al. [19] and Mansor et al. [20] where they proposed 2 Satisfiability in RBFNN. The proposed logical rule reduced the complexity of the network by fixing the value of the parameters involved in the RBFNN. Note that, the common denominator in these studies is the implementation of the systematic logical rule in the ANN. There is no recent effort to implement a nonsystematic logical rule in an ANN.
From a computational intelligence point of view, metaheuristics algorithms are interesting for several reasons. First, the computation via metaheuristics can be implemented with a minimum level of bias. The algorithm can search for the optimal solution without complex mathematical derivation. For instance, Genetic Algorithm (GA) can screen the whole search space without compromising any possible optimal search space. This is due to the capability of the metaheuristics algorithm to utilize both local search and global search mechanisms to find the optimal solution. Second, metaheuristics algorithms are commonly used to reduce the computational complexity of another intelligence system. As the number of constraints grow, standard standalone ANN will be computationally burdening and tend to be trapped in a suboptimal solution. In several studies [21][22][23], metaheuristics algorithms were reported to compliment ANN in solving optimization problems. Extensive empirical studies have been conducted to investigate the effect of metaheuristics in optimizing HNN. Kasihmuddin et al. [10,24] proposed GA and Artificial Bee Colony (ABC) for optimizing 2SAT in HNN. The proposed hybrid HNN minimizes the cost function of the 2SAT in the HNN. In another development, Mansor et al. [13] proposed the use of the Artificial Immune System (AIS) in optimizing 3SAT integrated in HNN. The proposed AIS is later implemented in Maximum Satisfiability [25]. The main challenge in finding a suitable metaheuristic for Satisfiability representation is the structure of the logical rule. In this case, the first order logical rule coupled with different logical order is difficult to satisfy compared to higher systematic order logical rules.
In practice, an optimal metaheuristics algorithm must be able to cover a wide range of solutions and create several independent computations. Election Algorithm (EA) is a class of socio-political metaheuristics [26], which combines the mechanisms of evolutionary algorithm and swarm optimization. It was coined by [27], in which the algorithm was developed by modelling the presidential election process. The algorithm involves multiple layers of optimization, namely, positive advertisement, negative advertisement, and coalition, which are suitable for use by the learning algorithm. Similar to other metaheuristics algorithms such as GA and ABC, EA can be used in both continuous and discrete optimizations. The whole process is governed by the campaign process by improving the eligibility of the candidates (solutions of the constrained optimization problem) [28]. This algorithm combines the capability of the local search in a partitioned search space. Due to its unique way of improving the current solution, clinical iterative improvement for EA is reported to reduce the probability of the solution to achieve a nonimproving solution (suboptimal solution). The capacity of the EA in searching the optimal solution for constrained optimization has led to a more robust EA, such as Chaotic EA. In current development, [29] proposed a novel Chaotic Election Algorithm for function optimization by using the standard boundary-constrained benchmark function. Although chaotic EA has been reported as a tremendous success in finding the optimal solution, the capacity of the basic EA is worth investigating. In this study, we will adopt EA as the learning algorithm in an HNN to generate global minimum solutions for Random k Satisfiability (RANkSAT).
The contributions of the present paper are: (1) New logical rule;RAN2SAT is proposed by considering first and second order logic k  2   . (2) We implemented RAN2SAT in the HNN by minimizing the cost function and Lyapunov Energy Function. (3) A new EA is proposed to optimize the learning phase of HNN by incorporating RAN2SAT. The effectiveness of the EA using RAN2SAT will be compared to the state-of-the-art GA. By constructing an effective HNN work model, the proposed learning method will be beneficial for logic mining [3] and other variants of HNN [30]. The rest of this paper is organized in the following way. The new Random k Satisfiability representation is formally described in Section 2. In Section 3, the proposed RAN2SAT is embedded into HNN. The structure of the cost function and the energy function for RAN2SAT will be explained in detail. Section 4 presents the proposed EA and the existing work of GA using RAN2SAT. Section 5 reports the experimental setup, the performance metrics involved, and the general implementation of the network. The results and discussion are reported in Section 6. Finally, Section 7 concludes the paper with future directions.

The Proposed Random k Satisfiability (RANkSAT)
Random k Satisfiability (RANkSAT) is a class of nonsystematic Boolean logic representation. It consists of random number of literals (can be the negated literals) per clause. RANkSAT is represented in Conjunctive Normal Form (CNF), where each clause contains random number of variables connected by an OR operator. The fundamental structure of RANkSAT is not restricted compared to conventional kSAT [17] logical representation. Hence, the general formulation for RANkSAT is given as where n , 0 n  and m , 0 m  . Therefore, the clause in RANkSAT P is defined as In particular, the first and second order clause are denoted as    [3], the Boolean value for the mapping is expressed as 1 (TRUE) and −1 (FALSE). In theory, the example of RANkSAT formula for 2 k  is given as According to Equation (3), RANkSAT P comprises of In this study, we investigated the RAN2SAT for the case of 2 k  .

RAN2SAT in a Hopfield Neural Network
The fundamental architecture and structure of a Hopfield Neural Network (HNN) consists of discrete interconnected bipolar neurons without any hidden neurons [31]. The synaptic weights are strictly symmetrical in manner, without self-mapping among the interconnected neurons. Hence, the Content Addressable Memory (CAM) is studied as a dynamic storage system for the synaptic weights [12]. Given an initial vector that is mapped to the neuron state   where ij W describes the synaptic weight matrix of HNN, which establishes the strength of the connections from neuron j to i with predetermined bias  . In this study, the HNN is implemented as the central network in training the  is given as where NC and m n  are the number of clauses and the number variables in , respectively.
Note that the inconsistency of 2 RAN SAT P is given as: The value of W are second and first order synaptic weights of the embedded Equations (7) and (8) The structure of Equation (9) is valid for RAN2SAT logical representation for the case of 2 k  . Equation (7) Hence, the quality of the final neuron state can be properly examined by checking the following condition: Hebbian learning was reported to produce an oscillating neuron state that will result in a suboptimal value of 2 RAN SAT P H . In this paper, the implementation of in HNN is denoted as the HNN-RAN2SAT model.

Election Algorithm (EA)
Election Algorithm (EA) is a metaheuristics algorithm inspired by the socio-political phenomenon of presidential elections conducted by a majority of the countries in the world. This algorithm was introduced by [27] for finding solutions for function approximation. Inspired by other evolutionary algorithm such as GA, EA relies on an intelligent search by implementing three iterative operators, i.e., positive advertisement, negative advertisement, and coalition. Each of the operators comprises an individual that can be effectively divided into candidates and voters, similar to the actual electoral system where a candidate must be initially selected from the party and the best candidate will end up with the most votes. In this situation, the candidate will assert dominance and influence their supporters (voter) and increase the chances of the candidate winning the election. Interestingly, this algorithm provides partitions in a solution space where each partition is represented by a party and is coordinated by one candidate. Each party will optimize both voters and candidates until the election day. In this paper, we utilize EA to find the optimal assignment for RAN2SAT that minimizes the cost function during the learning phase of the HNN. The basic motivation for choosing EA was due to the structure of RAN2SAT, consisting of first and second order logic. In [12], the complexity of the logic programming in the HNN increased sharply because the probability of getting  for the first order clause is small. This limitation requires an algorithm that can effectively flip the neuron state based on the previous improved solution with a wide solution space. In general, the fitness function or eligibility value for the candidate L j in EA is given by where   2 i C and   1 i C are second and first order RAN2SAT clauses, respectively, and are given as Each neuron string in the HNN represents the assignment that corresponds RAN2SAT instances. Similar to the other fitness functions of the general metaheuristics in [10,34], the objective function of our proposed EA is to maximize the eligibility of the candidate (neuron string): In the basic EA proposed by [27], each individual in the search space will be optimized so that it can satisfy the continuous function. The implementation of EA in HNN is abbreviated as HNN-RAN2SATEA. The stages involved in HNN-RAN2SATEA are as follows:

Forming Initial Parties
In this stage, the solution space is divided into party N parties. The fraction of voters in each party is given as follows: where party N is the number of party j that is predefined earlier. The eligibility of each individual (voters or potential candidate) is evaluated based on Equation (12). The individual that has the highest eligibility value for party j will be elected as a candidate j L . The rest of the individuals are regarded as voters j i v for that candidate. The similarity of belief between the candidate j L and the voter j i v is represented in the form of distance: where j L f and j i v f are the eligibility of the candidate and voters, respectively.

Positive Advertisement
In this stage, the candidate will expose their plans and try to influence the voting decisions made by the voters. Hence the number of voters that will be influenced by the candidate is given as follows where  p is a positive advertisement rate,  p  0,0.5     . The reasonable effect from the candidate to the voter is defined as the eligibility distance coefficient Hence, the updating (state flipping) of each voter is based on the following equation: where j N m n   , a sum of first and second order of RAN2SAT. The eligibility for each voter and candidate will be evaluated based on Equation (12). In this stage, there is a possibility that the voter will replace the current candidate if the eligibility of the voter is higher than the present candidate.

Negative Advertisement
In this stage, the candidate will try to attract voters from other parties that are not in party j .
Negative advertisements will lead to an increase in popularity of the candidate from different parties. The number of voters that are influenced from the negative advertisement is as follows: where v i * is voters from other parties and  n is a negative advertisement rate,  n  0,0.5     . The similarity of beliefs between the candidate j L and voter v i * is defined as follows The reasonable effect from the candidate to the voter from another party is defined based on the eligibility distance coefficient where N j  m  n . The eligibility of each voter and candidate is evaluated based on Equation (12). In this stage, there is a possibility that the voter will replace the current candidate.

Coalition
Similar to the process of candidate coalition, the candidate will form a partnership with an individual (voter and candidate) from another party. In this case, the parties will exist codependently with each other. The effect of both candidates from both parties within the same coalition is computed based on Equation (23).

Election Day
If the termination criteria for Stages 3-5 are satisfied, the election will be conducted to evaluate the final eligibility of all the candidate. If j L f m n   , the candidate will be elected, otherwise stages 3-5 are repeated until the specified number of iterations is reached. In this paper, the maximum iteration Ir is considered as the stopping criteria of the proposed algorithm. Algorithm 1 shows the detailed procedure of the proposed HNN-RAN2SATEA.

Genetic Algorithm (GA)
Genetic Algorithm (GA) is a variant of a random-based evolutionary algorithm, utilized as an effective searching technique or as a learning algorithm. The pioneering work of [35] developed the idea of the nonfit solutions being improved with each iteration by employing genetic operators. It was formally described as Messy GA in [36], which functions as a learning algorithm. Kasihmuddin et al. [10] proposed GA for performing kSAT logical representation during the learning phase of HNN. In their work, neurons in the HNN were represented as information that made up the chromosomes. We adapted the same structure for GA for performing RANkSAT. The possible assignment of RAN2SAT in GA is represented as chromosomes S i .The fitness function f S i of each S i is given by: C are second and first order RAN2SAT clause, respectively, and were given as Each neuron string in the HNN represents an assignment that corresponds to RAN2SAT instances. The objective function of proposed GA is to maximize the fitness of the S i (neuron string): Note that the proposed GA is the state-of-the-art, and the fitness function is tailored to RAN2SAT representation. The implementation of GA in HNN is abbreviated as HNN-RAN2SATGA. The stages involved in HNN-RAN2SATGA are as follows:  . The state of neuron in each S i is represented by 1 (TRUE) and −1 (FALSE).

Fitness Evaluation
The fitness f S i of each S i is evaluated based on Equation (25). In this case, the proposed model only accommodates f S i . Note that the maximum fitness of S i is f S i  f mn and if f S i reaches maximum fitness, the algorithm will be terminated.

Selection
N D chromosomes that acquire a high value of f S i will be selected. The selection of the chromosomes is based on the following equation: where  is the selection rate of the chromosomes, ranging to   0,1     . This stage is vital because lower values of f S i will not be included in the next stage.

Crossover
The genetic diversification of the S i occurs during this stage. Crossover involves exchange of two substructures from both S i . Note that the location of the crossover is determined randomly. The following process illustrates crossover between S 1 and S 2 : Before Crossover

Mutation
The mutation operator performs state flipping from 1 to −1 or vice versa. The mutation will theoretically enhance the average fitness of the S i . Note that there is a chance that the f S i

HNN Model Experimental Setup
In this study, EA has been incorporated into an HNN in the search for an optimal solution for RAN2SAT logic representation. The proposed hybrid computational model will be compared with the existing HNN-RAN2SATES [37] and HNN-RAN2SATGA [10] models. Both HNN models employ simulated datasets to establish RAN2SAT logical clauses. To achieve a meaningful comparison between the existing HNN models, all source code was formulated based on the simulation program developed in Dev C++ release version 5.11 running on a device with an Intel ® Celeron ® CPU B800@2GHz processor with 4 GB RAM utilizing Windows 8.1. Tables 1-3 indicate the appropriate parameters during each HNN model execution.

Performance Metric for HNN-RAN2SAT Models
In this study, the training phase of the HNN-RAN2SATEA model is compared against the other existing HNN models. To prove the efficacy of the HNN-RAN2SATEA model, we compared the proposed algorithm with HNN-RAN2SATES and HNN-RAN2SATGA to find the root mean square error (RMSE), mean absolute error (MAE), sum of squared error (SSE), and mean absolute percentage error (MAPE).

Root Mean Square Error (RMSE)
RMSE is used to provide information on a model's short-term results by reporting the real discrepancy between the expected value and the calculated value [38]. When introducing RMSE, the fundamental presumption is that the mistakes are rational and meet a normal distribution [39]. Therefore, RMSE gives a clear description of the distribution of errors. The RMSE formula takes the following equation: where NC f is highest fitness achieved in the network based on the HNN-RAN2SAT model, i f fitness computed by the network and n is the number of iteration before NC i f f  .

Mean Absolute Error (MAE)
MAE is described as the average difference between the expected value and the calculated value in the solution space of the given data. The work by [40] stated that MAE is comparatively easy to compute, and it is the most appropriate indicator of average magnitude of error. MAE is ideal for a model with uniform distribution [41]. The MAE equation can be expressed as:

Sum of Squared Error (SSE)
In learning neural networks, the sum of squared errors between the expected value and the actual value is commonly minimized. This criterion's success is attributed in part to the presence of solvable algorithms for their minimization [42]. The SSE formula is as follows:

Mean Absolute Percentage Error (MAPE)
MAPE calculates the size of error by percentage. It has been argued that the MAPE is strongly suited for forecasting applications, especially in situations where adequate data is accessible [43,44]. One of the key factors for its popularity is its simplicity of interpretation and understanding [45]. The MAPE formula can be computed as:

Implementation of HNN-RAN2SAT Models
The HNN-RAN2SAT models were implemented in a systematic procedure, as shown in Figure  1, where the difference is the learning algorithm deployed during the learning phase. Both variables and clauses were initially randomized. The executions of these models were carried out based on Figure 1.  Additionally, the mechanism of GA will create lower diversification of Leader selection (candidate eligibility) requires an optimization operator that accelerates the process of obtaining the best leader (solution). HNN-RAN2SATEA employs a more diversified optimization layer consisting of three layers in order to improve the solution in a particular partition of the solution space [27]. The first optimization layer, known as positive advertisement, will create the optimization among the party. Secondly, the negative advertisement allows the other party to take the voters from a specific part. Thirdly, coalitions provide a tremendous optimization impact in obtaining the most voters (more solutions), as our case is in attaining global solutions. The coalition process will form a unified party with greater eligibility within a shorter timeframe [28]. These features in EA lead HNN-RAN2SAT to reduce the iterations needed during the learning phase, ensuring minimum error evaluation at the end of the simulations.

Results and Discussions
The systematic solution space partition in HNN-RAN2SATEA improves the global and local search process for obtaining global solutions. The partition of the solution space allows the model to effectively find the solution in all defined spaces. Specifically, the solution spaces for HNN-RAN2SATEA are given as four spaces. On the contrary, HNN-RAN2SATGA adopted one partition of the overall solution space, which results in nonfit solutions during early stages of the model. On the same note, HNN-RAN2SATGA assimilated only one solution space, and the searching process utilized the trial and error mechanism, which requires more iterations to obtain the global solution.
EA was only implemented as the learning algorithm, without direct intervention in the retrieval phase. A different approach can be employed for optimizing the retrieval phase of HNN-RAN2SATEA. Different types of Hopfield Neural Networks, such as Mutation Hopfield Neural Network [30], Mean Field Theory Hopfield Network [46], Boltzman Hopfield [47], and Kernel Hopfield Network [48], drive the local minimum solution to the global minimum solution in different ways. More performance metrics can be investigated to authenticate our results. Similarity indices, such as Jaccard's Index [49], Sokhal-Sneath2 Index [50], and Variation Index [50], can be employed to assess the similarity between the final states obtained by the model. In addition, we adopt Symmetric Mean Absolute Percentage Error (SMAPE) [51], Median Absolute Percentage Error [48], Fitness energy landscape [52], computation time [53], and specificity analysis [54].

Conclusions
Firstly, EA has been proposed as a learning algorithm during the learning phase of the first order and second order clauses of RAN2SAT. Thus, the capability of EA is determined by the systematic optimization layers, positive advertisement, negative advertisement, and the coalition operator, which successfully minimize the error evaluations towards the global solution. Secondly, we compared the effectiveness of EA in the learning phase with the existing algorithm, GA, and ES while manipulating the number of neurons. The findings showed that HNN-RAN2SATEA outperformed the other two models, HNN-RAN2SATES and HNN-RAN2SATGA, due to its effective learning mechanism, especially in partitioning the solution spaces to reduce complexity. The effective partitioning of the search space in EA allowed the searching process to be more accurate without undergoing intensive processes. It was found that HNN-RAN2SATES experienced neuron oscillations when NN  45, indicating the weakness of ES as the learning mechanism. This work has successfully highlighted the capability of EA and RAN2SAT during the learning phase for generating more diversified interpretations that lead to global minimum solutions. Extending from our study, different classes of Hopfield Neural Networks can be adopted, such as Mutation Hopfield Neural Network [30], Mean Field Theory Hopfield network [46], Boltzmann Hopfield [47], and Kernel Hopfield Network [48], in order to investigate the impact of the retrieval phase. These works are currently in progress and will be reported in the future.