A Biased-Randomized Iterated Local Search Algorithm for Rich Portfolio Optimization

.


Introduction
Since Markowitz [1], mean-variance optimization has become the workhorse model for portfolio selection.As discussed in [2], Markowitz' s theory of portfolio selection has had a major impact on academic research and on the industry of financial services (Other recent studies on the theory of portfolio selection include [3,4], among many others.Mean-variance portfolio optimization has also provided practical solutions to defined contribution pension schemes [5], hedging mechanisms [6], as well as to long-term fixed-income investments [7]).An important assumption underlying this model is that investors are concerned about both the expected returns from their investment and the risk from that investment, where risk is defined as the variance of future returns.By optimally allocating appropriate weights to imperfectly correlated risky assets, investors can reduce the variance of future portfolio returns and thus diversify their investment.
Because of the non-negativity constraint on the level of investment in each asset, a closed analytical solution is generally not feasible [8], and optimization methods need to be used to determine optimal portfolio weights.Since the mean-variance portfolio formulation, an enormous amount of papers have been published extending or modifying the basic model in three directions [9].The first path goes to simplification of the amount or the type of input data [10].The second path focuses on the introduction of an alternative measure of risk [11].The third path involves incorporation of the additional criteria and constraints [12,13].Traditional optimization methods include, among others, linear programming [14][15][16][17][18][19][20], quadratic programming [21][22][23] and stochastic programming [24].However, traditional optimization methods (notably, linear and quadratic programming) are plagued by a number of caveats.A notable characteristic of these methods is that they work only for problems that rely upon strict theoretical rules, albeit with a limited practical appeal [2].Unfortunately, the complexity of the mean-variance model for portfolio optimization increases dramatically upon adding additional constraints that are needed to provide a rich representation of the investor's portfolio choice, which reduces the efficiency of exact methods in other than small-size instances.More recently, metaheuristic approaches have been proposed in the literature as a way to surpass these limitations [8,[25][26][27][28].
Accordingly, this paper focuses on a single-period version of the so-called constrained mean-variance portfolio optimization problem.We will assume in this work that all assets are risky assets (stocks).However, the solving approach introduced here could be also used for similar optimization problems regarding commodities, futures, options and swaps.Moreover, as in [29,30], our approach can be extended to include risk-free assets.The decision problem involves minimizing the portfolio variance for a given required rate of return.Portfolio weights add up to one and are constrained to take on non-negative values only.The latter assumption rules out short sales and thus places a constraint on excessive risk taking of investors.Under the above assumptions, the unconstrained efficient frontier (UEF) can be determined that gives, for each user-specified expected return, the minimum associated risk of investment.However, more realistic portfolio selection problems may involve additional constraints.First, justified on the grounds of the investor's preference and/or taste, the pre-assignments force some specific assets to be included in the portfolio.Second, the quantity constraint keeps the quantity of each selected asset within user-specified floor and ceiling values.The ceiling rules out excessive exposure to a specific asset.The floor is introduced in order to rule out the possibility of tiny (and therefore disproportionately costly) fractions of assets to be included in the portfolio.Third, the cardinality constraint, which imposes a floor and a ceiling on the number of assets included in the portfolio, accounts for the fact that diversification benefits decrease when the portfolio features a huge number of assets.When the above additional constraints are incorporated in the portfolio optimization problem, the constrained efficient frontier (CEF) can be obtained.In the presence of these rich constraints, the problem becomes NP-hard [31] and, thus, exact optimization methods quickly lose their efficiency as the number of considered assets grows.The cardinality constraint also implies that the mean-variance frontier can become discontinuous for certain values of expected return [32].In summary, as pointed out by [33], the cardinality and quantity constraints make large-size instances of the problem to be computationally intractable using traditional optimization approaches.Because our research involves the CEF, we devise a matheuristic algorithm for rich portfolio optimization (ARPO) that is based on the combination of an iterated local search (ILS) metaheuristic [34,35], quadratic programming, and biased randomization strategies [36][37][38].The contribution of this study is fourfold.First, we show that using a carefully devised matheuristic solver can significantly reduce the minimum running time necessary to obtain near-optimal solutions.Indeed, as it will be discussed later, the computing-time performance of ARPO is significantly better than those of the solvers proposed by [39][40][41].Second, in terms of the minimum average percentage loss, the CEF determined by ARPO is approximately as close (or even closer in most cases) to the unconstrained efficient frontier as in the aforementioned studies.Third, the adoption of an initial solution that is based on a well-chosen criterion makes our solver more flexible when solving tight instances.The rate of return on an individual asset is used as a main criterion to construct the initial solution.It is worth noting that this criterion provides the best possible solution in terms of guarantying feasibility of the required portfolio return -i.e., if this initial solution is not feasible, then the problem has no feasible solution.By contrast, in most of the existing approaches, an initial solution is randomly drawn and, hence, the feasibility of these initial solutions cannot be guaranteed.Fourth and foremost, our paper relaxes the widely held assumption that inputs (individual asset returns, variances and covariances) are accurately measured and deterministic.In this regard, we show that ARPO can be used to solve portfolio optimization problems, in which a number of scenarios comprising uncertain returns, variances and covariances are studied and compared with the CEF-ARPO with accurate inputs.As expected, the CEF-ARPO with uncertain individual asset returns manifests in a higher portfolio variance value for a given required rate of return.By contrast, no added uncertainty to individual asset returns translates into no material change to the CEF-ARPO with accurate inputs when variances and covariances between individual asset returns are subjected to a random disturbance.Finally, we further carry out a stability analysis-involving small variations in cardinality and quantity constraints-that shows no material deviations from the benchmark CEF in terms of the portfolio variance and computational time.
The remainder of this article is organized as follows.Section 2 provides a review of the literature related to the theme, also discussing the limitations of traditional methods and the need for new approaches based on metaheuristics.Section 3 gives a formal description of the optimization problem being considered, while Section 4 provides an overview of the ARPO algorithm, including its pseudo-code for quick implementation.Section 5 introduces the numerical experiments performed to test the algorithm performance, while the results are discussed in Section 6.Finally, Section 7 highlights the main contributions of this work and Section 8 outlines plans for future research.

Need for New Metaheuristic-and Learning-Based Approaches
An updated literature review on the portfolio optimization problem can be found in [2].For this reason, our review focuses on analyzing the limitations of traditional approaches and discussing about the need of new algorithms that consider richer constraints and large-scale instances.
Traditional optimization methods feature a number of theoretical and practical limitations.A notable characteristic of these methods is that they work only for problems that typically rely upon strict deterministic rules.First, they can produce wrong solutions when the portfolio selection problem under consideration has one or more local maxima in addition to a global maximum [8].Second, the optimal solution may be disguised by the presence of estimation errors in expected returns and variances that are used as inputs [2,42].Third, the optimal solution is notoriously unstable, as small changes in inputs can cause large changes in the optimal portfolio weights [43].Fourth, in terms of out-of-sample performance, traditional optimization methods are sometimes no better that the naïve portfolio, wherein all assets are allocated the same weight [44].Along similar lines, reference [45] argues that traditional optimization models can generate accurate in-sample forecasts, but their out-of-sample performance is generally weak.Fifth, a more realistic portfolio selection problem is typically confined to a subset of assets, which are selected by imposing additional constraints.A number of restrictions are specified in an investment management agreement between a client and a portfolio manager [2].The client may impose a limit on the number of assets in the portfolio (cardinality constraints) [46].Further, the client may also ask the manager to invest or not to invest in certain industries or companies.Therefore, the so-called pre-assignment constraints may be used that pre-assign certain industries or assets in the portfolio.The client may further impose a discretionary limit on exposure to certain industries or assets that aims at keeping the quantity of each asset within a given range (quantity constraints).Another battery of constraints is dictated by the presence of transaction costs [2,18].If one or more of these constraints are introduced in portfolio optimization, indeterminacies in the efficient portfolio frontier may arise further limiting the usefulness of traditional optimization methods.
In addition to the above theoretical limitations, traditional optimization methods have received a weak support in practice.Whilst diversification is a dominant portfolio selection strategy that contributes to lowering the risk of portfolio investment, in practice investors invest in fewer assets due to a variety of reasons.First, the administration of large portfolios can be cumbersome [41] or involve transaction costs in the form of bank and broker fees [47].Second, there is evidence that investors' desire to diversify is limited [48][49][50].Third, references [8,22] argue that diversification can be achieved by investing in a small, yet well-chosen sub-set of assets.Similarly, reference [51] assert that, in most practical situations, investing in a portfolio comprising between 10 and 20 individual stocks can reasonably reduce the risk of investment.By the same token, [14] suggests including between 15 and 20 assets to diversify away most diversifiable risk.Reference [52] find that, quite often, the optimal diversification should not use more than 27 assets in real-life investment.Moreover, a smaller number of assets imply less number of parameters to be estimated by using sample information and, therefore, less room for estimation error [44].Reference [42] provides a detailed account of advantages and disadvantages of traditional optimization methods.Specifically, he argues that these methods do not appeal to practitioners, since they do not make investment sense and do not have investment value.Such financial irrelevance is exacerbated by the fact that traditional optimization methods tend to over-weight assets with large returns and small variances and under-weight assets with small returns and large variances [53].However, reference [2] maintain that the presence of theoretical and practical limitations does not invalidate Markowitz's theory of portfolio selection.Rather, traditional optimization methods need to be modified and new methods need to be developed, so that the existing gap between theory and practice can be bridged.
In order to address some of the theoretical and practical limitations of more classical approaches, metaheuristic methods to portfolio optimization have emerged in the literature [8,[25][26][27][28].Metaheuristics emerged from simple heuristics that were proposed to address some of the weaknesses inherited by traditional optimization methods.A heuristic is a common-sense and experience-based solution search method.Reference [14] proposes a simple heuristic based on the beta as a risk measure to solve the portfolio selection problem.Reference [54] builds upon the expected return-variance ratio to develop a heuristic that determines an optimal portfolio location on the efficient frontier.More specifically, they construct a decision rule that determines whether the asset will enter the portfolio and calculates its weight in the portfolio.A simplification to the decision rule in [54] is made by [55].In particular, he derives a heuristic that is based on the expected return-semi-variance ratio that assumes the average correlation between securities to be zero.The use of the semi-variance as a measure of risk owes to the notion that investors are more concerned about downside risk than upside risk.Reference [55] demonstrates that the return-risk heuristic that uses the downside risk measure provides better investment performance than traditional optimization methods for long-term investments, albeit not for short-term ones.A comparison between the return-risk heuristic and two traditional optimization methods is performed by [53].He finds that the return-risk heuristic produces the highest return along with the highest standard deviation and the lowest semi-deviation among the three portfolios.However, heuristics always return a local optimum, which may or may not be global optimum.The use of these simple return-risk heuristics for the constrained portfolio optimization problem has been discontinued in the last two decades.In fact, an increasing number of studies have tended to focus on metaheuristics.Metaheuristic search methods are less restrictive than traditional optimization methods and thus can be tailored to solve a particular optimization problem that features a number of constraints.Metaheuristics have been employed in several studies on portfolio optimization, such as [32,[39][40][41][56][57][58][59] to name just few.However, most of these studies feature the use of random initialization to the portfolio selection problem or simply downplay their strategies of portfolio initialization.Reference [41] are maybe an exception to this rule.In addition to the randomly generated initial solution, these authors propose two simple heuristics.First, they construct the portfolio that produces the maximum possible return, independently of the risk.Second, they use the final solution of the previously computed point on the efficient frontier.The amount of processor time it takes for the local search algorithm to reach the optimal solution on the efficient frontier may be shorter if a sensible simple heuristic is used to construct an initial solution.
Although this paper focuses on the use of metaheuristics to solve rich versions of the portfolio optimization problem, applications of machine learning and deep learning algorithms can be explored as well.These algorithms are becoming increasingly popular in computational finance, particularly for addressing optimization and prediction problems in scenarios characterized either by a high number of features and samples or by a high level of uncertainty and dynamism.Thus, for instance, reference [60] combines a grid trading strategy with machine learning to optimize trading in the Forex Market.Likewise, reference [61] proposes a theoretical framework, based on deep reinforcement learning, for finance portfolio management.Similarly, reference [62] develops and tests a deep learning algorithm to address portfolio management with proportional transactions cost.As discussed in [63], the combination of metaheuristics with machine learning for solving optimization problems with dynamic inputs is also becoming an emergent trend in the optimization literature.

Problem Definition
In this section, the constrained mean-variance portfolio optimization problem is described.Section 3.1 provides an overview of the parameters, variables and constraints used in the problem.Section 3.2 contains the mathematical model, which is based on the one provided in [41].For a comprehensive overview of the formulations of the portfolio selection problem, see [64].Finally, Section 3.3 summarizes the algorithm's inputs and outputs.

Problem Parameters, Variables and Constraints
A set of n assets is given by the market, A = {a 1 , a 2 , . . ., a n }, where: (a) ∀i ∈ {1, 2, . . ., n}, a i has a known expected return, r i ≥ 0; (b) ∀i, j ∈ {1, 2, . . ., n}, the pair (a i , a j ) has a known expected covariance, σ ij = σ ji ≥ 0; (c) a user-provided value, R > 0, represents the minimum expected return from the investment (expected return constraint); (d) a portfolio is a vector X = (x 1 , x 2 , . . ., x n ) such that each x i represents the fraction of the total wealth invested in asset a i , i.e., 0 ≤ x i ≤ 1 and ∑ n i=1 x i = 1; (e) ∀i ∈ {1, 2, . . ., n}, z i = 1 if x i > 0 (i.e., a i in portfolio) and z i = 0 otherwise; (f) the number of assets in the portfolio, ∑ n i=1 z i , is bounded by user-defined values, k min and k max (cardinality constraints); (g) the user can pre-select certain assets to be included in the portfolio, i.e., ∀i ∈ {1, 2, . . ., n}, p i = 1 if a i is pre-assigned (i.e., x i > 0) and p i = 0 otherwise (pre-assignment constraints); and (h) for each asset a i , its associated quantity in the portfolio, x i , is bounded by user-defined values, ε i and δ i (quantity constraints).The typical objective of this problem is to select the optimal combination of fractions of each asset, x i , so that the overall variance (risk) is minimized while satisfying all the aforementioned constraints.

The Mathematical Model
The mathematical model comprises an objective function and a set of constraints: subject to: 0 Equation ( 1) describes the investor's objective function.The investor's objective is to minimize the portfolio variance.Equations ( 1)-( 4) outline the basic ("unconstrained") optimization problem and determine the UEF.Specifically, Equation (2) provides the lower bound for the investor's required return.Equation (3) ensures that portfolio weights add up to unity.The purpose of Equation ( 4) is to regulate leveraged positions.This equation is justified on the grounds of the existing short selling regulations in a wide range of countries [65].A number of realistic situations often require additional constraints that can be summarized by means of Equations ( 5)- (10).By solving the constrained optimization problem given by Equations ( 1)-( 10) the so-called constrained efficient frontier (CEF) is obtained.Equation ( 5) formulates cardinality constraints.Equation ( 6) defines quantity constraints.The quantity of each asset a i is confined to a given range.A minimum quantity of wealth invested in asset a i is given by ε i .A maximum quantity of wealth invested in asset a i is given by δ i .Both parameters ε i and δ i range from 0 to 1 (Equation ( 7)).Note that Equation ( 4) is redundant when Equations ( 6) and ( 7) are considered.Equations ( 8) and ( 9) imply that certain assets are pre-assigned in the portfolio.In particular, given a vector of n binary decision variables Z (Equation ( 10)) (where z i takes on value 1 if included in the portfolio and 0 otherwise), and a binary vector P of pre-assignments (in which p i takes on value 1 if pre-assigned and 0 otherwise), whenever asset a i is pre-assigned, it has to be included in the portfolio (Equation ( 8)).In Equation ( 9), M is a large positive value such that Mx i ≥ 1 for all x i > 0. Thus, if the quantity in the portfolio of asset a i , x i , is equal to 0, it means that this asset is not included in the portfolio (i.e., z i = 0).Only a few papers have considered the use of pre-assignment constraints.An example is [41], who found that the CEF obtained by pre-assigning a high-yield asset strictly dominates the CEF obtained by pre-assigning a low-yield asset.In general, they find an inverse relation between the average percentage loss (with regard to the UEF) and the return value.However, they do not report computing times for the CEF with pre-assignment constraints, which makes impossible to complete a fair comparison with their results.

Algorithm Inputs and Outputs
According to the problem description, the output of the algorithm will be an assets-investment plan (solution), X = (x 1 , x 2 , . . ., x n ), satisfying all the aforementioned constraints and with the lowest possible risk, f (X).Similarly, the inputs of the algorithm are the following ones: (a) for each asset a i ∈ A, the following values: r i , ε i , and δ i ; (b) the matrix of co-variances: {σ ij /i ≤ j}; (c) the user-defined minimum expected return: R > 0; and (d) the boundaries on the number of assets to include: k min and k max .In order to perform a fair comparison with some previous works and existing benchmarks [32,39,40,58,59], in this paper we will not consider pre-selected assets.However, due to its flexibility, the ARPO algorithm could be adapted without too much effort to deal with this constraint too.

The ARPO Metaheuristic
The ARPO matheuristic combines three main components: (a) an ILS framework [34]; (b) the use of a biased randomization process [66,67] that guides the generation of new 'promising' solutions (perturbation stage); and (c) the use of a quadratic programming solver that, given a current portfolio, optimizes the levels of investment of each asset (local search).ILS is a conceptually simple yet powerful metaheuristic that has proven to be very efficient in solving complex combinatorial optimization problems.The underlying idea behind ILS is to narrow the search for candidate local optimal solutions returned by some embedded algorithm, typically a local search heuristic.Reference [68] show that ILS obtains the best average performance among a set of selected metaheuristic approaches in three classical combinatorial optimization problems: bin packing, permutation flow shop, and personnel scheduling.The authors also emphasize two main factors for its success: (i) an excellent balance between exploration and exploitation by "systematically combining a perturbation followed by local search"; and (ii) its relative simplicity and the reduced number of parameters required, factors that facilitate its quick implementation in practical applications.
Algorithm 1 shows the main procedure of the ARPO algorithm.Apart from the inputs defining the instance, also the maximum computing time allowed, maxTime, and an additional parameter, beta, are passed to the procedure-the use of this additional parameter will be discussed later.
The ARPO procedure starts by generating a 'dummy' initial solution (line 01).This initial solution is constructed by including the k min assets with the highest return levels.The weights are determined by maximizing the expected return without violating the quantity constraints.This way, if the expected return provided by this solution does not reach the minimum return threshold imposed by the investor, then the problem will be infeasible since no other solution will do it (lines 02-04).Notice, however, that it is also likely to obtain a high risk associated with this initial solution-hence the name dummy.
At this point, a quick local search (lines 06-07) is applied to this initial solution in order to improve it without losing its feasibility.This local search uses quadratic programming in order to optimize the investment level assigned to each asset (i.e., x i ∀i ∈ {1, . . ., n}) in the current portfolio (solution), given a sub-set of assets (z i ∀i ∈ {1, . . ., n}).The improved solution will be considered both as the current 'base' solution and the 'best-so-far' solution (line 08).Now, the ARPO procedure resumes by starting an iterative improvement process (lines .As in most ILS frameworks, this process comprises three stages: (a) the perturbation stage (lines 12-15), which applies strong changes to the current base solution in order to increase exploration of the space of solutions; (b) the local search stage (lines [16][17][18][19][20][21][22], which tries to perform a quick improvement of the current base solution by applying some operators-in our case, it is based on the combined use of quadratic programming and a cache memory; and (c) the acceptation stage (lines [23][24][25][26][27][28][29][30][31][32][33], which makes use of a credit-based system in order to allow accepting, under certain restrictive conditions, a new base solution even when it offers a slightly higher risk than the current base solution-this 'degradation' of the base solution is allowed in order to reduce the probabilities of getting trapped in a local minimum during the searching process.
As regards as the perturbation stage (Algorithm 2), this follows a destruction-reconstruction process.First, this process takes as an input the current base solution.Second, the current base solution is partially destroyed according to some random criterion-in our case, a randomly selected number of assets are deleted from the portfolio-(lines 01-09).Third, the destroyed solution is re-constructed (completed) by adding new assets to the portfolio (lines [10][11][12][13][14][15][16][17][18][19]. During this re-construction process, the selection of each new asset added to the portfolio is done following a 'friendship' criterion, i.e.: although the selection of the new asset is random, this new asset will be most likely selected among those assets that are highly compatible-i.e., showing a low covariance value-with the last asset added to the portfolio.This special behavior is attained throughout the use of a biased randomization selection process (line 14), which makes use of a geometric distribution of parameter beta (0 < beta < 1).More details on biased randomization processes can be found in [66,67].Finally, there might be times in which the newly generated solution does not fulfill the minimum return requirement.In those cases, a 'repair' stage is used to swap a randomly selected asset in the current portfolio (lines 01-04) by a high-return asset not currently in the portfolio (lines 05-10) (Algorithm 3).
As iterated local search and other similar approaches are stochastic in nature, it is not possible to give a sharp worst case complexity estimate for ARPO.However, experimentally, ILS and other similar approaches are found to perform well [69].In our case, the time spent is bounded by the predefined time limit maxTime.Within the while loop, the search examines an ARPO perturbation, which is Θ(n 3 ).With an efficient random number generator, the other steps are constant or O(n) time.Thus, the total complexity is Θ(n 3 ) per iteration.end if 10: end for 11: end procedure

Numerical Experiments
The ARPO algorithm has been implemented as a Java application.Being an interpreted language, Java-based programs do not execute as fast as other compiled programs, such as those developed in C or C++.Nevertheless, Java permits a rapid, platform-independent, development of object-oriented prototypes that can be used to test the potential of an algorithm.Also, using Java allowed to integrate our code with ojAlgo (http://ojalgo.org),an open-source quadratic programming solver developed in Java.A standard personal computer, Intel Core i5 CPU at 3.2 GHz and 4 GB RAM with Linux Ubuntu, was used to perform all tests.
In this research, we experiment with stock market data already used in previous studies.It was retrieved from the repository ORlib, and it can be downloaded from the following website: http: //people.brunel.ac.uk/~mastjjb/jeb/orlib/portinfo.html.These instances were proposed by [32] and were studied by [39][40][41]58,59].The data set comprises constituents of five stock market indices, Hang Seng (Hong Kong), DAX 100 (Germany), FTSE 100 (United Kingdom), S&P 100 (United States) and NIKKEI 225 (Japan).These indices were extracted from DataStream and are measured at weekly frequency spanning the period from March 1992 to September 1997.
Following [41] we divided the portfolio frontier into 100 equidistant points on the vertical axis that represents the user-defined rate of expected portfolio return.Although the algorithm has been designed for the constrained case, it is initially tested on the unconstrained mean-variance optimization problem.The test results show that our solver is able to return solutions that are overlapping with the unconstrained efficient frontier (UEF) published at the OR Library, which contributes to validate the effectiveness of our approach.
Next, we execute the algorithm on a constrained mean-variance frontier (the algorithm is executed 30 times and both the best and average results are recorded).The maximum time of execution for each instance is 20 s.The benchmark constraints are those imposed by the previous authors.Essentially, the constraints involve the following conditions: As in the aforementioned studies, pre-assignment constraints are not considered in these experiments, i.e., p i = 0, ∀i ∈ {1, 2, . . ., n}.Notice that, despite other authors claim that their approaches can solve the constrained problem with all the aforementioned constraints, this fact is not clearly showed neither in the description of their methods nor in the benchmarks they solve, since the parameter values they use in their benchmarks do not seem to impose a real challenge for their algorithms in terms of tight constraints.

CEF-ARPO with Certain Inputs
We evaluate the quality of our ARPO algorithm by means of the so called average percentage loss (APL).APL can be defined as follows.Let R h be the minimum required rate of return, and V CEF (R h ) and V UEF (R h ) ( ∀h ∈ {1, 2, . . ., H}, where h denotes a point of the frontier, and H denotes the number of points on the frontier) the values of f (x) evaluated in the solutions to the constrained and unconstrained optimization problem, henceforth CEF and UEF, respectively.The latter is provided in ORlib, whereas the former is returned by ARPO.Then, APL = 100 . Table 1 shows the values of APL and associated computational times.Notice that, in terms of the minimum APL, our ARPO algorithm outperforms on Instances 2-5 the hybrid solvers proposed by [41], which comprise combinations of first descent and steepest descent with quadratic programming (FD + QP and SD + QP, respectively).With regard to the first instance, our APL is greater, but this result may emanate from rounding errors.In terms of computational time, ARPO shows a superior performance relative to that of the solver's SD + QP and is comparable or better than the solver's FP + QP performance.We next contrast our results with the results reported by [39,40].Although the minimum APL provided by ARPO is slightly superior to the hybrid solver combining a genetic algorithm (GA) and quadratic programming (QP) in [40], on the remaining instances the minimum APL accomplished by ARPO is lower.Furthermore, our computational times are considerably lower than those reported by the tabu search (TS) in [39], and by GA + QP in [40].
The UEF (as provided in the ORlib) and CEF (as provided by ARPO) for the five stock market indices are compared in Panels A-E of Figure 1.  1 summarizes the results of ARPO for the CEF, including the minimum average percentage loss (APL) and computational time in seconds (T(s)).APL is calculated as in [41].We also report the standard deviation of computational time for ARPO.The performance indicators of ARPO are also compared against its competitors, including [39][40][41].
Table 1 presents the results of ARPO for the CEF.Table 2 presents the UEF and the CEF-ARPO for the Hang Seng portfolio for 10 initial points and 10 last values of returns.Panel A of Figure 1 depicts the CEF for the Hang Seng (Hong Kong) stock market.A visual inspection suggests that for the Hang Seng stock index the CEF is hardly distinguishable from the UEF.However, as the rate of expected return increases, along with increasing risk of investment, the CEF tends to diverge relatively less from the UEF.In particular, at the higher end of the CEF that features rewarding but risky portfolios, the expected rate of return can be attained with fewer assets.
Panel B of Figure 1 depicts the CEF for the DAX 100 (Germany) stock market.Visual inspection indicates that for the DAX 100 stock index the CEF diverges from the UEF at the lower end of expected return, more specifically, for R < 0.006.As the rate of expected return increases, the CEF becomes indistinguishable from the UEF.Notably, portfolios with an expected return at the lower end of the CEF tend to be riskier (i.e., with higher portfolio variance) than portfolios on the UEF.Notes: Table 5 summarizes the UEF and the CEF-ARPO for the S&P 100 portfolio for 10 initial points and 10 last values of returns.In column 2, values of the required rate of return are provided.In column 3, values of the UEF solution (portfolio variance) are provided.In column 4, values of the CEF-ARPO solution (portfolio variance) are provided.In column 5, values of the minimum average percentage loss are reported.In column 6, computational times are reported.
Table 6 presents the UEF and the CEF-ARPO for the NIKKEI 225 portfolio for 10 initial points and 10 last values of returns.Panel C of Figure 1 depicts the CEF for the FTSE 100 (United Kingdom) stock market.It indicates that for the FTSE 100 stock index -similarly to the DAX 100 stock index-the CEF departs from the UEF at the lower end of expected return.As the rate of expected return increases, the CEF converges to the UEF.Noteworthy, portfolios featuring an expected return at the lower end of the CEF tend to be riskier (i.e., with higher portfolio variance) than portfolios on the UEF.At the higher end of the CEF that features rewarding but risky portfolios, the expected rate of return can be achieved with fewer assets.
Panel D of Figure 1 depicts the CEF for the S&P 100 (United States) stock market.It indicates that for the S&P 100 stock index -as with the DAX 100 and FTSE 100 stock indices-the CEF departs from the UEF at the lower end of expected return.As the rate of expected return increases, the CEF becomes visually indistinguishable from the UEF.Portfolio investments with an expected return at the lower end of the CEF involve relatively more risk than portfolios with the same expected return located on the UEF.
Finally, Panel E of Figure 1 depicts the CEF for the NIKKEI (United States) stock market.It indicates that for the NIKKEI stock index, the relation between the CEF and the UEF follows a pattern similar to the Hang Seng stock index.Specifically, although the CEF departs from the UEF at the lower end of expected return, the difference is visually very small.As the rate of expected return increases, the CEF gradually approaches the UEF.At the higher end of the CEF that includes portfolios with high expected return and high risk, the APL approaches to zero.
To evaluate differences between the UEF and the CEF-ARPO, we also provide the portfolio weights for Instance 3 (FTSE 100), where the required rate of return is 0.0041572635, which is an approximately central value within the overall of returns.This instance was executed twice with the same seed, where the maximum time of execution was 20 s.The UEF considered all assets with weights ranging from 0 to 1 inclusively.The CEF was constrained to the minimum of 1 and the maximum of 10 assets, with portfolio weights ranging from 0.01 to 1.The minimum values of the portfolio variance were 2.3872556507357437E-4 (the UEF) and 2.5098945345432527E-4 (CEF-ARPO).The percentage loss is 5.137%.The UEF selected 26 assets (the remaining assets were allocated zero weight), whereas the CEF portfolio selected 10 assets, the upper bound of the cardinality constraint.The 10 assets are the subset of assets selected in the UEF portfolio, where assets indexed with 61, 36 and 52 carry the largest weight in the CEF portfolio.
Figure 2 presents portfolio weights.The horizontal axis indexes assets, whereas the vertical axis measures the weight of an asset.

CEF-ARPO with Uncertain Inputs
Key to our research is a widely held assumption-in line with most of the existing literature-that the returns vector and the variance and covariance matrix are well-know and deterministic; i.e., they are known with certainty.Whilst this assumption is analytically and computationally convenient, its practical appeal may be limited.In order to account for this practical restraint, and to test if our algorithm is robust to small changes in the returns vector and the variance-covariance matrix, we use the data set of Hang Seng stock market to perform computational experiments that involve some degree of uncertainty in the first and second moments.We consider three different scenarios.In Scenario 1 (S1), a random disturbance term distributed with a normal distribution with mean 0 and standard deviation 0.00015 is added to each return of the original instance.Under this scenario, an original return of 0.00350406 (which is the mean return of the instance) now takes on values within the interval of 0.00350406 ±2•0.00015=(0.00320406,0.00380406)with the probability of 95.45%, which can be deemed a realistic interval.In Scenario 2 (S2), a random disturbance term distributed with a normal distribution with mean 0 and standard deviation 0.000025 is added to each element of the covariance matrix.Under this scenario, the original covariance of 0.00113094 now takes on values within the interval of (0.00108094,0.00118094) with the probability of 95.45%.In Scenario 3 (S3), Scenarios 1 and 2 are jointly simulated.The results are compared against Scenario 0 (S0), which depicts the CEF-ARPO with k min = 1, k max = 10, and portfolio weights confined between 0.01 and 1.
Table 7 reports the portfolio variance and the APL loss relative to S0 of the three scenarios, for 10 initial and 10 last portfolio returns on the CEF-ARPO.Table 8 summarizes the results of ARPO for different scenarios generated from Instance 1 (Hang Seng), in which problem cardinality constrains are modified.The average APLs for the three scenarios are 3.324%, −0.109% and 3.274%, respectively (See also Table 9, where the average APL, average computational times and the number of infeasible rates of return are summarized).Thus our algorithm delivers a reasonable-quality solution also in an environment that allows for inaccurate inputs.However, these results should be interpreted with caution.Importantly, it should be recognized that S1-S3 amount to different optimization problems.A relative larger APL for S1 may imply that it is more costly-in terms of the portfolio variance-to attain a given portfolio return when individual asset returns are randomized than when they are not.The induced random variation in individual asset returns effectively boosts the corresponding elements of the variance and covariance matrix.This leads to a larger overall portfolio variance for a given portfolio return.As a result, portfolios on the higher end of the efficient frontier become more costly and even infeasible (See also Table 9).In S2, where individual variances and covariances are randomized, the resulting CEF-ARPO remains very similar to the CEF-ARPO, as manifested by the average APL.Indeed, in contrast to S1, adding a normally distributed random disturbance term to variances and covariances between individual assets does not appear to alter the optimal solution.For portfolio on the lower end of the efficient frontier, the APL takes on low positive values; however, for more rewarding and riskier portfolios with feasible returns, the solution is better than for the CEF-ARPO, suggesting further diversification opportunities for investors in high-yield portfolios.Finally, S3 shows combined effects of S1 and S2.Next, we carry out a stability analysis of the ARPO algorithm to ratify our main findings.The stability analysis consists of six scenarios (numbered successively) as follows, which are evaluated against S0.Observe that in Scenarios S4-S9 the vector of asset returns and the variance and covariance matrix are calculated from historical data and, in contrast to Scenarios S1-S3, do not involve any random inputs.Table 10 presents the calculated CEF-ARPO variances and APLs for Scenarios S4-S6.The calculations show that increasing the lower bound of the cardinality constraint does not have any effect on APLs or computational times.The APL is always 0 irrespectively of the CEF-ARPO position, including the higher end of the CEF.Similarly, decreasing the number of assets from 10 to 9 under S5 poses no significant challenge to portfolio diversification, since the resulting APLs-mainly at the lower end of the CEF-are very low.Scenario S6 that combines the two preceding scenarios shows some insignificant departures from S0, essentially due to the lower maximum number of assets that can be included in a portfolio.
Finally, Scenarios S7-S9 show that small variations in the minimum and maximum quantities are followed by similarly unimportant changes in the CEF.Indeed, an increase in the minimum weight attributed to each asset leads to the average APL of 0.013% (S7 and S9) relative to the optimal solution under S0 (see also Table 9).However, a decrease in the maximum weight does not appear to alter the optimal solution.All in all, additional computational experiments indicate that the ARPO algorithm shows a reasonable level of stability when dealing with constrained portfolio optimization problems.Notes: Table 9 shows the average APL (column 2), the number of non feasible portfolios (column 3), and the average computational times (column 4) obtained for 9 different scenarios on Instance 1 (Hang Seng).Notes: Table 10 summarizes the results of ARPO for different scenarios generated from Instance 1 (Hang Seng), in which problem quantity constrains are modified.SX represents the scenario number X, where S0 is the benchmark scenario.

Conclusions
In this paper we propose the ARPO algorithm to solve the constrained mean-variance optimization problem.The specific constraints we use include the cardinality and quantity constraints.The ensuing complexity of the problem rules out closed-form solutions and conventional optimization methods.Specifically, the cardinality and quantity constraints render the problem computationally expensive to solve large-scale instances.Therefore, the use of metaheuristics-that handle such problems more flexibly and efficiently-is needed.The ARPO algorithm first generates an initial feasible solution.Then, this solution is iteratively improved using an iterated local search process which combines quadratic programming with a cache of previously computed solutions.The quality of the best-found solution is evaluated using the average percentage loss relative to the unconstrained efficient frontier.
According to the computational experiments, our solver outperforms-in terms of average percentage loss-most of the recent state-of-art approaches used in the literature, which tend to be more complex and difficult to implement in practical applications.In addition, the running time for our solver is notably shorter than the solvers used in other recent studies.

Future Work
In future research, tighter cardinality and quantity constraints should be considered, as well as the pre-assignment constraint.Mean-variance portfolio optimization provides a natural laboratory for testing the performance of ARPO.While this algorithm is tested on the five benchmark indices, an unexhausted list application could potentially include other periods, different countries, regions, sectors and asset classes.Moreover, the practical appeal of ARPO is not limited to portfolio optimization, but rather could be extended to other optimization problem comprising, for instance, asset and liability management of companies.Likewise, it can be conveniently applied to construct a portfolio of international investments and to study whether ARPO can alleviate the widely documented "home bias" phenomenon.
Investment portfolio formulation with variance as a risk measure is just one option.It is possible to extend presented research using multi-criteria investing portfolio models [17,23] with the use of value-at-risk (VaR) and conditional value-at-risk (CVaR) or multi-objective supply portfolio models [70,71] with VaR and CVaR or with differently formulated risk measures [72].In all these cases a novel contribution to this issue would consist in a comparison between exact methods and ARPO-like metaheuristics.
One important shortcoming in the literature of mean-variance portfolio optimization is that the models typically rely upon expected returns and variance data, instead of considering the return as a real random variable.A novel contribution to this issue would consist of adding stochastic elements to the problem formulation, so that it includes random effects.Related to this, it would be possible to consider hierarchical statistical inference to handle uncertainty and then to employ high-dimensional data mining algorithms such as the one proposed in [73].

Figure 1 .
Figure 1.UEF and CEF-ARPO.(a) Panel A-Hang Seng Stock Market (Hong Kong); (b) Panel B-DAX 100 Stock Market (Germany); (c) Panel C-FTSE 100 Stock Market (UK); (d) Panel D-S&P 100 Stock Market (US); (e) Panel E-NIKKEI Stock Market (Japan).Notes: Figure 1 illustrates the UEF and the CEF-ARPO for the five instances (Panel A-Hang Seng, Panel B-DAX 100, Panel C-FTSE 100, Panel D-S&P 100 and Panel E-NIKKEI 225).The UEF is represented with a black solid line, whereas the CEF-ARPO is represented with a dash red line.Portfolio variance is depicted on the horizontal axis, whereas the required rate of return is depicted on the vertical axis.The minimum average percentage loss is 0.00399% for the Hang Seng portfolio, 2.45403% for the DAX 100 portfolio, 1.88340% for the FTSE100 portfolio, 4.65095% for the S&P 100 portfolio and 0.20189% for the NIKKEI 225 portfolio.

Algorithm 1
Main procedure of the ARPO algorithm (ILS framework).

Table 1 .
Summary of Results.
Notes: Table2summarizes the UEF and the CEF-ARPO for the Hang Seng portfolio for 10 initial points and 10 last values of returns.In column 2, values of the required rate of return are provided.In column 3, values of the UEF solution (portfolio variance) are provided.In column 4, values of the CEF-ARPO solution (portfolio variance) are provided.In column 5, values of the minimum average percentage loss are reported.In column 6, computational times are reported.

Table 3
presents the UEF and the CEF-ARPO for the DAX 100 portfolio for 10 initial points and 10 last values of returns.
Notes: Table3summarizes the UEF and the CEF-ARPO for the DAX 100 portfolio for 10 initial points and 10 last values of returns.In column 2, values of the required rate of return are provided.In column 3, values of the UEF solution (portfolio variance) are provided.In column 4, values of the CEF-ARPO solution (portfolio variance) are provided.In column 5, values of the minimum average percentage loss are reported.In column 6, computational times are reported.

Table 4
presents the UEF and the CEF-ARPO for the FTSE 100 portfolio for 10 initial points and 10 last values of returns.
Notes: Table4summarizes the UEF and the CEF-ARPO for the FTSE 100 portfolio for 10 initial points and 10 last values of returns.In column 2, values of the required rate of return are provided.In column 3, values of the UEF solution (portfolio variance) are provided.In column 4, values of the CEF-ARPO solution (portfolio variance) are provided.In column 5, values of the minimum average percentage loss are reported.In column 6, computational times are reported.

Table 5
presents the UEF and the CEF-ARPO for the S&P 100 portfolio for 10 initial points and 10 last values of returns.
Notes: Table6summarizes the UEF and the CEF-ARPO for the NIKKEI 225 portfolio for 10 initial points and 10 last values of returns.In column 2, values of the required rate of return are provided.In column 3, values of the UEF solution (portfolio variance) are provided.In column 4, values of the CEF-ARPO solution (portfolio variance) are provided.In column 5, values of the minimum average percentage loss are reported.In column 6, computational times are reported.

Table 7 .
Comparison of results for different scenarios based on Instance 1 (Hang Seng) varying the returns and the covariance matrix.
Notes: Table7summarizes the results of ARPO for different scenarios generated from Instance 1 (Hang Seng), in which the returns and the variance-covariance matrix are randomized.SX represents the scenario number X, where S0 is the benchmark scenario.NF indicates non-feasible portfolios.

Table 8 .
Comparison of results for different scenarios based on Instance 1 (Hang Seng) varying problem cardinality constraints.Scenario 4 (S4): the minimum number of assets in the portfolio is increased from 1 to 2.• Scenario 5 (S5): the maximum number of assets in the portfolio is decreased from 10 to 9.
Notes: Table8summarizes the results of ARPO for different scenarios generated from Instance 1 (Hang Seng), in which problem cardinality constrains are modified.SX represents the scenario number X, where S0 is the benchmark scenario.•

Table 10 .
Comparison of results for different scenarios based on Instance 1 (Hang Seng) varying problem quantity constraints.