On NSGA-II and NSGA-III in Portfolio Management

To solve single and multi-objective optimization problems, evolutionary algorithms have been created. We use the non-dominated sorting genetic algorithm (NSGA-II) to find the Pareto front in a two-objective portfolio query, and its extended variant NSGA-III to find the Pareto front in a three-objective portfolio problem, in this article. Furthermore, in both portfolio problems, we quantify the Karush-Kuhn-Tucker Proximity Measure (KKTPM) for each generation to determine how far we are from the effective front and to provide knowledge about the Pareto optimal solution. In the portfolio problem, looking for the optimal set of stock or assets that maximizes the mean return and minimizes the risk factor. In our numerical results, we used the NSGA-II for the portfolio problem with two objective functions and find the Pareto front. After that, we use KarushKuhn-Tucker Proximity Measure and find that the minimum KKT error metric goes to zero with the first few generations, which means at least one solution converges to the efficient front within a few generations. The other portfolio problem consists of three objective functions used NSGA-III to find the Pareto front and we use Karush-Kuhn-Tucker Proximity Measure and find that The minimum KKT error metric goes to zero with the first few generations, which means at least one solution converges to the efficient front within a few generations. Also, the maximum KKTPM metric values don’t show any convergence until the last generation. Finally, NSGA-II is effective only for two objective functions, and NSGA-III is effective only for three objective functions.


Introduction
Genetic algorithms (GA) have been widely employed as optimization and search methods in a variety of problem domains [1,2], including industry [3], architecture [4], and research, over the past ten years [5,6]. Their strong applicability, global outlook, and ease of usage are the key explanations for their high success rate.
introduced the idea of survival of the best fitness function. Most of these algorithms incorporate the genetic operation to obtain the new chromosome (solution). The basic genetic operations are selection, crossover, and mutation [7].
In the past, the portfolio optimization problem was designed to find the configuration of assets that generated the maximum expected return which was the main criterion. However, this design changed in 1952, a new variable with the expected return was introduced by Harry Markowitz that called the risk of each portfolio. Thereafter, analysts began to incorporate a risk-return trade-off in their models [8]. Harry Markowitz doesn't consider the real-world challenges as cardinality constraints, lower and upper bounds, substantial stock size, class constraint, round-lots constraint, computational power and time, preassignment constraint, and local-minima avoidance.
In this article, we solve the portfolio problem [9] using two genetic algorithms, NSGA-II and NSGA-III. The competing parameters in the portfolio dilemma are optimizing anticipated return and mitigating risk, also known as the Markowitz, mean-variance model [10].

Aim of the Study
This study aims to find the Pareto front for portfolio problems with two and three objective functions using the methods NSGA-II and NSGA-III which are simpler and easy to apply. Those methods can address portfolio optimization problems without simplification and with decent results in a fair amount of time, and it has a lot of practical applications. we obtained solutions for the portfolio models using NSGA-II and NSGA-III same as theoretical solutions.

Novelty and Contributions
The main contributions of this paper are as follows: A genetic algorithm can be used to find the Pareto front for portfolio optimization problems which are the same as those found in other approaches. A genetic algorithm can handle the portfolio optimization problems without simplification and with decent results in a fair amount of time.
The two cases studied were presented to prove the applicability of the genetic algorithm. The framework of NSGA-II and NSGA-III are elaborated in algorithms 1 and algorithm 2.

Study Structure
In the following part of the article, we first give a literature review of NSGA-II, NSGA-III, and portfolio optimization problems in the second section. After that, we explain the concept of the NSGA-II method. The NSGA-III is discussed in the fourth section. The Karush-Kuhn-Tucker proximity measure (KKTPM) is analyzed in section five for multi-objective optimization problems [11,12]. In section six, evolutionary algorithms are used to solve a portfolio dilemma. Finally, in section seven, we bring the article to a close. There are many studies in NSGA-II. Deb et al. [13] have proposed NSGA-II which improves the iterative convergence rate while ensures population diversity by employing the fast non-dominated sorting approach. Kodali et al. [14] used NSGA-II to solve a problem that involves two objectives, four constraints, and ten decision variables of the grinding machining operation. Wang et al. [15] have used improved NSGA-II to solve multi-objective optimization of turbomachinery.

NSGA-III
There are some studies in NSGA-III. Deb and Jian [16] have proposed the first algorithm of NSGA-III to solve multi-objective optimization problems. Mkaouer et al. [17] are used NSGA-III to solve many-objective software remodularization. Zhu et al. [18] were studied an improved NSGA-III algorithm for feature selection used in intrusion detection. Yi et al. [19] were studied the behavior of crossover operators in NSGA-III for large-scale optimization problems.

Portfolio Problem
Markowitz [20] was proposed the portfolio problem, that it is looking for the expected mean-return is maximized (profit), and the risk is minimized. The factor in measuring risk is the variance of the portfolio return; the smaller the variance lower will be the risk. Michaud [21] has found that mean-variance theory has some limitations because asset volatility is required for constructing the model, and determining an asset's future volatility is challenging in practice. Momentum investment is a well-known quantitative investment strategy. Hong and Stein [22] show that this strategy, the momentum effect is used to reveal the price stickiness of stocks over a certain period; this information is then used to predict price trends and make investment decisions.

NSGA-II or Elitist Non-Dominated Sorting GA
The NSGA-II protocols [23] is the most used EMO procedure for finding multiple Pareto-optimal solutions in a multi-objective optimization problem, and it has the following features: It employs three principles: 1. an apparent diversity-preserving mechanism; 2. an elitist principle; and 3. non-dominated alternatives are stressed.
Consider a community of size N , with parent and offspring populations P t and Q t . Making R t ¼ P t [ Q t by combining offspring and parent populations in the first process. R t should be non-dominated sorted to distinguish various fronts F i ; i ¼ 1; 2; . . . ; etc. Set a new population P tþ1 ¼ [ and a counter i ¼ 1 before P tþ1 j jþ F i j j < N is reached. P tþ1 ¼ P tþ1 [ F i and i ¼ i þ 1 are the steps to take. Then use the crowding-sort F i ; < C ð Þ protocol to get the most distributed N À P tþ1 j j ð Þ solutions by sorting the crowding distance values in the sort from F i to P tþ1 . To build an offspring population Q tþ1 from P tþ1 , use the crowded tournament array, crossover, and mutation operators. Now we demonstrate a crowded tournament collection operator. The crowded comparison operator < C ð Þ performs a comparison between two solutions and returns the tournament's winning answer. It is assumed that every solution i has two characteristics. The community has a local crowding distance d i ð Þ and a non-domination rating r i .
Definition: If all of the above assumptions are true, the crowded tournament selection operator [24] compares two solutions (solution i and another solution j), and solution i wins the tournament. If r i < r j , it implies the solution i has a higher ranking. If r i ¼ r j and d i > d j , the solutions are of equal level, but solution i has a shorter crowding distance than solution j.
Crowding gap; To find the estimation density of solutions around a given solution i in the community, one takes the average distance between the two solutions on each side of solution i through each of the objectives. This d i serves as the cuboid's estimated diameter, which is calculated by using the cuboid's nearest neighbors as vertices, a process known as crowding time. For each point in the set F, calculate the crowding distance as follows (crowding type F i ; < C ð Þ: First and foremost, First, set d i ¼ 0 for each i in the set. l ¼ F j j equals the number of solutions in F. Find the ordered indices vector I m ¼sortðf m ; >Þ for each objective function m ¼ 1; 2; . . . ; M , or sort in the collection in the worst order of f m . d I m 1 ¼ d I m l ¼ 1 or assign a significant gap to the boundary solutions for m ¼ 1; 2; . . . ; M, and all other solutions j ¼ 2 to l À 1 ð Þ, assign: The lowest and highest objective function values are denoted by I 1 and I l , respectively. Algorithm 1, for generation t of NSGA-II procedure [25]. Evaluate against objective functions (Children) 8.

An Evolutionary Many-objective Optimization Algorithm Using Reference Point Based Non-Dominated Sorting Approach (NSGA-III)
NSGA-III begins [26] with a random population of N members and a series of widely spaced M-dimensional reference points H distributed over a unit hyper-plane with standard vector ones covering the entire R M þ field. The hyper-plane (HP) is set up in such a way that it intersects all of the objective axes at the same time. The technique of Das and Dennis [27] is used to position H ¼ M þ p À 1 p reference points on the HP with p þ 1 ð Þ points through any boundary. They choose the population size N to be the smallest multiplied by four greater than H, with the assumption that one population member would be obtained for all reference points.
The following procedures are carried out at descent t. Following the precept of non-dominated sorting, all of the population P t is sorted into different non-domination levels, close to how it is done in NSGA-II. The children's population Q t is generated by using standard mutation and recombination operators on the P t population. Since only one population member is expected to be examined for any reference point, each selection procedure in NSGA-III is unnecessary, as every selection operator would allow competition to be established between different reference points. After that, a combined population R t ¼ P t [ Q t is formed. Then, starting from the first non-dominated front, points are selected for P tþ1 one by one until no entire solutions from a full front can be used. This restriction is also common in the NSGA-II. Assume that there is a final front that can't be fully selected as F L . Only a few solutions from F L that choose to be selected from P tþ1 use a niche-preserving operator, which we'll look at later. To begin, any population unit of P tþ1 and F L is normalized using the current population distribution, resulting in similar values for all reference points and objective vectors. The shortest perpendicular distance ðdðÞÞ of each population unit with a reference line generated by connecting a supplied reference point with the origin is then used to correlate each component of P tþ1 and F L with a specific reference point. Then, using reference points in P tþ1 , a cautious (NS) niching technique is used to pick certain F L components that are associated with the minimum. The (NS) niching strategy ensures that a population factor is selected for each of the provided reference points [28]. A population variable that is compared with an unrepresented comparison or an under-represented point is quickly outperformed. With a constant tension to ensure non-dominated individuals, all phase is predicted to produce one population variable that correlates with any supplied reference point near the (POF) Pareto-optimal front, assuming that the genetic difference operators (mutation and recombination) will deliver specific solutions. Algorithm 2 summarizes the algorithm, which uses widely spaced comparison points to ensure a well-distributed series of trade-off points at the end. Algorithm 2, Generation t of NSGA-III procedure:

Algorithm 2: NSGA-III Approach
Input: H structured reference points Z s or supplied aspiration points Z a , parent population P t . Output: P tþ1 . 1.
Q t ¼Recombination and Mutation P t :
Until S t j j ! N : (Continued )

Karush-Kuhn-Tucker Proximity Measure (KKTPM) for Multi-Objective Optimization
For a n-variable, M -objective optimization problem with J inequality constraints: the Karush-Kuhn-Tucker optimality [29] conditions for Eq. (2) are given as follows: u m ! 0; m ¼ 1; 2; . . . ; M ; and u 6 ¼ 0: The u m multipliers are not negative, but at least one of them cannot be empty. For the j-th inequality constraint, the parameter u j is called Lagrange multiplier, and it is not even negative. A KKT point is a solution X k that meets all of the above criteria. The inequality constraints i . There are some J þ 2n inequality limits for the previous issue of whether there are whole n pairs with particular inconstant boundaries.
The authentic analysis generated an output scalarization feature (ASF) for a given repeated (solution) X k [29]. A matter of optimization: The last front to be include F l ¼ F i : 9. If S t j j ¼ N then. 10.
Points to be chosen from F l : K ¼ N À P tþ1 j j: 14.
Normalize objectives and create a reference set Z r : Normalize f n ; S t ; Z r ; Z s ; Z a ð Þ : 15.
Associate each member s of S t with a reference point: p s ð Þ; d s ð Þ ½ ¼ Associate S t ; Z r ð Þ; p s ð Þ ¼closest reference point, d ¼ distance between s and p s ð Þ: 16. Compute niche count of reference point j 2 Z r : q j ¼ P Choose K members one at a time from F l to construct P tþ1 : Niching K; q j ; p; d; Z r ; F l ; P tþ1 À Á : 18.
End if.
Subject to g j X ð Þ 0; j ¼ 1; 2; . . . ; J : The reference point Z 2 R M was believed as a utopian point and the weight vector W 2 R M is computed for X k as views: Thereafter, the KKTPM calculation process advanced for single-objective optimization problems to the ASF showed previously. So that the ASF formulation produce the objective function not differentiable, a smooth transformation of the ASF (a performance scalarization function) problem was made firstly by inserting slack variables x nþ1 and reconstructing the initial problem as views: g j X ð Þ 0; j ¼ 1; 2; . . . ; J : At this moment, the KKTPM optimization problem for the previous single-objective problem for y ¼ X ; x nþ1 ð Þcan be written as follows: f j X ð Þ À z j w k j À x nþ1 0; j ¼ 1; 2; . . . ; M ; The added term in the objective function permits a penalty correlated with the violation of the complementary slackness condition. The restrictions G j y ð Þ are given below: The optimal objective value e Ã k to the above problem corresponds to the exact KKTPM. It is observed that for feasible solutions e Ã k 1, hence the exact KKTPM was defined as follows: 6 Results Section In this section, we will solve a portfolio problem in special cases using NSGA-II in the first model and NSGA-III in the second model. After that, we will show figures for each model. But, one must know the main portfolio problem. The portfolio is a set of assets or securities (x 1 ; x 2 ; . . . ; x n ) chosen to minimize the risk and maximize the expected return. The risk is measure by the variance. The problem can be written as following [30]: To illustrate the mechanism of the evolutionary algorithms and KKT proximity measure using an evolutionary multi-objective (EMO) algorithm, we thought of three and two-objective Portfolio problems. NSGA-II is used to solve two objective problems, while NSGA-III is used to solve three objective problems. We use the SBX recombination operator [31,32] with p c ¼ 0:9 and g c ¼ 30 in every problem, as well as the polynomial mutation operator [33,34] with p m ¼ 1=n (where n is the number of variables) and g m ¼ 20 in every problem. In discussions about personal models, other criteria are listed.

Model-I for Portfolio Problem
Consider the three-security problems with expected returns vector and covariance matrix [35] given by: : x 3 are the proportions of an asset invested in the following model-I and model-II. So model-I is [19,20] max Er X ð Þ ¼ 0:062x 1 þ 0:146x 2 þ 0:128x 3 min Vr X ð Þ ¼ 0:0146x 2 1 þ 0:0854x 2 2 þ 0:0289x 2 3 þ 2 0:0187x 1 x 2 þ 0:0145x 1 x 3 þ 0:0104x 2 x 3 ð Þ subject to x 1 þ x 2 þ x 3 ¼ 1; x 1 ; x 2 ; x 3 ! 0: Fig. 1 shows the non-dominated points for model-I. In this figure, NSGA-II runs 200 generations with 100 population sizes. The obtained solutions exactly equal the previously exact obtained solutions. One advantage of applying genetic algorithms is that we obtain many solutions in a single run. Also, Fig. 2 represents the relation between generation number and KKT proximity measure. As shown from the figures, the KKT metric reduces with increasing the number of generations.
6.2 Model-Il for Portfolio Problem [31]: Fig. 3 shows the non-dominated points for model-II obtained by the NSGA-III algorithm. In this figure, NSGA-III runs 300 generations with 100 population sizes. The obtained solutions for this model by the proposed algorithm equal previously published results for this model. In Fig. 4, the relation between generation number and the KKT proximity measure is introduced. As shown from the figures, the KKT metric reduces with increasing the number of generations.  The minimum KKT error metric goes to zero with the first few generations, which means at least one solution converges to the efficient front within a few generations. Also, the maximum KKTPM metric values don't show any convergence until the last generation.

Conclusion
The solutions found in genetic algorithms are the same as those found in other approaches, and they are as effective. The genetic algorithm, on the other hand, is simpler and easier to apply. A genetic algorithm can address portfolio optimization problems without simplification and with decent results in a fair amount of time, and it has a lot of practical applications. NSGA-II and NSGA-III are used to address portfolio problems in models I and II. We measure the smallest, first quartile, median, third quartile, and highest KKTPM values as a function of generation, and the figure shows that KKTPM values decrease with generation. The obtained solutions for the portfolio models using the genetic algorithms same as theoretical solutions. NSGA-II is effective only for two objective functions, and NSGA-III is effective only for three objective functions. NSGA-II can be solving real-life optimization problems with two objective functions, and NSGA-III can be solving real-life optimization problems with three objective  In the future direction of this work, we will extend the proposed algorithms with more real-life applications with many objective functions.
Funding Statement: The authors received no specific funding for this study.

Conflicts of Interest:
The authors declare that no conflicts of interest occurred regarding the publication of the paper.