Quantum-inspired meta-heuristic approaches for a constrained portfolio optimization problem

Portfolio optimization has always been a challenging proposition and a highly studied problem in ﬁnance and management. Portfolio optimization facilitates the selection of the right assets and their distribution according to the set objectives. Often, it has been found that this nonlinear constraint problem cannot be efﬁciently solved using a traditional approach. In this paper, quantum-inspired incarnations of three evolutionary techniques, viz., (i) genetic algorithm (GA), (ii) differential evolution (DE), and (iii) particle swarm optimization (PSO) are used for the portfolio optimization problem. Experiments have been conducted with more than 10 years of stock price data from NASDAQ, BSE, and Dow Jones. Several enhancements of the evolutionary algorithms have been proposed in this article, viz., (i) enhanced crossover techniques for the portfolio optimization problem, (ii) regularization function to allocate funds efﬁciently, and (iii) dynamic parameter tuning using sensitivity analysis.


Introduction
A portfolio is a range of investments held by an individual or an organization in the form of stocks, bonds, mutual funds, commodities, cash, and cash equivalents, including closed-end funds [1] and exchange-traded funds [2].The sole purpose of maintaining a portfolio is to achieve a balance between risk and return based on the investor's financial goals.A well-diversified portfolio can help portfolio managers achieve the financial goals set, but excessive diversification should be avoided to reduce transaction cost [3] [4].Managing a portfolio involves complex decision-making and is a frequently studied topic in finance.Due to the non-linear nature of constraints, it requires complex computation and hence cannot be easily solved by traditional techniques.Nearaccurate and timely calculation of weights is the key in any decision-making process and hence requires fast and more accurate techniques to be incorporated as a portfolio optimization process.Additionally, with the dawn of quantum computing and quantum-inspired techniques, metaheuristic-based techniques have been observed to outperform traditional machine learning-based techniques and have been found to be suitable for portfolio optimization problems.In this study, an effort has been made to study different evolutionary techniques and compare them with their quantum-inspired versions.Some of the key highlights of this study include the following.
• Benchmarked datasets: Three benchmark datasets, viz.(i) NASDAQ (from 2012-06-23 to 2022-06-27) [5], (ii) BSE (from 2011-05-13 to 2023-02-07) [6], and (iii) Dow Jones (from 2009-08-06 to 2023-05-05) [7], are selected for this experiment, and the results are presented and discussed as part of this study.• Genetic algorithm (GA): The genetic algorithm (GA) [8] is one of the first population-based metaheuristic algorithms inspired by the Darwinian theory of evolution [9] [10].As a part of this study, GA is studied in detail, and two popular crossover techniques, viz.(i) arithmetic crossover and (ii) heuristic crossover techniques, are implemented, and the results of application on the mentioned datasets are reported.• Differential evolution (DE): Differential evolution (DE) [11] [12] is another population-based metaheuristic algorithm, similar to GA, and is generally found to be faster and more accurate than GA.As a part of this study, DE is studied in detail with two popular crossover techniques, viz., (i) arithmetic crossover and (ii) heuristic crossover techniques, are implemented, and the results of application on the mentioned datasets are reported.• Particle swarm optimization (PSO): Particle swarm optimization (PSO) [13] [14] is the third evolutionary technique considered for this study.PSO has been found to be efficient in dealing with complex optimization space and volatile market conditions.As a part of this study, PSO is implemented, and the corresponding results are reported.• Quantum-inspired versions of GA, DE, and PSO: An effort, first of its kind, has been made to design and implement GA, DE, and PSO in the quantum-inspired domain, and the results are compared with the mentioned datasets.
Portfolio managers must ensure that all funds are allocated efficiently and in the right proportion to achieve maximum gain.Additionally, it has been observed that the random selection of weights, as proposed in the evolutionary-based optimization techniques, does not guarantee that all available funds are allocated.Sometimes, the sum of all the weights could be higher or less than 100%.In order to overcome this problem, a regularization function is proposed as a part of this experiment, which is further represented as where, w reg i is the regularized weight of i th stock, w i is the random weight selected, and ∑ n i=1 w i is the total weight that has been randomly selected.Furthermore, it has been observed that the choice of parameters in the portfolio optimization process could be an iterative and time-consuming process.To overcome this challenge, a sensitivity analysis is performed, and the values of the parameters are chosen accordingly.The performance of the mentioned techniques is measured using the mean error, execution time, and fitness function (minimum risk).The remainder of the paper is organized as follows.Section 2 briefly lists the motivation and contribution of this work.Section 3 provides an overview of portfolio management and optimization.A brief review of the related works on portfolio optimization is provided in Section 4. Section 5 briefly lists the evolutionary techniques employed in this study.Section 6 elucidates on the relevant quantum computing and quantum-inspired techniques.Section 7 presents the experimental results, and finally, the paper is concluded in Section 8.

Motivation and Contributions
Portfolio optimization requires a sound understanding of the market dynamics.It has always been considered a challenging problem and therefore holds a special place in the research arena [15].Investing in the right stock at the right time is the key to any portfolio optimization problem.There are multiple techniques and guidelines proposed in this domain, but it remains a challenging problem to solve.With the recent advancements in evolutionary techniques and a leap in the computational infrastructure, it is now possible to handle large combinatorial optimization problems.Some of the other key factors which make it even more interesting [16] include (i) dynamically changing market parameters (ii) dynamically changing constraints like transaction cost, management fees, legal constraints, regulatory constraints, and similar other constraints (iii) limitation of historical data and their quality (iv) limitations of model assumptions (v) diversification challenges and constraints (vi) behavioural biases (vii) computational challenges and model complexities (viii) lack of knowledge to choose better optimization techniques based on market conditions and imposed constraints.Additionally, portfolio optimization is highly affected by external factors, making it more challenging for portfolio managers to make decisions.Some of the key external factors [17] [18] include (i) macroeconomic indicators like inflation rates, interest rates, GDP growth, and other economic behaviours (ii) geopolitical events like political instability, election results, power changes, war or war-like conditions, and other types of trade disputes (iii) central bank policies like repo rates, cash reserve ratio, and other interest rate policies (iv) market sentiments like investors' behaviour and psychology (v) natural disasters and other calamities, and (vi) global economic behaviours and trends.This study involves the examination and evaluation of various evolutionary methods in three benchmark datasets.An effort, the first of its kind, is made to implement the same techniques in both the classical and quantum-inspired domains.Based on careful observation of the execution of GA [8] [19] with arithmetic and heuristic crossovers, an enhancement is proposed in this paper, and the experimental results are presented.The highlights of the contribution include the following.
• Dynamic selection of crossover parameter values α and β .The selection of the parameters for a genetic algorithm or a differential evolution algorithm is an iterative process that can have a significant effect on the convergence of the overall solution.The performance and efficiency of the algorithms can be improved by dynamically selecting the crossover parameters, allowing them to better adapt to the complexity of the problem and achieve a balance between exploration and exploitation of the feature space.Additionally, this dynamic selection can help to tune and speed up the convergence process automatically.• Normalization function to avoid negative allocation caused due to incorrect crossover parameter selection.The choice of incorrect crossover parameters, such as α and β , can result in negative weights, which are not desirable.To ensure a more realistic allocation of stocks, this study proposes a normalization function that takes into account the absolute value of the weights.• Regularization function for better utilization of allocated funds.The total allocation of a portfolio can often exceed 100% when the sum of the dynamically selected weights is taken into account.This is not desirable.The proposed regularization function ensures that the total investment does not exceed 100%.• Dynamic selection of optimization parameters based on sensitivity analysis.A thorough sensitivity analysis can be used to assess the influence and connection between the parameters used in the methods discussed.This can then be used to reduce the number of iterations and speed up the convergence of the chosen techniques.

Overview of Portfolio Management
Building a successful investment in the ever-changing dynamic market requires a fundamental change in how one thinks about investment.As a portfolio manager, the sole objective is to get high returns based on the objectives set.Additionally, new advances in investments and offers have conditioned us to think beyond the strategies we grew up with.It is also a time that requires us to apply a more advanced mode of investment decisions and to have better control over our strategies.Fortunately, with the improvement of technology, we can now employ new ways of optimization and help portfolio managers in a better decision-making process.A portfolio, in literal terms, can be described as a collection of financial investments in the form of stocks, bonds, cash, assets, and any other form of commodities that tends to give some form of return in the future.Building an ever-growing portfolio is the key objective of an individual or an organization and can be managed by the individual or organization.It has been observed that companies sometimes open multiple business models at the same time, despite their ability to execute them successfully [20].These factors can lead to severe losses and must be considered during investment.Furthermore, a portfolio can be mathematically represented as where, at any given time, t, s 1 , s 2 , ..., s n are the securities and w 1 , w 2 , ..., w n are the weights, percentages or quantities associated with the securities.The weight at time t is represented as w t j = Amount invested in securities s j Total amount invested in portfolio P t (3) Let us assume a list of securities as GOOGL, AMZN, AAPL with optimum percentages as 0.3, 0.2, and 0.5, then the corresponding portfolio at time t is represented as Due to the dynamic nature of the market, portfolio managers need to make the right decision at the right time to either invest more or withdraw from the stock.In addition to that, there is also a transaction cost associated with the allocation and deallocation decisions, making this problem even more challenging and interesting.Hence, as a portfolio manager, one must consider key characteristics like (i) future events and targets been set, (ii) fast and accurate decision-making, (iii) stage in which the investments are made, and (iv) resource limitations.Typically, the job of a portfolio manager includes (i) return maximization, (ii) diversification, (iii) balancing, (iv) setting up the right strategy, and (v) investing in the right number of assets.
A brief study of portfolios, portfolio types, and portfolio optimization is presented in [21].

Related Works
The analysis of multiple nonlinear constraints has always been a challenging proposition and portfolio optimization is no exception.Several works have been reported in the literature to address the portfolio optimization problem.Meghwani et al. [22] proposed a portfolio optimization approach under practical constraints using multi-objective evolutionary algorithms (MOEAs).This study proposed a candidate generation procedure and a repair mechanism to optimize a large portfolio.It was found that the methods proposed in [22] could handle a wide range of constraints, such as cardinality, pre-assignment, budget, quantity, and round-lot constraints.Furthermore, techniques such as the non-dominated Sorting Genetic Algorithm 2 (NSGA2) [23], the Strength Pareto Evolutionary Algorithm 2 (SPEA2) [24], the Global Weighting Achievement Scalarizing Function Genetic Algorithm (GWASFGA) [25], and the Pareto envelope-based Selection Algorithm 2 (PESA2) [26] have been found to be effective in optimizing large portfolios.Generally, portfolio optimization requires addressing complex search spaces that contain both continuous and discrete variables.Utilizing a complex coding scheme (CCS) [27], which formulates the problem as mixed-integer non-linear programming (MINLP), has been demonstrated to be effective when the continuous variables are contingent on discrete variables.CCS has been shown to be efficient and reliable in dealing with multiple objectives and constraints in large portfolio optimization problems.Furthermore, NSGS2 [23], SPEA2 [24], and PESA2 [26] can be used when dealing with a limited number of restrictions [28].In addition to the capacity to manage multiple constraints, it is also essential to take into account the generation distance when using evolutionary techniques.According to the generation distance, SPEA2 has been found to be superior to PESA2 [29].Different versions of evolutionary techniques, such as artificial bee colony (ABC) [30], firefly algorithm (FA) [31], genetic algorithm (GA) [32], and particle swarm optimization (PSO) [13], have been found to be effective in managing portfo-lio optimization problems [33][34].Furthermore, a set-based particle swarm optimization (SBPSO) [34] redefines the domain of the portfolio optimization problem.Few evolutionary techniques, such as GA, suffer from the problem of balance between exploration and exploitation.To overcome this problem, two balancing methods, viz.(i) harmonic progression NSGA2 (HPNSGA2) and (ii) random immigration NSGA2 (RINSGA2), have been proposed in [35].The results show that the RINSGA2 algorithm generates a better spread compared to NSGA2 [36].It has also been observed that a learning component can be beneficial in tackling multiple objectives and constraints in a large portfolio optimization problem.A study on multi-objective evolutionary techniques based on guided learning has been conducted in [37][38][39] [40].In portfolio optimization, it is important to reduce the number of stocks to minimize transaction costs.Studies on this topic can be found in [41].Furthermore, various versions of evolutionary techniques with multiple objectives and constraints have been explored in [42][43] [44].
Recently, it has also been observed that the potential of evolutionary techniques can be improved by combining classical machine learning and deep learning approaches.A comprehensive comparison of various incarnations of particle swarm optimization (PSO) was conducted in [45], which also included the analysis of artificial neural networks (ANNs) [46] based on swarm intelligence.In addition, stock market data was studied using a variety of methods, such as support vector machine (SVM) [47], deep learning [48][49], and clustering [50].In [51], a strategy was proposed that combines two machine learning models, random forest (RF) [52] and support vector regression (SVR) [53], with three deep learning models [54], long-short-term memory (LSTM) networks [55][56], deep multilayer perceptron, and convolutional neural networks [57].Furthermore, Zheng et al. [58] suggested a hybrid model that combines XGBoost [59][60] with an improved version of the firefly algorithm.
Recent efforts have been made to use evolutionary techniques in classical and quantum-inspired domains to address non-linear portfolio optimization problems, resulting in a surge of research in this area [61][62] [63].Quantum computing has become a popular topic in fields ranging from portfolio optimization to blockchain and security [64].A portfolio optimization technique using a DWave quantum annealer was proposed in [65].The study employed four different measures, including mean-variance, Sharpe ratio, simplified Chicago quantum ratio (CQR), and a new Chicago quantum net score (CQNS) to identify the optimal risk.The results show DWave outperforms the Monte Carlo method and is best suited for largely constrained multi-objective functions.Furthermore, simulated quantum annealing has been shown to be more robust and computationally faster when using the D-Wave 2000Q TM quantum annealer in a variety of portfolio optimization problems [66][67].Additionally, it has been observed that quantum-inspired simulated bifurcation is an effective way to tackle NP-hard combinatorial optimization problems, as demonstrated in [68].Investors and researchers have recently been drawn to social responsibility investment (SRI) [69].A three-step framework based on environmental, social, and governance criteria (ESG) has been proposed in [70].Combining ESG scores with finan-cial indicators demonstrates that it is possible to invest in a way that is consistent with social values.As [70] suggests, long-term financial returns can be achieved by reducing potential risks such as litigation, tax, compliance, and honor risks [71].
Additionally, the ESG score can be taken into account when selecting stocks to minimize potential losses.A bi-level approach based on ESG [72] has been found to be effective in reducing the overall impact on the company.

Evolutionary Optimization
Evolutionary computing [73] is a branch of artificial intelligence that is often used to solve complex optimization problems.It is based on the concept of biological evolution and is suitable for tackling problems that involve a large number of variables.Just like natural selection, the fitness of an individual in a population is determined by how well it is able to adapt and reach its objectives.In the context of portfolio selection, a candidate is chosen based on their potential to be a successful candidate in the evolutionary process.The development of the first evolutionary algorithm (EA) [74][75] is attributed to a few pioneers who independently proposed different approaches, viz., (i) Evolutionary programming (EP) [76] as proposed by Fogel et al. [77] aiming at evolving finite automata, later at solving numerical optimization problems, (ii) Genetic algorithm (GA) [78] using binary string aiming to solve combinatorial optimization problems [79], (iii) Evolutionary strategies (ES) as proposed in [80] motivated by engineering problems and aiming to solve selection problems, and (iv) Genetic programming (GP) as proposed in [81] aiming to optimize computer programs.The above-mentioned techniques form the core of evolutionary computing.Typically, any EA involves four steps, viz., (i) initialization, (ii) selection, (iii) genetic operators, and (iv) termination as mentioned in Fig. 1.A step-by-step understanding of the evolutionary computing algorithm [74] is provided in Algorithm 1. Generally, evolutionary computing (EC) [73] algorithms include genetic algorithm (GA) [78][8], evolutionary strategies (ES) [82][83], learning classifier systems (LCS) [84], differential evolution (DE) [11][12], and estimation of distribution algorithm (EDA) [85].Recently, swarm intelligence (SI) [86] algorithms such as ant colony optimization (ACO) [87] and particle swarm optimization (PSO) [14] have gained popularity and are categorized as EC [73] family algorithms.In this article, three of the evolutionary computing techniques, viz.(i) genetic algorithm (GA) [8], (ii) differential evolution (DE) [11], and (iii) particle swarm optimization (PSO) [14], are implemented for addressing the portfolio optimization problem.For both the genetic algorithm (GA) and differential evolution (DE), advanced crossover techniques are used, viz.(i) arithmetic crossover and (ii) heuristic crossover with proposed enhancements are implemented.An effort has been made to come up with two hybrid approaches on top of the arithmetic and heuris-tic crossovers.An effort, first of its kind, is also made to implement the mentioned techniques in the quantum-inspired domain.

Genetic Algorithm
Genetic algorithms (GAs) [8] are population-based metaheuristic algorithms that are inspired by the Darwinian theory of evolution [9] [10].Like other evolutionary algorithms, GAs use selection, crossover, and mutation as their main operators.When dealing with portfolio optimization problems, it is important to select the right crossover technique and measure.A study of different GA techniques and measures used in portfolio optimization problems can be found in [21].GAs evaluate randomly selected populations using a fitness function.The pseudocode for GA is provided in Algorithm 2, and the flowchart of the algorithm's operation is shown in Fig. 2.

Differential Evolution
Differential Evolution (DE) [11][12] is a member of the Evolutionary Algorithm (EA) family, which is known to be more accurate, faster, and more reliable for opti-mization problems.It is easy to comprehend, similar to the Genetic Algorithm (GA) [8], and can be used for portfolio optimization.DE [88] has a non-uniform population generation process that increases diversity and often produces more optimized results.The crossover used in GA is also used in DE, allowing for a better comparison.This is why DE [88] is chosen to test the modified crossover techniques in this article.Additionally, DE has been observed to perform better with floating-point weights, which is a desired outcome in portfolio optimization.The algorithm for differential evolution is analogous to that of a genetic algorithm, as shown in Algorithm 2, with an improved population generation process.The equation used for population generation is expressed as where, New wt i is the new weight generated through the DE process, X min is the minimum weight of the allocation, wt i is the current weight, and x max is the maximum allocation possible for a portfolio.

Crossover Techniques Used
The effectiveness of genetic algorithm (GA) [8] and differential evolution (DE) [89][90] depends on three factors, viz.(i) population, (ii) mutation rate, and (iii) crossover parameters chosen.This article proposes improvements to the popular crossover techniques, viz., arithmetic crossover [91] and heuristic crossover [92], for portfolio optimization problems.A comparative study of these crossover operators is made on different datasets to establish the significance of the proposed enhancements.

Arithmetic Crossover
The arithmetic crossover operator [93] combines two parents linearly to generate children.The mathematical technique used is given by where, ch 1 is the first child, ch 2 is the second child, α is the crossover rate, p 1 is the first parent, and p 2 is the second parent selected for the crossover operation.

Heuristic Crossover
The heuristic crossover operator [94] combines two parents to generate children that are between the best and worst selected parents using the following expression.
where, ch1 is the first child, ch2 is the second child, β is the crossover rate, p best is the best parent, and p worst is the worst parent selected for the crossover operation.

Challenges in the Crossover Methods for Portfolio Optimization
When it comes to portfolio optimization, the mentioned crossover operations exhibit four problems, viz., (i) these are highly dependent on the selection of the appropriate value of α based on the problem statement (ii) the mentioned crossover techniques cannot be generalized for different problems (iii) the child weights generated could be negative, which denotes negative investment and (iv) the total of allocation could be less than or more than 100% of the available funds.The objective of crossover in any portfolio optimization problem is to ensure that it generates non-negative weights and that the total allocation should not be greater than 100%.Furthermore, for the best return, the optimizer should allocate all the available funds.
An effort has been made in this work to overcome the above-mentioned challenges in the arithmetic and heuristic crossovers by introducing two improvements, viz.(i) a circular regularization function to ensure 100% allocation and (ii) by considering absolute weights to avoid non-zero values.

Particle Swarm Optimization
Particle swarm optimization (PSO) [13][14] is one of the evolutionary techniques that is based on swarm intelligence [14].PSO intends to simulate social behavior as a representation of the movement of organisms in a flock of birds or a fish school and can also be used in a volatile market condition.PSO considers each member of the population as a particle.PSO [14][95] uses the technique of "gbest neighborhood topology" as proposed by Kennedy et al. [96].In multiple research studies, it has been proven that PSO outperforms other evolutionary techniques such as GA [8] and DE [11][12] and therefore has been used in this work.PSO has several advantages over other evolutionary techniques and has been applied in areas involving function optimization, artificial neural network training, fuzzy control systems, and fields related to finance and accounting.The evolution process in PSO can be given by [97] where, v k i is the velocity of the i th particle at the k th iteration, and x k i is the current solution (or position) of the i th particle at the k th iteration.c 1 , c 2 are positive constants, and r 1 , r 2 are two random variables between (0, 1).In Equation 8, w is the inertia weight of the stock.The pseudo-code of PSO is given in Algorithm 3. A survey on PSO-based financial application [98] in portfolio optimization is presented in [45].The proposed paper [45] studied various computational intelligencebased approaches and financial trading frameworks employed for forecasting using ANNs [99], SVMs [100], PSO [14], GA [8], ABC [101] and their impacts.It is found that the swarm intelligent techniques outperform the classical techniques in dynamic optimization problems, which are discrete, continuous, constrained, or multi-objective [102] in nature.The survey as proposed in [45], was performed on multiple stocks from different datasets such as BSE, NASDAQ, S&P 500, and the Shanghai stock market.Furthermore, a careful study of the stock market shows that a group of stocks has a certain common property in terms of the ways they move up and down.These kinds of stocks can be handled by applying an improved setbased PSO (SBPSO) as proposed in [103].The set-based approach uses quadratic programming as a weight optimizer for determining the contribution of the individual assets.The proposed techniques were tested on multiple datasets, such as Hang Seng, DAX 100, FTSE 100, S&P 100, and Nekkei.The experiments conducted in [103] show that although the SBPSO result is comparable to GA, it outperforms GA in terms of speed.Of late, it has been observed that the traditional PSO may lead to a local optimum solution.The article proposed in [104] used a hybrid approach where PSO is combined with SA [105][106], and ANN [107] to reduce the chances of local optimum solution and can be employed to portfolio optimization problems.PSO can also be extended to multi-objective function optimization as proposed in [108] [109].

Quantum-inspired Metaheuristics for Portoflio Optimization
In recent years, a lot of effort has been devoted to the use of hybrid approaches to make portfolio optimization more realistic.It has been discovered that quantum and quantum-inspired computing techniques can be beneficial in solving complex optimization problems [62].Quantum computing [110] uses the principles of quantum mechanics to process information.Unlike classical computing, which represents information as bits, quantum computing uses quantum bits or qubits to represent information.Qubits exist in a superposition of states, which means that the information can be both |0⟩ and |1⟩ simultaneously.Quantum computing [110] is found to perform better than classical computers, especially in problems that involve searching and finding the optimum solution on Algorithm 3 Particle Swarm Optimization Algorithm Initialize S, randomly generate the position x of each particle w.r.t. the bounds x l , x u of the objective function Initialize all velocities u to zero Initialize best positions x * (and respective values) for individual particles and find g * Choose randomly two values in [0,1] for r 1 and r 2 Iteration i = 0 Initialize θ min , θ max large datasets.The representation of quantum states is done through a wave function in the Hilbert space H [111].This space can be thought of as an extension of a two-dimensional or three-dimensional space to one with a finite or infinite number of dimensions.Quantum gates [112] are the building blocks of quantum circuits [113] [114].There are several gates used in quantum computing, including Hadamard gates, Pauli gates, phase gates, and CNOT gates, among others.The choice of gates plays a vital role in the performance of quantum circuits.In this article, the Hadamard gate [115], as mentioned in Equation, 9, has been used due to its simplicity and robustness.

Qubit
Quantum bit or qubit is the smallest unit of quantum information in quantum computing [110] and is represented as |0⟩ and |1⟩.The qubit vectors are also represented using Dirac notation [116] as where, |0⟩ implies that the qubit is in the ground state and |1⟩ implies that the qubit is in the excited state.Qubits possess a remarkable property known as entanglement, which allows the state of one qubit to be linked to the state of another qubit, even when they are separated by a large distance.This property enables parallel computing, making quantum computers much faster than traditional computers.

Quantum Superposition
The quantum superposition principle is the linear combination of quantum vectors represented in two states as [110] |ψ⟩ where, α and β are complex numbers which must satisfy the condition where, α 2 and β 2 are the probabilities of measuring the basis states |0⟩ and |1⟩, respectively.A qubit can be expressed as a combination of two basis states, |0⟩ and |1⟩, which are created using quantum gates (Q-gates).This combination of the states is maintained until a quantum measurement destroys the superposition.Therefore, for n qubits, the number of states in a quantum machine is 2 n [117] [118].

Quantum-inspired techniques for portfolio optimization
Computer scientists often face a challenge in creating advanced, reliable, and faster algorithms for dynamic and complex optimization problems.Evolutionary techniques have been found to be effective in any given problem space.About two decades ago, new optimization techniques based on quantum computing were proposed [118][119] to address search optimization issues.Quantum-inspired metaheuristic algorithms imitate the principles of quantum mechanics and have been demonstrated to outperform classical techniques in solving combinatorial optimization problems [120][121].Due to their capacity to solve complex and large computational problems, these quantum-inspired metaheuristics are widely used in constrained and unconstrained problems [122][62].A survey of quantum-inspired metaheuristics-based techniques is presented in [123].

Quantum-inspired techniques used in this study
Quantum-inspired methods have been found to be more effective than their classical equivalents when tackling issues of large search space and high dimensionality.This approach takes advantage of quantum parallelism and superposition to explore the search space more thoroughly, leading to a more optimal solution.The main features of the implementation include the following.
• Designing a quantum-inspired population: Quantum-inspired techniques use qubits to represent an individual in the population.Each population consists of two weights for each stock taken into account to form the portfolio.The individual weights have been encoded using qubits |0⟩ and |1⟩.Additionally, quantum-inspired crossover and mutation take advantage of quantum mechanical principles to generate entanglement and introduce randomness.• Implementation of Hadamard gates: The selection of weights in the population, crossover, and mutation has been performed using the Hadamard gate, as mentioned in Equation 9. • Implementation of the fitness function: Finally, the fitness function sorts the population considering both states, viz., (i) α, and (ii) β .

Experimental Results and Analysis
This study uses the genetic algorithm, differential evolution, particle swarm optimization, and their quantum-inspired counterparts for comparison.The mentioned techniques have been implemented (coded) in Python on a MacBook Pro with an Apple M2 chip with 8 GB of RAM and a macOS Ventura 13.4.1.Experiments have been conducted on three benchmark datasets, viz.(i) NASDAQ [5] with 2515 data points from 2012-06-28 to 2022-06-27, (ii) Bombay Stock Exchange (BSE) [6] with 2285 data points from 2013-11-05 to 2023-02-13, and (iii) Dow Jones [7] with 3461 data points from 2009-08-06 to 2023-05-05.An effort has been made to consider a better mix of stocks that had positive and negative growths in the selected period.
The average and highest percentage changes of stock are calculated using the following equations: where, APC i and HPC i are the average and highest percentage changes of stock S i , respectively.S n i and S 1 i are the n th , and the 1 st observations of the stock, respectively, and max(S i ) and min(S i ) are the corresponding maximum and minimum observations of the stock in the given period.Table 2 presents the NASDAQ sample data used in this study.The graphical representation of the data, as shown in Fig. 3, shows a mix of stocks that have changed in different proportions over the last 10 years.Table 3 presents the average and highest percentage changes of individual stocks according to Equations 13 and 14, respectively.The Average Percentage Change (APC) and the Highest Price Change (HPC) of the chosen stocks vary from 80.86% to 4546.66% and 180.05% to 11585.16%,respectively, indicating a good diversification of the portfolio.Table 4 presents the BSE sample data used in this study.The graphical representation of the data, as shown in Fig. 4, shows a mix of stocks that have changed in different proportions over the last 10 years.Table 5 presents the average and highest percentage changes of individual stocks according to Equations 13 and 14, respectively.The average percentage change (APC) of the chosen stocks ranges from -66.88% to 361.31%, while the highest price change (HPC) varies from 447.28% to 1496.01%.Table 6 presents the sample data from Dow Jones used in this study.The graphical representation of the data, as shown in Fig. 5, shows a mix of stocks that have changed in different proportions over the last 10 years.Table 7 presents the average and highest percentage changes of individual stocks according to Equations 13 and 14, respectively.The average percentage change (APC) of the chosen stocks ranges from 66.24% to 1182.61%, while the highest price change (HPC) varies from 345.47% to 5933%.An attempt is therefore made to pick those stocks that have experienced significant price fluctuations, with a high and a low in the chosen time frame.

Enhancement Analysis
This study proposes three enhancements, viz., (i) a model to select positive weights, (ii) a regularization function to ensure full utilization of the available funds, as presented in Equation 1, and (iii) random selection of the parameters of the metaheuristics under consideration.A comparative analysis with and without the mentioned enhancements is presented in Tables 8 -11.The results demonstrate that the cal-       ues, and cognitive parameters on the objective function in the selected evolutionary techniques.The input parameters are systematically varied, and the impact on the objective function is studied.Some of the popular methods proposed for conducting sensitivity analysis include: • One at a time [143]: This is one of the simplest forms of sensitivity analysis in which one variable is modified while keeping others constant.The change in the output variable is observed against each change in the input parameter, and the impact of individual parameters is studied.
• Tornado diagram [144]: Also referred to as a tornado chart, it graphically represents the sensitivity of the output parameter to the change in the input parameters.Typically, it ranks the parameters according to their influence on the output parameter.• Monte Carlo simulation [145]: This technique involves a two-step process viz., (i) generation of random values for each input parameter in the defined ranges and (ii) running multiple simulations of the generated input parameter.It provides a probabilistic-based understanding of the impact of the input parameters on the output parameter.• Design of experiment (DOE) [140]: This technique involves varying the input parameters based on a predefined experiment.The impact on the output parameter is studied with the change in the input parameters.
For this study, Monte Carlo simulation [145] and DOE [140] have been used.The impact of individual parameters and second-order correlation is studied and has been presented for the selected evolutionary techniques in both the classical and quantum-inspired domains.A sensitivity analysis has been performed for each of the selected methods, and the best parameter values have been identified for each technique.Figs. 6 -15 present the best results of the sensitivity analysis of the techniques chosen from multiple executions.
(a) Independent variable impact (b) Second order variable relationship Fig. 6: Sensitivity analysis and variable impact in GA with arithmetic crossover

Analysis of Experimental Results
The results of the experiments carried out with GA, DE, and PSO in both the classical and quantum-inspired domains are presented in Tables 13 -18.The optimizers have been executed multiple times with different iteration values of K, where K is (a) Independent variable impact (b) Second order variable relationship Fig. 7: Sensitivity analysis and variable impact in GA with heuristic crossover (a) Independent variable impact (b) Second order variable relationship Fig. 8: Sensitivity analysis and variable impact in QiGA with arithmetic crossover the number of times the optimizers were executed.The performance of the evolutionary techniques is evaluated using statistical measures such as mean square error (MSE), mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE) [146] given by 15) where, X i is the i th observation, X is the mean observation, and N is the number of executions.
The experiments carried out reveal that quantum-inspired particle swarm optimization (QiPSO) is more effective and faster than the other techniques chosen in both the classical and quantum-inspired domains.Furthermore, sensitivity analysis has been conducted to select the appropriate parameter values, which enabled the techniques to converge faster in fewer iterations.
A comprehensive observation based on the experiments conducted is presented in Table 12.It has been observed that QiPSO is a more effective technique than others when it comes to portfolio optimization.Additionally, the quantum-inspired version is dependable and can reach an optimal solution quicker than its classical counterpart without compromising the desired result (minimizing risk).

Statistical Tests
The Friedman chi-square test has been used to compare the mean risk of the evolutionary techniques chosen using the "friedmanchisquare" module from the "scipy.stats"package in Python.The test reveals that the significant level, p-value, is less than 0.0001, allowing us to reject the null hypothesis.Consequently, it can be  Parameter Observation Risk A quantum-inspired approach produces a more optimal risk than its classical counterpart.

Risk
QiPSO has the potential to generate the most optimal risk compared to other selected methods.Error Particle Swarm Optimization (PSO) is found to have the lowest mean square error (MSE), root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE).Therefore, it can be used for portfolio optimization problems.Execution Time Quantum-inspired versions can reach convergence faster than their classical counterparts, often with better results.Convergence Sensitivity analysis can be employed to reduce the amount of time it takes for convergence.(a) Independent variable impact (b) Second order variable relationship Fig. 15: Sensitivity analysis and variable impact in QiPSO concluded that there are significant differences between the groups.

Time Complexity
The time complexity of the genetic algorithm (GA) and differential evolution (DE) depends on factors such as population size (N), number of stocks (S), number of generations (G), and the cost of the fitness function.The overall execution can be broken down into steps, viz., • Initialization: The amount of time needed for initialization depends on the size of the population (N) and the number of stocks (S) taken into account.Thus, the time complexity of initialization can be given as O(N × S). • Fitness Function: This experiment uses a fitness function that sorts the population according to the Sharpe ratio.Thus, the time complexity of the fitness function can be given as O(N × logN).• Selection: The selection process in this experiment performs two operations, viz., (i) sorting the population, and (ii) generating a sample population.The time complexity of the sorting function and the generation of the sample population are given as O(N × logN) and O(N s × S), respectively, where N s is the size of the sample population to be generated and S is the number of stocks considered.• Crossover: The time required to complete this process depends on the size of the subset of the population (N s ) and the number of stocks (S) taken into account.Therefore, the time complexity of the crossover can be expressed as O(N s × S). • Mutation: The mutation perturbs the generation of new children based on the mutation rate.This is done to introduce more diversity into the population.Therefore, the time complexity of mutation can be expressed as O(N m × S), where N m is the size of the sample to be generated and S is the number of stocks considered.Generally, the mutation rates chosen are very small and so is the time complexity.In a practical sense, the time complexity of mutation can be ignored.
The time complexity of a particle swarm optimization (PSO) depends on factors such as population size (N), number of stocks (S), and number of generations (G).
The overall execution can be broken down into steps, viz., • Initialization: The initialization process in PSO is the same as that of GA and DE.Therefore, the time complexity of initialization is given as O(N × S).Based on the time complexity analysis, it is evident that PSO is superior in terms of execution time compared to both GA and DE.PSO is also found to converge faster than both GA and DE.Between GA and DE, it has been observed that DE is more likely to converge faster than GA due to its superior exploration capabilities.

Discussions and Conclusion
This work presents GA, DE, and PSO-based techniques for portfolio optimization problems.The article presents four different enhancements to these techniques, such as (i) dynamic selection of crossover parameters α and β (ii) normalization function to avoid negative allocation caused due to incorrect crossover parameter selection (iii) regularization function for better utilization of allocated funds and (iv) dynamic selection of optimization parameters based on sensitivity analysis and regularization function.Efforts have been made to improve the classical techniques by introducing quantum-inspired versions.Experiments have demonstrated that these quantuminspired versions are faster, and the results are comparable or even better than their classical counterparts.In particular, quantum-inspired PSO outperforms all the techniques chosen.Generally, quantum-inspired techniques have been observed to be faster and often converge to an optimal result.The experiments have been carried out multiple times on three datasets, viz.(i) NASDAQ, (ii) BSE, and (iii) Dow Jones.
To further optimize the selected techniques, the population size and other optimization parameters were chosen based on sensitivity analysis.In the future, the mentioned techniques can be extended to the multiple objective domains to optimize both risk and return on the selected benchmarked datasets.The current experiment has considered the Sharpe ratio as the optimization measure, and

Fig. 11 :Fig. 12 :
Fig. 11: Sensitivity analysis and variable impact in DE with heuristic crossover

•
Fitness function: The fitness function used in PSO is the same as that of GA and DE.Therefore, the time complexity of the fitness function is given as O(N × logN).• Particle movements: In PSO, two types of updates are performed, viz.(i) position update and (ii) velocity update.The time complexity to update both the population and velocity is O(N × S), where N is the number of individuals in the population and S is the number of stocks taken into account.

Table 8 :
Arithmetic crossover results without proposed enhancements

Table 9 :
Arithmetic crossover results with proposed enhancements

Table 10 :
Heuristic crossover results without proposed enhancements

Table 11 :
Heuristic crossover results with proposed enhancements

Table 12 :
Analysis of Results