METAHEURISTIC ALGORITHMS FOR SOLVING ROMAN { 2 } -DOMINATION PROBLEM

. A Roman { 2 } -dominating function (Rom2DF) on a graph 𝐺 ( 𝑉, 𝐸 ) is a function 𝑔 : 𝑉 → { 0 , 1 , 2 } of 𝐺 such that for every vertex 𝑥 ∈ 𝑉 with 𝑔 ( 𝑥 ) = 0 , either there exists a neighbor 𝑦 of 𝑥 with 𝑔 ( 𝑦 ) = 2 or at least two neighbors, 𝑢, 𝑣 with 𝑔 ( 𝑢 ) = 𝑔 ( 𝑣 ) = 1. The value 𝑤 ( 𝑔 ) = ∑︀ 𝑥 ∈ 𝑉 𝑔 ( 𝑥 ) is the weight of the Rom2DF. The minimum weight of a Rom2DF of 𝐺 is called the Roman { 2 } - domination number denoted by 𝛾 { 𝑅 2 } ( 𝐺 ). Since determining 𝛾 { 𝑅 2 } ( 𝐺 ) of a graph 𝐺 is NP-hard and no metaheuristic algorithms have been proposed for the same, two procedures based on genetic algorithm are proposed as a solution for the Roman { 2 } -domination problem. One of the proposed methods employs a random initial population, while the other uses a population generated using heuristics. Experiments have been carried out on graphs generated using Erd¨os–R´enyi model, a popular model for graph generation and Harwell Boeing (HB) dataset. The experimental results demonstrate that both approaches provide a near optimal solution which is well within the known lower and upper bounds for the problem. The experimental results further show that the procedure based on random initial population has outperformed the heuristic based procedure.

each vertex  ∈  with ℎ() = 0 has a neighbor  with ℎ() = 2 is known as the Roman dominating function (RDF) of .The value ℎ() = ∑︀ ∈ ℎ() is the weight of the RDF.The minimum weight of a RDF of  is called the Roman domination number of  denoted by   ().Given a graph , determining   () is NP-hard.
- is adjacent to at least one vertex labelled "2", (or) - is adjacent to at least two vertices labelled "1".
The value () = ∑︀ ∈ () is the weight of the Rom2DF.The minimum weight of a Rom2DF of  is called the Roman {2}-domination number of  denoted by  {2} ().If  is a Rom2DF of  then the total weight of vertices in the open neighborhood of the vertex labeled "0" must be at least 2 i.e., Σ( ()) ≥ 2. The Roman {2}-domination problem (Rom2DP) of finding a Rom2DF with minimum weight i.e., Rom2DN in a graph is NP-hard [3], meaning that finding an optimal solution is computationally difficult.Rom2DP is also NP-hard for bisplit graphs, bipartite graphs, subclasses of bipartite graphs [3,9] and chordal graphs [9].Roman {2}-domination for different classes of graphs is studied in [6][7][8][9].Bounds and exact values for Roman {2}domination number of different graphs has been studied in [4,[6][7][8][9]13].A genetic algorithm based approach for Roman domination problem has been proposed in [10].However no meta-heuristic algorithm exist for solving Rom2DP problem, which has left a room for the research and motivated us to focus on this direction to solve different Roman variants.Hence, two different genetic algorithm based procedures are proposed to solve Rom2DP for graphs of colossal size.
The rest of the paper is organized as follows: A brief introduction to genetic algorithm is given in Section 2. Next two proposed procedures for solving Rom2DP are mentioned in Sections 3 and 4 followed by the experimental results in Section 5. Finally a conclusion is given in Section 6.

Algorithm 1. Genetic algorithm.
Input : An optimization problem  Output : Solution to Step 1: Generate initial population I of specified size Step 2: Select parents Step 3: Crossover operation Step 4: Mutation and Feasibility check Step 5: Final solution

Genetic algorithm
A metaheuristic is a more sophisticated technique or heuristic that searches for, develops, or selects a heuristic that could provide a near optimal solution to an optimization problem.The use of meta-heuristic algorithms enables reasonable time near optimal solutions to complex problems.A genetic algorithm is a metaheuristic algorithm that is inspired by the process of natural selection in biology.By emulating evolution, it aims to find solutions for complex problems.The general idea of the algorithm is that it tries to generate initial population and refines them to achieve better solutions.This evolution is achieved by passing the population through a series of phases such as selection, crossover and mutation.It then picks up the best solution from the group of refined better solutions.Although the algorithm doesn't always guarantee optimal solution but it promises a near-optimal solution to a problem in a reasonable amount of time.Genetic algorithms are used in a wide range of applications, including optimization of continuous functions, scheduling, game playing, and machine learning.They have been shown to be especially helpful for issues where the search space is large and conventional optimization techniques are less successful.The applications of genetic algorithm are discussed in detail in [12].We propose two genetic algorithm based procedures for solving Rom2DP and are described in detail in the next two sections.The two proposed procedures are compared based on their minfscore i.e. minimum of the fitness scores obtained.The fitness score (fscore) is the sum of all the labels assigned to the vertices (Fig. 1).

Procedure 1 for solving Rom2DP
Initial population for genetic algorithm is generated in different ways.The idea of considering random initial population as input for the genetic algorithm is given in [11].Motivated by this, we generate initial population randomly using two methods given below to solve Rom2DP.

Initial population generation
Let  () = {0, 1, . . .,  − 1} be the vertex set of given  vertex graph .Vertices of  are labelled randomly using the two methods given below.

Method 1
In this method, a vertex  is chosen randomly and is labelled with either 0 or 1.The output of this phase is a random population consisting of 0's and 1's.

Method 2
This approach resembles method 1 except that it uses labels from the set {0, 2} i.e., it chooses a vertex  randomly from the vertex set and assigns it either 0 or 2. The output is a random population of 0's and 2's.
These methods generate a random initial population.Half of the initial population is generated using method 1 and the other half using method 2. In this study, for experimental purpose, the initial population size considered is 1000.The generated initial population is given as input for the next phase.

Selection and crossover
For the selection phase, two parents  1,  2 are taken from the initial population.This selection can be done in numerous ways like random, roulette wheel and so on.A random selection is used in the proposed procedure since randomization is given priority.Each individual element in the parent is called a .After the selection process, the parents undergo crossover operation which can be done in a variety of methods.A two-point crossover is used in the proposed procedure where two points  1 and  2 are chosen randomly and the genes in

Feasibility check and mutation
The inputs 1 and 2 go through a feasibility check to determine whether a zero labeled vertex is adjacent to at least one vertex with label two or at least two vertices with label one.Feasibility check determines whether they adhere to Roman {2}-domination rules.If they are not, the mutation operation is carried out, which alters the label "0" to "1" thus generating a feasible solution.Every time following the mutation operation, fitness scores (fscore) for the children 1 and 2 are calculated which is the sum of all the labels assigned to the vertices.Figures 2 and 3 show that 1 is a feasible solution but not 2.Hence as shown in Figure 4 there is no change in the genes of child 1.However it can be observed from Figure 3b corresponding to 2 that vertices 2 and 4 violate the Rom2DF rules.As a result, 2 undergoes mutation, in which the genes 2 [1,4] are changed from 0 to 1 in order to produce a feasible solution shown in Figure 5.The initial parents  1 and  2 in the population are then substituted with the obtained feasible solutions 1 and 2.The steps are repeated till the termination condition is met which is number of iterations in this case.It is 100 000 iterations for Erdös-Rényi model and 200 000 iterations for Harwell Boeing (HB) graph model.The final answer produced by the algorithm for Rom2DP is the one with lowest fscore as it is assessed to be the best solution.

Procedure 2 for solving Rom2DP
Similar to procedure 1, the second procedure for solving Rom2DP is also a genetic algorithm based approach.Unlike procedure 1 which uses randomly generated initial population which may or may not be feasible, procedure 2 uses three different heuristics to produce an initial population of feasible solutions.Next, we explain in detail the three heuristics proposed to generate an initial population of feasible solutions.

Heuristic 1
This heuristic picks a vertex  randomly and assigns it a label "2" and its neighbours a label "0".Next, the vertex  and its neighbors if any are removed from the graph and the process is repeated for the remaining graph until all vertices are labelled.
Pseudo code for heuristic 1 is given in Algorithm 3 and its working is illustrated with the help of a graph in Figure 6.A graph (, ) with vertex set {0, 1, . . ., −1} is provided as input to Algorithm 3. Next [0 . . .−1] is declared as a solution array and  is initialized as  .A random vertex  from  is picked and label 2 is assigned to () and 0 to all its neighbours  i.e., () to 0. Next all those vertices which are labelled are removed from  and the process is repeated until all vertices are labelled.It is easy to verify that  is a Rom2DF of  with fitness value i.e., weight ∑︀ −1 =0 ().For the graph shown in Figure 6, initially  = {0, 1, 2, 3, 4, 5}.Suppose that heuristic 1 picks vertex 3 randomly from . Vertex 3 is assigned label 2 i.e., (3) = 2 and its neighbours are assigned label 0 i.e., (2) = 0 and (4) = 0. Now, we have  = {0, 1, 5}.If 5 is the next vertex to be picked then set (5) = 2 and assign 0 to its unlabelled neighbours 0 and 1 i.e., set (0) = 0 and (1) = 0. Now  = .It is easy to verify that the labelling is a valid Rom2DF of  with weight 4. Algorithm 3. Algorithm for heuristic 1.

Heuristic 2
In this heuristic, unlike heuristic 1, we use 0's and 1's for labelling the vertices.An unlabelled vertex  is chosen at random and the degree is checked which is calculated in the beginning of the heuristic.If () ≤ 1, then the vertex  is labelled "1" i.e., () = 1.Otherwise the vertex  is labelled "0" and the sum of labels of where ,  ∈  () are chosen randomly and labelled as "1" and if () = 1 then an unlabelled neighbor of  is randomly selected and labelled as "1".The labelled vertices are then removed from the set of unlabelled vertices.The process is repeated for the remaining graph until all vertices are labelled.

Heuristic 3
In this approach, the vertices are sorted in order based on the degree of each vertex.The comparison of degrees is based on the initial degrees calculated and the vertices are chosen in the order of index  = [0, 1, . . .,  − 1].The vertex  is chosen from  = 0 and given a label "2" and all its adjacent vertices available in  are assigned "0".The labelled vertices are then removed from the unlabelled vertex set and the solution set is updated at each iteration.The next available vertex from the list of unlabelled vertices is chosen and assigned "2" as label and its adjacent vertices with "0".This procedure is repeated until there is no vertex left unlabelled.If only one vertex is left unlabelled, then label it with 1 and if more than one isolated vertices are formed during the process i.e., () = 0, they are labelled "2".In Figure 8 the sorted order of vertices is {3, 5, 0, 1, 6, 2, 4, 8, 7} of which  = 3 is chosen and labelled 2. The vertices in  () = {2, 4, 5, 8} are labelled 0 and all the vertices in  [] are removed from unlabelled vertex set.After first iteration, the unlabelled vertices are {0, 1, 6, 7} out of which  = 0 is labelled with 2 and the adjacent vertices {1, 6} are labelled "0".Finally  = 7 is the only vertex left unlabelled which is labelled "1".

Initial population
The initial population consists of 1000 feasible solutions generated using the proposed three heuristics.Since the third heuristic uses degrees to sort the vertices which results in fewer distinct feasible solutions, the first two heuristics are used to generate 90% of the initial population and the rest constitutes of heuristic 3. Algorithm 5. Algorithm for heuristic 3.

Selection and crossover
Following the formation of the initial population, two solutions, namely the parents  1 and  2, are picked at random and the two-point crossover operation is carried out.The detailed working of the operation is explained in previous section.The crossover outputs are transformed into children 1, 2.

Feasibility check and mutation
The children 1, 2 are checked for feasibility, and if a child is deemed infeasible, it proceeds through the mutation process.During mutation, all zero labeled vertices are examined to see if they satisfy the Rom2DF criterion, and if they do not, the labels of some of those vertices are flipped to "1".If the parent's   is higher than the child's, the solutions are replaced in the initial population.The   for the child is determined at each iteration, and the minimum is recorded.The termination criteria is the number of iterations and it is same as specified in the procedure 1. Algorithm 6. Algorithm for procedure 2.

Experimental results
The two proposed procedures are implemented in C++ language on Intel i7 processor machine running on Windows 11.The experiments are carried out in different phases comparing all the conceivable outcomes and the results are tabulated for the best outputs generated.Though Rom2DP is NP-hard, in the literature, optimal solutions for a few well-known graphs have been calculated and derived.For cycle graph   ,  {2} (  ) =  2 and for a grid graph   with 2 vertices  {2} (  ) =  2 [3].For a graph ,  {2} () ≥ 2 Δ+2 , where ∆ is the maximum degree of , a lower bound is obtained in [3].Since  {2} () ≤   () and   () where () is the minimum degree of  and the upper bound of  {2} () ≤ 2 ()+1 (ln( ()+1 2 ) + 1) holds for arbitrary graphs.The experiments are first carried out on cycle graphs, grid graphs and star graphs to verify the correctness of the algorithm since optimal solutions are available for those graphs.Results obtained for these classes of graphs using both the proposed procedures is given in Table 1.From Table 1, it is clear that the proposed procedures have obtained exact values for these three classes of graphs.After verifying the correctness for special graphs, experiments are further extended to arbitrary graphs generated using Erdös-Rényi model and HB graphs, two popular graph models used for evaluating the performance of heuristc or metaheuristic algorithms for different domination problems.
In procedure 2, instead of a single heuristic a combination of heuristics are used to reduce the problem of local minima and is evident from the results shown in Tables 2 and 3.The results obtained with both the procedures for random graphs generated using Erdös-Rényi model are shown in Table 2 and the results for HB graphs are provided in Table 3.All the graphs considered for Erdös-Rényi model are generated with probability  = 0.2 and 0.3.From Tables 2 and 3 it is evident that the results obtained by the proposed procedures lie well within the known bounds.Furthermore, the results obtained for the HB graphs using both the procedures are better than the Roman domination results obtained for those graphs in [10], proving the relation  {2} () ≤   () and the accuracy of the presented algorithms.The comparison plot of the two procedures' is presented in Figure 9.
For the majority of the graphs considered, it is evident from the graph that procedure 1 performs better than procedure 2. Another significant observation is that instead of considering the initial population of feasible solutions, a random population set can also be employed and the suggested method is capable of generating feasible outcomes from the random set.The rationale is that when the algorithm is run for more iterations, practically all of the parents are made feasible in the initial iterations and are improved in the succeeding iterations to produce a better result.
Moreover, heuristics can be modified to meet the needs of the problem, and constructing a better heuristic can result in a better solution.The recommended procedures emphasise on randomization, and this has been done in as many steps as possible.It should be noticed that the genetic algorithm is adaptable, and the steps can be modified and implemented as needed.

Conclusion
In this paper, we have proposed two genetic algorithm based procedures for solving Roman {2}-domination problem which is NP-hard.Since no meta-heuristic algorithm has been proposed in the literature for this problem, effectiveness of the proposed meta-heuristic procedures is tested on the special graphs for which exact values are known, random graphs generated using Erdös-Rényi model and Harwell Boeing graphs.It is found that the results obtained lie within the known bounds for the problem.This fact emphasizes that the proposed

Figure 9 .
Figure 9.Comparison plot of procedures for HB graphs.

Table 1 .
Results for known bounds of graphs.

Table 3 .
Results for Harwell Boeing model graphs.