A BIASED RANDOM-KEY GENETIC ALGORITHM FOR THE CHORDAL COMPLETION PROBLEM

. A graph is chordal if all its cycles of length greater than or equal to four contain a chord, i


Problem description
Let  = (, ) be a simple graph defined by a vertex set  and an edge set  ⊆  ×  . () defines the vertex set of .() defines the edge set of .A walk in  is a sequence of vertices where any two consecutive vertices are adjacent, i.e., share a common edge in .A path is a walk where each vertex occurs exactly once.A cycle  in  consists of a sequence of vertices  1 ,  2 , . . .,   that form a path, where  1 and   (i.e., the first and last vertices of the sequence) are also adjacent.In this case, () = {( 1 ,  2 ), ( 2 ,  3 ), . . ., ( −1 ,   ), (  ,  1 )} is the edge set of the cycle .A chord of a cycle  is any edge  ∈  ∖ () that connects two vertices of .An induced (or chordless) cycle in a graph  is a cycle without chords.
A graph  is chordal when all its induced cycles have exactly three vertices, i.e., every cycle of length greater than or equal to four of  has at least one chord.The class of chordal graphs is one of the most studied graph classes in algorithmic graph theory, with practical applications in fields such as computer vision [16].A triangulation (or chordal completion) of the graph  = (, ) is a set  ′ ⊆  ×  such that the graph  ′ = (,  ∪  ′ ) is chordal.Figure 1 shows an example.Figure 1(a) illustrates the original graph . Figure 1(b) displays a minimal triangulation with two edges (1,3) and (4,5).Figure 1(c) shows a minimum triangulation formed by the edge (1,3) that makes the original graph chordal.Finally, Figure 1(d) shows a triangulation formed by three edges (2,5), (2,4), and (4,5) that also make  chordal but not is minimal.
The chordal completion problem (CCP) (also known as the minimum fill-in problem) consists in finding the minimum cardinality set of edges to be added to a simple graph to make it chordal.In other words, given a graph  = (, ) and denoting by   the family of chordal graphs  ′ such that  () =  ( ′ ) and () ⊆ ( ′ ), the chordal completion problem problem consists in determining min or, alternatively, min CCP is a classical combinatorial optimization problem.It has many applications, e.g., in optimizing Gaussian elimination on sparse symmetric matrices [27], computational phylogenetics [12], database management [4], sparse matrix computation [26], artificial intelligence [33], semidefinite and nonlinear optimization (in particular for exploiting the sparsity of linear and nonlinear constraint matrices [30,37,48]), and in several other contexts; see the survey in [29].It was one of the open problems in the first edition of Garey and Johnson's monograph [23] on NP-completeness [28] and was proved to be NP-hard in [49].

Related work
In [3], it was described an integer programming formulation for CCP.Most of the work in the literature has focused on classes of graphs for which polynomial-time algorithms exist [5,11,14,31].From the point of view of parameterized complexity, CCP is fixed-parameter tractable when parameterized by the number  of edges that need to be added to make the input graph chordal [13].The fastest parameterized algorithm for this parameter has a subexponential running time of 2 () + ( 2 ) [20].The problem also admits a polynomial kernel with respect to this parameter and the current best bound on the kernel size is ( 2 ) [38].The best exact algorithms for CCP are dynamic programming algorithms based on manipulating potential maximal cliques graph [7,20,21].
In [29], it was noticed that the best constructive heuristics for CCP are algorithms based on ordering the vertices by some criterion.Two constructive heuristics using this idea are described in detail in Section 2.
The competition track B of the 2017 Parameterized Algorithms and Computational Experiments Challenge (PACE 2017, see [17]) addressed exact algorithms for CCP.A benchmark set of 200 test instances was proposed for the problem in this challenge.These instances will be used in the computational experiments with the biased random-key genetic algorithm (BRKGA) proposed in this work for CCP.

Our contributions and organization of this work
In this work, we propose a BRKGA for solving CCP.The computational experiments reported in Section 6 show that our approach outperforms the constructive heuristics in the literature and achieves competitive results when compared to the exact algorithms evaluated in the PACE 2017 challenge.To the best of our knowledge, the BRKGA algorithm developed in this work is the first metaheuristic for CCP.
The remainder of this article is organized as follows.In Section 2, we present some preliminaries and describe constructive heuristics for CCP.Section 3 gives a general description of biased random-key genetic algorithms and presents their customization to CCP.Section 4 describes the decoder of the BRKGA.Section 5 presents the algorithm developed to inject good initial solutions built by the constructive solutions coded as random keys in the initial population of the BRKGA.Computational results are presented in Section 6. Concluding remarks are drawn in the last section.

Preliminaries and constructive heuristics
This section presents some preliminaries in Section 2.1, with notations and definitions necessary to understand the heuristics described in Section 2.2.

Preliminaries
Given a graph  = (, ), with | | = , a vertex  ∈  () is a simplicial if its neighborhood (i.e., the subset of vertices of  adjacent to ) induces a clique in .In 1961, Dirac [18] proved that any chordal graph is complete or has at least two non-adjacent simplicial vertices.In 1965, Fulkerson and Gross [22] used this result to develop a polynomial-time algorithm for recognizing chordal graphs.Their algorithm finds and removes simplicial vertices of the input graph until they are all removed.If the resulting graph is empty, the input graph is chordal; otherwise, it is not.Note that whenever the input graph is chordal, the algorithm finds a sequence of simplicial vertices in each intermediary graph.
A permutation  =  1 ,  2 , . . .,   of the vertices of graph  is a perfect elimination ordering if, for every  = 1, 2, . . ., ,   is a simplicial vertex of the subgraph [] induced in  by , where  = {  , . . .,   }.Considering Dirac's characterization of chordal graphs, a graph is chordal if and only if it admits a perfect elimination ordering of its vertex set.The algorithm of Fulkerson and Gross [22] guarantees that the input graph  is chordal if and only if it finds a perfect elimination ordering of .
According to the strategy established by Fulkerson and Gross [22], the following process based on perfect elimination orderings can transform any graph  into a chordal one by edge additions.First, create a copy of  and name it  ′ .Then, successively select at random a vertex  of the current graph  ′ , add edges to  ′ until the neighborhood of  becomes a clique (i.e., vertex  becomes simplicial), and remove  from the current graph  ′ .When  ′ becomes an empty graph, the set  ′ of edges added during this process is a chordal completion of , and the permutation associated with the order of the vertex removals is a perfect elimination ordering of the chordal graph  * obtained from  by adding the edges in  ′ .The following result holds: Remark 1.Given a permutation  of the vertices of , there is a unique supergraph   of  such that: (1)  () =  (  ); (2) () ⊆ (  ); (3)  is a perfect elimination ordering of   (thus,   is chordal); and (4) (  ) is an inclusion-wise minimal set of edges satisfying (2) and (3) above.

Constructive heuristics
Let (  ) ∖ () be the minimal chordal completion of  associated with permutation .The vertex selection order described in Section 2.1 generates a perfect elimination ordering , and the minimal chordal completion of  according to  coincides precisely with the set of edges arising from such a process.Algorithm 1 describes a framework for implementing this process, which takes the graph  as input.Line 1 creates a copy  ′ of the input graph.Line 2 initializes the empty ordered list  that will store the permutation generated by the algorithm, i.e., a perfect elimination ordering of the supergraph   of .Line 3 initializes an empty edge set  ′ that will be added to  ′ , forming a chordal completion of .The loop from lines 4 to 14 successively removes vertices from  ′ until  ( ′ ) becomes empty.Each loop iteration starts in line 5 by selecting a vertex  ∈  ( ′ ) following some specific criterion.Line 6 inserts vertex  in the queue .The loop from lines 7 to 12 iterates over all pairs of nodes ,  ∈  ( ′ ) adjacent to  in  ′ .Line 8 checks if there is an edge  in  ′ .If it does not exist, edge  is added to  ′ in line 9. Otherwise, edge  is added to  ′ in line 10.Line vertex  is removed from  ′ in line 13.The algorithm returns the edge set  ′ and the permutation  in line 15.
Require:  = (, ) Select a vertex  from ( ′ ) using some specific criterion Insert  in the end of  Remove vertex  from  ′ 13: end while 14: return  ′ ,  One can see CCP as finding a vertex permutation (i.e., a perfect elimination ordering)  such that the chordal graph   obtained by the chordal completion of  defined  has the minimum number of edges.
The classical constructive heuristics in the literature [29] differ by the criterion applied in line 5 of each iteration of the Algorithm 1 to select the next vertex that will be added to the permutation : -Heuristic min-degree: select the vertex with minimum degree.
-Heuristic fill-in: let the neighborhood N  () of vertex  be the set of vertices adjacent to it in .Let A  the subset of edges of  whose extremities belong to N  ().Denote by the number of edges that must be added between non-connected vertices of N  () so that this neighborhood becomes a clique.Next, select the vertex given by argmin ∈ () ℱ  , which is the one whose neighborhood is the closest to being a clique.Figure 3(a) shows that the chordal completion obtained problem by the fill-in heuristic for the graph in Figure 2(a) has three edges, although the optimal solution has only two edges, as shown in Figure 3(b).
Other constructive heuristics based on perfect elimination orderings appeared in [4,36,43].The following section presents a BRKGA for CCP, whose decoder is based on the min-degree and fill-in heuristics.

Biased random-key genetic algorithms for chordal completion
Genetic algorithms with random keys, or random-key genetic algorithms (denoted by RKGA), were first introduced in [2] for combinatorial optimization problems whose solutions may be represented by permutation vectors.Solutions are represented as randomly generated vectors of real numbers in the interval [0, 1) called keys.A deterministic algorithm (a decoder) takes a vector of random keys as input and associates a feasible solution to the combinatorial optimization problem at hand, for which an objective value or fitness can be computed.Two parents are selected randomly from the entire population to implement the crossover operation in an RKGA.Parents can be selected for mating more than once in the same generation.
A BRKGA differs from an RKGA in how parents are selected for a crossover; see [24] for a review.In a BRKGA, each element is generated by combining one selected randomly from the current population's elite solutions while the other is a non-elite solution.The selection is said to be biased because one parent is always an elite solution and has a higher probability of passing its genes to the new generation.
We used the parameterized uniform crossover scheme proposed in [46] to combine two parent solutions and to produce offspring.The offspring inherits each of its keys from the best fit of the two parents with a higher probability.The BRKGA developed in this work does not make use of the standard mutation operator, where parts of the chromosomes are changed with a small probability.Instead, the concept of mutants is used: mutant solutions are introduced in the population in each generation, randomly generated in the same way as in the initial population.Mutants play the same role of the mutation operator in traditional genetic algorithms, diversifying the search and helping the procedure to escape from locally optimal solutions [8,9,41].
The keys in the chromosome are generated randomly in the initial population.Each generation's population is partitioned into two sets: TOP and REST .The size of the population is |TOP | + |REST |.Subset TOP contains the best solutions in the population.Subset REST is formed by two disjoint subsets: MID and BOT , with subset BOT formed by the worst elements in the current population.As illustrated in Figure 4, the chromosomes in TOP are copied simply to the next generation's population.The elements in BOT are replaced by newly created mutants placed in the new set BOT .The remaining elements of the new population are obtained by crossover, with one parent chosen randomly from TOP and the other from REST .This process distinguishes a BRKGA from the RKGA in [2], where both parents are selected randomly from the entire population.Since a parent solution can be chosen for crossover more than once in a given generation, elite solutions have a higher probability of passing their random keys to the next generation.In this way, |MID| = |REST | − |BOT | offspring solutions are created.

Decoder for chordal completion
Implementing our BRKGA for CCP used the C++ library brkgaAPI framework developed in [47].The instantiation of the framework shown in Figure 5 to some specific optimization problem requires exclusively the development of a class implementing the decoder for this problem.This component is the only problemdependent part of the tool.Other applications of this framework in implementing BRKGAs can be seen, e.g., in [1, 8-10, 15, 25, 40].
Algorithm 2 shows the decoder for CCP.It takes the graph  and the vector of random keys  associated with the vertices of  as input.The edges that will be added to the graph (i.e., a chordal completion) are initialized with  ′ = ∅ in line 1.A copy  ′ of the graph  is created in line 2. Line 3 creates a candidate list formed by all vertices yet to be eliminated from the graph  ′ .The outer loop in lines 4-14 is performed until  ( ′ ) is not empty.Each iteration of this loop starts in line 5.The unselected vertex in  ′ with the smallest random key is saved in .The inner loop in lines 6-11 iterates over all pairs of neighbors  and  of vertex  in the current graph  ′ .Line 7 checks whether vertices  and  are adjacent in  ′ .If they are not, then edge  is added to the current graph  ′ in line 8. Line 9 adds edge  to the chordal completion under construction  ′ .Therefore, after completing the loop in lines 6-11, the neighborhood of  in  ′ is transformed into a clique.In line 12, vertex  is removed from  ′ and a new iteration of the outer loop starts, Line 14 returns the chordal completion corresponding to set  ′ .

Injecting high-quality solutions into the initial population
Computational results reported in the literature show that genetic algorithms may benefit from the quality of the solutions in the initial population, provided that enough diversity is warranted.For example, high-quality Algorithm 2. Decoder.
Require:  = (, ),  for all pairs ,  of neighbors of  in  ′ do 7: if  and  are not adjacent in  ′ then 8: Add an edge between  and  in  ′

9:
′ ←  ′ ∪ {} Remove vertex  and the edges adjacents to it from  ′ 13: ←  ∖ {} 14: end while 15: return  ′ initial solutions can be explored using a greedy randomized algorithm to create the initial population instead of generating completely random solutions.Another alternative is injecting a few high-quality solutions obtained by specific construction procedures into the initial random population.These strategies have yet to be used in the context of BRKGAs.
This section shows how this idea can be implemented and explored in the context of a BRKGA for CCP.We describe how a permutation vector generated by any constructive heuristic can be coded by random keys and injected into the initial population of the BRKGA.
Algorithm 3 shows the procedure to generate a vector of random keys representing the chordal completion associated with some permutation vector  taken as input.The loop in lines 1-2 initializes the vector of random keys (1), . . ., ( ()) that will be associated with the vertices of .In line 4, the elements of vector  are sorted in ascending order.The loop in lines 5-8 visits the vertices of the permutation vector  from first to last.Line 6 picks the vertex  in position  of the permutation vector , and line 7 sets the th smallest random key to vertices  of .Finally, in line 9, the vector of random keys  associated with the permutation  is returned.
Algorithm 3. Creation of the vector of random-keys  associated with a permutation vector .Randomly generate () ∈ [0, 1) 3: end for 4: Sort  in ascending order.Let  the vertex in position  of the permutation vector
The numerical results in Section 6.3 illustrate how the constructive heuristics min-degree and fill-in can be combined with Algorithm 3 to generate high-quality solutions that can be injected in the initial population of the BRKGA and how they contribute to improving the quality of the best solutions found.

Computational experiments
In this section, we evaluate the effectiveness of a BRKGA heuristic for CCP.The computational experiments were performed on an Intel Core i7-4770 CPU with a 3.40 GHz clock and 16 GB of RAM, running under the Ubuntu 18.04 kernel 4.15.0-112generic operating system.The BRKGA and the constructive heuristics were implemented in C++.The BRKGA uses the Mersenne Twister pseudo-random number generator [35]

Test instances
The benchmark set used in this work is the same as the PACE 2017 Challenge [17], with the test instances formed by graphs collected from several sources.In light of the application of optimizing Gaussian elimination, several instances were taken from the Matrix Market [6] and the Network Repository [44].In the context of phylogenetic tree reconstruction, 39 instances come from alignments of mammalian DNA markers obtained from the OrthoMaM database [19,42].More challenging instances were created from sampled connected subgraphs of the real-world instances.The 200 graphs of the PACE 2017 Challenge were divided into 100 public instances (on which the participants could test their implementations) and 100 hidden instances (used to rank the submissions).
The computational experiments reported in this section were performed on the complete set of 200 benchmark instances.All the input data for the test instances used in the experiments reported in this work are available in Mendeley [45], together with the detailed numerical results.

Parameter tuning
The irace automatic tuning tool [34,39] was used to configure the parameters of the BRKGA.We sought the appropriate values for the parameters  (population size), pe (fraction of the population corresponding to the elite set), pm (fraction of the population corresponding to the mutant set), and rhoe (probability that the offspring inherits each of its keys from the best fit of the two parents) used by the BRKGA, as well as the number  of consecutive generations without improvement on the best solution found until a restart is performed.
The irace tuning experiment was performed on 20 instances of different sizes of the PACE 2017 challenge listed in Table 2, choosing one of the listed instances in each run.
The ranges suggested for the parameter values in [24] are listed in Table 3, side-by-side with the values determined in the tuning experiment.

Initial population with injected individuals by constructive heuristics
We developed in Section 5 an original strategy for injecting externally generated high-quality solutions generated by constructive heuristics, encoded as random keys, into the initial population of the BRKGA.
In this section, we evaluate the effect of this strategy on the quality of the best solutions obtained by the BRKGA.We compare two versions of the BRKGA.The first version is the standard version of the algorithm, with the initial population entirely randomly generated.The second version is characterized by an initial population that contains two externally injected solutions, one generated by the constructive heuristic min-degree and the other by the fill-in heuristic.
For this experiment, we ran each version of the algorithm five times on ten instances of the PACE 2017 challenge with a time limit of 30 min each.Table 4 displays the numerical results.For each instance and each algorithm version, it displays the best and the average best solution values obtained over the five runs.The best values for each instance are underlined.The table shows that, for all instances, the BRKGA with the injection of externally constructed solutions obtains better results.The best solution values were improved by 6.38% on average with the injection of initial solutions.Therefore, this algorithm version will be used in the forthcoming sections and experiments.Other implementations of BRKGAs could further explore and benefit from this strategy.

Experiments with the BRKGA
The Parameterized Algorithms and Computational Experiments Challenge (PACE) was conceived to help deepen the relationship between parameterized algorithms and practice.The PACE 2017 challenge [17] addressed exact algorithms for CCP.The participants were challenged to solve the maximum number of test instances within the allowed time limit of 30 min.per instance.The winners were selected based on the number of solved hidden instances.The participants were prohibited from using SAT solvers, MIP solvers, or similar general solvers.To the best of our knowledge, there are no metaheuristics published in the literature for CCP.Therefore, in this section, we compare the solutions of the BRKGA proposed in Sections 3-4 using the injection strategy discussed in Section 5 with the construction heuristics fill-in and min-degree introduced in Section 2.2 and the winning algorithm of PACE 2017, see [32].
In these experiments, the solutions generated by the constructive heuristics fill-in and min-degree coded as random keys are injected into the initial population of the BRKGA.The latter was run five times, with different initial seeds for the pseudo-random number generator, for each of the 200 instances of the PACE 2017 challenge, each with a time limit of 30 min.The exact algorithm from [32] running with the same time limit of 30 min.on the 200 instances found the optimal solution for 116 instances.However, it failed to find a feasible solution for the remaining 84 instances.All algorithms were executed on the same computer.
The BRKGA found a feasible solution for every one of the five runs for all 200 instances.Concerning the 116 instances where the exact algorithm found the optimum, the BRKGA improved the initial solutions generated by the fill-in and min-degree constructive heuristics for 48 instances.The BRKGA managed to find the optimal solution in 358 of the 1000 runs and at least one of the five runs for 78 instances.Table 5 summarizes these results.
For the 38 (19%) instances where the BRKGA did not find the optimal solution in any of the five runs, but the exact method did, a comparative study was carried out regarding the percent deviation between the optimal value and the best value obtained over the five runs.Let  be the optimal value and  be the best value obtained by the BRKGA for some instance.100 × ( − )/ gives the percent deviation from the optimal value.The plot in Figure 6 displays the fraction of instances with relative errors in each interval [0%, 5%], (5%, 10%], and (10%, 20%].For all instances, the BRKGA obtained solutions with a relative error smaller than or equal to 20%.The relative error was smaller than or equal to 5% in 81.6% (i.e., 31 out of 38) of the instances for which the optimum was not found.
We now compare the BRKGA with the existing constructive heuristics in the literature: min-degree and fill-in.Table 6 details the results for the 48 instances for which the exact algorithm from [32] did not find a feasible solution, and the BRKGA improved the solution obtained by the constructive heuristics.In addition to the data characterizing each instance, it gives the solution values obtained by the heuristics min-degree and fill-in, and the best solution value obtained by the BRKGA.It also gives the relative improvement in percent provided by the best solution value obtained by the BRKGA concerning the best solution among the solutions obtained by the constructive heuristics fill-in and min-degree.For each instance, let best BRKGA be the value of the best solution value obtained by BRKGA, and best heu be the minimum between the solution values obtained by the heuristics min-degree and fill-in.The relative improvement obtained by the BRKGA is given by 100 × ( ℎ −  BRKGA )/ ℎ .Table A.1 in A the results for all algorithms on the 200 instances used in the computational experiments.
To conclude, we illustrate the convergence of the BRKGA toward the best solution.Figure 7 shows the best solution value along the first 1000 generations for five BRKGA runs (using different seeds) on instance 179. Figure 8 shows the same experiment on instance 144.In both cases, the solution obtained by the BRKGA is compared with that obtained by the fill-in heuristic.

Concluding remarks
In this work, we proposed a BRKGA for finding approximate solutions to CCP.The algorithm obtained competitive solutions with the best exact algorithm of the PACE 2017 challenge and obtained good feasible solutions for all 84 (42%) instances where the exact algorithm failed.
The computational experiments have shown that the BRKGA found optimal solutions for 78 (39%) instances.The BRKGA improved the quality of the solution in relation to the constructive heuristics that are injected into the initial population by 1.42% on average.
A very interesting conclusion from the computational experiments was that injecting high quality initial solutions coded as random keys into the initial population can make BRKGA obtain better solutions than starting with a completely random population.This strategy should be explored by other implementations of BRKGAs.

Figures 2 (
Figures 2(b) to 2(i) illustrate the step-by-step application of heuristic fill-in to the graph in Figure 2(a).Red vertices are those removed at each iteration of the loop in lines 4-14.Red edges indicate the neighborhood of the vertex that will be removed at each iteration.Red dotted lines indicate the edges created to complete each neighborhood.Figure3(a) shows that the chordal completion obtained problem by the fill-in heuristic for the graph in Figure2(a) has three edges, although the optimal solution has only two edges, as shown in Figure3(b).Other constructive heuristics based on perfect elimination orderings appeared in[4,36,43].The following section presents a BRKGA for CCP, whose decoder is based on the min-degree and fill-in heuristics.

Figure 4 .
Figure 4. Population evolution between consecutive generations of a BRKGA.

Figure 6 .
Figure 6.Error in percent in the instances not solved to optimality by the BRKGA.

Figure 7 .
Figure 7. Evolution of the best value found by BRKGA along 1000 generations on instance 179.

Figure 8 .
Figure 8. Evolution of the best value found by BRKGA along 1000 generations on instance 144.

7 :
for all pair ,  of vertices of  ′ which are both neighbors of  do

Table 2 .
Test instances used in the irace tuning experiment.

Table 3 .
Value ranges and parameter values selected by the irace tuning experiment.

Table 4 .
Comparative results obtained by BRKGA with and without the injection of externally constructed high-quality solutions (best values for each instance are underlined).

Table 5 .
[32]arative results between BRKGA and the exact algorithm from[32]in terms of feasibility and optimality on 200 instances of the PACE 2017 Challenge after 30 min. of running time.

Table 6 .
Comparative results between BRKGA and the constructive heuristics on the instances where the exact algorithm did not return a feasible solution.