Abstract

The connected vertex cover () problem, which has many important applications, is a variant of the vertex cover problem, such as wireless network design, routing, and wavelength assignment problem. A good algorithm for the problem can help us improve engineering efficiency, cost savings, and resources consumption in industrial applications. In this work, we present an efficient algorithm GRASP-CVC (Greedy Randomized Adaptive Search Procedure for Connected Vertex Cover) for in general graphs. The algorithm has two main phases, i.e., construction phase and local search phase. In the construction phase, to construct a high quality feasible initial solution, we design a greedy function and a restricted candidate list. In the local search phase, the configuration checking strategy is adopted to decrease the cycling problem. The experimental results demonstrate that GRASP-CVC is better than other comparison algorithms in terms of effectivity and efficiency.

1. Introduction

The connected vertex cover (CVC), which was first introduced by Garey and Johnson in paper [1], is one of the classical combinatorial optimization problems. The problem not only shows its great importance in theory, but also has many significant industrial applications [25]. For example, in the wireless network design, the vertices of the network are connected by transmission links. Because network signals damp with transmission, we want to place a minimum number of relay stations on vertices in order to assure that any two neighboring stations are connected and that every transmission link is connected to a relay station. This is the most direct application of the connected vertex cover model in the industry. Designing a good algorithm to solve this problem can not only improve work efficiency and save money and labor cost, but also save natural resources and reduce material waste. The problem is known to be NP-hard even in the planar 2-connected graph of maximum degree 4 [6] and planar bipartite graph with maximum degree 4 [7], as well as in 3-connected graph [8].

The problem has been studied for a long time, and a lot of efforts have been devoted to it. To date, there are mainly two types of algorithms to solve , i.e., exact algorithms and approximation algorithms. All existing exact algorithms for are mainly FPT (fixed-parameter tractable) algorithms in theory and these theoretical results are obtained in worst case. For example, Moser [2] showed that was fixed-parameter tractable using the tree width as a parameter and proposed a dynamic programming algorithm running in time, where was the tree width and was the number of nodes of nice tree decomposition. With the desired vertex cover size as parameter, Richter et al. [9] proposed an improved algorithm with running time in O() in the worst case. Binkele-Raible [10] provided a better exact algorithm with running time in in the worst case. Because these exact algorithms failed to solve large graphs, a lot of efforts have been devoted to approximation algorithms. In the general graph, Savage [11] proposed the first constant ratio algorithm and proved that the set of internal nodes of any depth-first search tree was a solution of 2-approximation for problem. In addition, Fujito and Doi [12] proposed a 2-approximation algorithm for solving CVC, which ran in time using processors on an EREW-PRAM, where was the number of vertices, was the number of edges, and was the maximum vertex degree. Fernau and Manlove [7] proved that was NP-hard to approximate within in general graphs unless . Therefore, it is difficult to improve the approximation ratio of approximation algorithms in general graphs, which makes the researchers change their research angle into the special graphs. Escoffier et al. [13] proved that the problem was APX-complete in bipartite graphs of maximum degree and was polynomial time solvable in chordal graphs. In addition, they also showed that CVC was -approximable for a class of special graphs (where solving the minimum vertex cover problem used polynomial time) and a polynomial time approximation algorithm for in planar graphs was presented. Cardinal and Levy [14] proposed an approximation algorithm in dense graphs and the algorithm approximated the problem with a ratio strictly less than in dense graphs. The first polynomial time approximation algorithm in unit disk graphs for problem was proposed in [3]. Li et al.[15] proved that the problem was still NP-hard for -regular graphs and provided a lower bound for the problem. Moreover, they proposed two approximation schemes for this problem in -regular graphs with approximation ratio and , respectively. Although the exact algorithms for can provide an optimal solution, they are hard and time consuming to deal with large scale instances. Furthermore, although some approximation algorithms for can get good performance in special graphs, they are usually not suitable for dealing with general graphs, and the state-of-the-art approximation methods in general graphs can only provide an approximate ratio , which is often not enough in practice. This yields a new challenge for us to devise a heuristic algorithm for that can deal with large general graphs and obtain the best possible approximate solutions within a reasonable time.

In this article, the heuristic algorithm GRASP-CVC for in general graphs is proposed and this algorithm can obtain a relatively good solution within a reasonable time. The heuristic algorithm GRASP-CVC is based on the framework of greedy randomized adaptive search procedure () [16]. The algorithm GRASP-CVC has two main phases, i.e., construction phase and local search phase. In the construction phase, the GRASP-CVC tries to construct a feasible initial solution greedily. During this phase, we design a greedy function to help evaluate the benefit of adding a vertex to the current solution. Besides, we construct a restricted candidate list () to assist in constructing a high quality initial solution in this phase. In the local search phase, the initial solution is further improved. To prevent the local search from suffering severe cycling problem, the configuration checking () strategy is adopted in the search. Relying on the , we avoid many unnecessary searches during the local search procedure and greatly improve the efficiency of the GRASP-CVC. Once the local search phase cannot explore a better solution anymore, which means the local search phase reaches a local optima, the GRASP-CVC then restarts a new iteration and repeats the construction and local search phases until reaching the maximum iteration times. The best found solution will be the final solution after all iterations are used up. The experimental results demonstrate that GRASP-CVC is better than other comparison algorithms in terms of effectivity and efficiency. Moreover, the GRASP-CVC obtains solutions of almost the same size in times of running, which demonstrates its stability.

The rest of this paper is structured as follows. Some relevant definitions and background knowledge will be introduced in the next section. In Section 3, the algorithm GRASP-CVC will be introduced and the two main components will be discussed in detail. Experimental evaluations and analyses will be shown in Section 4. Conclusions and future work will be given in the last section.

2. Preliminaries

In this section, some definitions and background knowledge are provided. From now on, unless otherwise stated, we only consider the CVC problem on an undirected graph , where is the vertices set and is the edges set. In addition, each edge is a 2-element tuple on and we define vertices and as the endpoints of edge . For a vertex subset and an edge , if contains no endpoint of , we say is uncovered by ; otherwise, we say is covered by .

Definition 1 (vertex cover, VC). Given a graph , a subset of vertices is a vertex cover () of if each edge in has at least one endpoint in .

Definition 2 (minimum vertex cover, MVC). Given a graph , the minimum vertex cover () problem is to compute a of minimum cardinality in .

Definition 3 (induced subgraph, IS). Given two graphs and , where and , is called an induced subgraph (IS) of .

Definition 4 (connected graph). A graph is a connected graph if there is a path between every pair of vertices.

Definition 5 (connected vertex cover, CVC). Given a connected graph , the connected vertex cover () problem is to determine a subset with minimum cardinality such that satisfies the following two conditions: (1) is a vertex cover; (2) the IS induced by is a connected graph.

In order to help the readers to understand the concepts given above, we provide an example in Figure 1. Figure 1(a) is a graph , where and . Figure 1(b) presents an induced subgraph by the vertex set that is just the solution of the problem of . Because the induced subgraph in Figure 1(b) is not connected, the vertex set is not the solution of the problem of . By adding a vertex to , we obtain a new vertex set . The subgraph induced by is shown in Figure 1(c). From Figure 1(c), we can notice that the vertex set is the minimal vertex subset that satisfies the following: (1) subgraph induced by is connected; (2) the vertex set covers all edges in . Thus, is a solution for the problem of . From the example, we see that the size of the optimal solution provides a lower bound for the size of the optimal solution. In the following, we will present the conclusion in Theorem 6.

Theorem 6. The size of the optimal solution provides a lower bound for the size of the optimal solution.

Proof. Given an undirected graph , we suppose the size of the optimal solution is and the size of the optimal solution is . Then we will analyze the theorem cases individually.
Case 1. There is a connected optimal solution of . Under this circumstance, the solution is also a solution. Thus, we have .
Case 2. There is no connected solution among all of the optimal solutions of . Under this condition, it is impossible that . Then we will prove the conclusion by using reduction to absurdity. Suppose there exists a solution that . Under this condition, according to the definitions of and , we know the solution is an solution as well. So, we get one solution whose size is smaller than . However, this is a contradiction with the previous assumption that is the size of the optimal solution.
In total, we finally reach the conclusion that , which means that the optimal solution size provides a lower bound for the size of the optimal solution.

3. GRASP-CVC Algorithm for CVC

GRASP-CVC (Greedy Randomized Adaptive Search Procedures for Connected Vertex Cover problem) is a multistart metaheuristic, which consists of two main phases: construction phase and local search phase. An initial solution is constructed firstly in the construction phase, and then the local search phase attempts to find the existence of a better solution by exploring the neighborhood of the initial solution. The two phases are executed repeatedly until reaching the termination condition, and then the GRASP-CVC takes the best found solution as the final output. The pseudocode of GRASP-CVC is outlined in Algorithm 1. At first, the solution is initialized (line 1). Then the algorithm enters an iteration loop (lines 2–8). In each iteration, an initial solution is generated firstly by the construction procedure (line 3), and then in the local search procedure (line 4), GRASP-CVC starts its search from trying to find a better solution. If possesses fewer vertices than the current best solution , will be updated by (lines 5-6). When the GRASP-CVC reaches the maximum iteration times, will be returned as the final solution (line 9). During the construction, we design a greedy function and construct a restricted candidate list to help to construct a high quality feasible solution. Moreover, in the local search, we adopt the configuration checking to reduce the cycling problem. The two phases will be discussed in detail in the next two subsections.

1initialize the solution ;
2for    to    do
3;
4;
5if    then
6;
7end
8end
9return  
3.1. Construction Phase

Before introducing the construction phase, we shall give the definitions of greedy function and restricted candidate list () that play important roles in the construction phase.

3.1.1. Greedy Function and RCL

To evaluate the benefit of adding to the current solution, a greedy function () is designed, which is quite important for the construction of as well. In order to introduce the greedy function, we firstly propose some relevant definitions. We say vertices and are neighbors of each other if there is an edge between them, and we use denoting the neighbor set of vertex . The neighbor vertices set of a solution , denoted as (), can be calculated as follows: For a given vertex , the greedy function () can be calculated by In Formula (2), is the current solution. If is in ,   (“” means removing the vertex from ); otherwise, . Moreover, () is also a function calculated by From the formula, we can know that the function () is to compute the total number of edges uncovered by . In addition, when is in , () is a negative number.

Using the greedy function (), we can identify those vertices that are most beneficial to the current solution. Moreover, the greedy function is an indispensable part in the construction of .

The consists of the vertices that are most beneficial to the current solution . In the construction phase, one vertex is chosen randomly from . And to construct a feasible initial solution, we select vertices from . The construction of is described in Clearly, the elements of are the vertices set having the highest in the premise of not destroying the connectivity of .

3.1.2. Construction Procedure

After the necessary descriptions of greedy function and , we shall discuss the greedy construction procedure in detail. The greedy construction procedure GreedyConstruction is outlined in Algorithm 2.

1;
2;
3initialize the of each vertex according to Formula(2);
4while    is not a connected vertex cover  do
5choose a vertex from randomly;
6;
7update of each vertex;
8;
9end
10return  

In the beginning, the connected vertex cover is initialized (line 1) and the of each vertex is initialized according to Formula (2) (line 2). The is initialized to the vertices with the highest among the vertices set (line 3). Then, the procedure enters the main loop (lines 4–8). In each loop, a vertex is chosen from the randomly and added to the construction solution (lines 5-6). After the operations of lines 5 and 6, the of each vertex is updated according to Formula (2) (line 7). At the end of the loop, the is updated (line 8). The loop is executed until is constructed to be a solution of , and then will be returned at the end of the construction procedure (line 10).

3.2. Local Search Phase

In this subsection, we shall introduce the configuration checking () strategy and discuss the working process of the local search phase in detail.

3.2.1. Configuration Checking Strategy

Greedy strategy is usually an important part in the local search algorithms. It helps to lift the performance of the local search algorithms on large and hard instances. However, the greedy strategy usually also makes the local search algorithms easier to fall into the cycling problem (which means the algorithm visits the same part of the solution space repeatedly). Up to now, many efficient strategies have been used to handle this problem [1720]. Configuration checking () [21] strategy is one of those strategies and has been applied to some problems successfully [2125]. Therefore, we adopt the strategy to avoid the cycling problem in the local search.

Before introducing the , we shall give the concept of vertex state. The vertex state of a vertex indicates whether is located in the current solution. We can use a Boolean value to represent that is in the current solution and to represent that is not in the current solution. The configuration of a vertex , which can be denoted by an n-dimensional Boolean vector (where is the number of neighbor vertices of ), is the states of all its neighbor vertices.

The main idea of the strategy is that a vertex is forbidden to add back to the current solution if its configuration keeps unchanged after it was removed from the current solution last time. This strategy is intuitive and reasonable in avoiding cycling problem, as it prevents the search from facing the same scenario again. For example, for a , suppose its configuration is after removing out of , then after several steps of searching, is selected again according to the greedy function value and suppose its configuration is now. When , i.e., configuration not changed, if is added back to the , then the search goes back to the same situation before was removed out of in last time and the same solution space will be searched repeatedly. However, this situation will not occur when , i.e., configuration changed (e.g., ). A Boolean array is used to implement the strategy. The element in the array is [], which denotes whether the configuration of vertex is changed after it was removed from the current solution last time. We use [] = to represent that the configuration of vertex v is changed, and [] = to represent that the configuration of vertex v is not changed. Only the vertex whose [] = is allowed to be added to the current solution in the local search process. In the process of local search, the values of are updated according the rules below [21].(i)Rule 1: In the beginning, for each vertex , set [] to 1.(ii)Rule 2: When removing from , reset [] to 0.(iii)Rule 3: When changes its state, for each N()C, [] is set to 1.

3.2.2. Local Search Procedure

In this subsection, the local search procedure is discussed at length. The main steps of the LocalSearch are listed in Algorithm 3.

1initialize each element value of array to ;
2;
3while    do
4if    is a vertex cover  then
5if    is connected  then
6if    then
7;
8end
9else
10return  ;
11end
12drop a vertex with the highest score from and update the array;
13continue;
14end
15choose an uncovered edge randomly;
16choose a vertex such that with a higher score, and update the array;
17end

The local search procedure performs as follows. In the first place, all elements of the are initialized to (line 1), which means that all vertices are allowed to be added to the current solution in the beginning. Next, the local optimal solution is initialized as , where is generated by the construction phase (line 2). Then, in the loop (lines 3–17), the LocalSearch() checks the feasibility of the current solution . If is a solution which has a smaller vertex number than , then will be updated by and a vertex with the highest will be removed from , and then the procedure starts the next cycle (lines 4–14). If is a but not a anymore after is removed, which means the procedure reaches a local optimal solution, then will be returned as the final result of the local search procedure (lines 9–11). If is not a anymore after is removed, the procedure chooses an uncovered edge randomly and then chooses a vertex such that []= with a higher , and adds to (lines 15-16). The array is updated according to Rule 2 and Rule 3 when a vertex changes its state (lines 12,16).

3.3. Time Complexity Analysis

In this subsection, we discuss the time complexity of the main components of the GRASP-CVC algorithm.

First, we analyze the process for constructing the initial solution in the algorithm. In each loop, we need to update the for vertices, and scan vertices in order to update the . If every time we add a vertex to , edges are covered on average. Then, we can get a solution in .

Next, we analyze the time complexity of the local search algorithm. In this part, there are three operations that affect the running time of the algorithm: dropping a vertex from C (Algorithm 3, line 12), choosing an uncovered edge (Algorithm 3, line 15), and updating the Change array (Algorithm 3, lines 12 and 16). Since the number of vertexes in C is , the first operation can be done in a time of . In our implementation, we maintain a set to record uncovered edges, so an uncovered edge can be chosen in . The time complexity of the third operation depends on the degree of the operated vertex, and therefore this work can be done in O(), where is the maximum degree of the vertices. Thus, the time complexity of the local search is .

Overall, the run-time complexity of the GRASP-CVC is .

4. Computational Experiments

During this section, the effectivity and efficiency of the GRASP-CVC algorithm are evaluated by performing some comparison experiments. We compare the GRASP-CVC algorithm with genetic algorithm (GA) for CVC designed by us and the current best approximate algorithm (2-approximation algorithm) we know in general graphs [12]. Genetic algorithm for CVC is an evolutionary algorithm using techniques inspired by natural evolution. Since GA has achieved good results in other combinatorial optimization problems, we compare our algorithm GRASP-CVC against GA. The main steps of the GA for CVC are listed in Algorithm 4 and the algorithm performs as follows. In the first place, to initialize the population , different individuals are generated randomly. Each individual is a sequence of 0, 1 of length , where is the number of vertices in the graph, 1 indicates that the corresponding vertex is in the solution, and 0 indicates that it is not in the solution. The fitness value of each individual is calculated while generating the individual (line 1). The fitness value is the number of 1 in the sequence, and the smaller the fitness, the better the solution. For example, if both individuals (001010) and (100011) are feasible solutions, the fitness values of and are 2 and 3, respectively, and the solution is better than the solution . Next, select an individual with minimum fitness value from as the current best solution (line 2). Then, in main loop (lines 3–15), the algorithm sorts the individuals in according to the fitness value in ascending order and selects individuals as the elites to pass directly to the next generation (lines 4,5). To generate () new individuals, the loop is iterated () times (lines 6–10). In each iteration of the loop, two individuals and are selected from the remaining individuals using tournament selection method firstly (line 7). Then, crossover operation is performed on and with probability to get two new individuals and (line 8). When two individuals perform the crossover operation, the algorithm first randomly selects a position in the sequence and then exchanges the sequence after the position. For example, if the two individuals are (011010) and (100011), respectively, and the crossover position is the fourth position, then the two new individuals after the crossover operation are (011011) and (100010). Next, mutation operation is performed on and with probability (line 9). When performing the mutation operation, the algorithm randomly selects a position in the sequence and flips the value at that position; that is, 1 becomes 0, and 0 becomes 1. After the crossover and mutation operations, if the individual is no longer a feasible solution, each time we randomly change a 0 in the sequence to 1 until the individual becomes a feasible solution again. Individuals obtained in the above operations form a new population . If the individual with the minimum fitness in the is better than current best solution , is updated with (line 11–14). Finally, the algorithm returns the optimal solution found after the time is exhausted (line 16). Owing to the fact that the researches on CVC problem mainly focused on theoretical studies, there is no available approximation solver, so we implement the 2-approximation algorithm proposed in [12]. We implement the algorithms GRASP-CVC, GA, and the 2-approximation algorithm in the C++ programming language. All of the experiments are carried on a work station under windows 7 operating system, 3.30GHZ CPU and 8GB memory.

1initialize the population with different individuals and compute the fitness value of each individual;
2 = select one individual with minimum fitness value from ;
3while  not reach the cutoff time  do
4Sort individuals in according to fitness in ascending order;
5Select the top individuals as elite individuals to pass directly to the next generation;
6for    to    do
7Select two individuals and through the tournament selection method in the remaining individuals;
8Perform crossover operations on and with probability to generate two new individuals and ;
9Perform mutation operations on and with probability ;
10end
11 = an individual with the minimum fitness value in the new population ;
12if    then
13;
14 end
15end
16return  ;
4.1. Benchmark Instances

In the experiments, we choose two well-known benchmarks in the field of research, the DIMACS and BHOSLIB instance sets. DIMACS benchmark contains both structured and randomized instances. The structured instances are generated from practical problems, like coding theory, Keller conjecture, and so on. The randomized instances are generated from the stochastic models, such as brock instances. The scale of these problem instances is from vertices and edges to more than vertices and million edges. BHOSLIB benchmark is famous for its hardness. The benchmark instances are transformed from instances that are generated in the phase transition area. And the instances in the phase transition area have been proved hard. From the two benchmarks, we select DIMACS benchmark instances and BHOSLIB benchmark instances, which are all employed in the best solver [25].

4.2. Experiment Parameter Settings

Before reporting the experimental results, we shall introduce some parameter settings.(i)GRASP-CVC: There are two main parameters: maximum number of iterations () and random number (random ). According to our experimental experience, we set to 5000 and random seed to an interval from 1 to 10. This is because in order to evaluate the robustness of GRASP-CVC, we executed ten times for each instance and for each time used different random seeds.(ii)GA for CVC: There are six parameters: population size (), the number of elite individuals (), crossover probability (), mutation probability (), cutoff time (), and random number (random ). In our experiments, we set the first five parameters to 20, 10, 0.85, ( is the number of vertices of the input instance), and 1000 seconds, respectively. And for the same consideration as GRASP-CVC, we set different random seeds (1 to 10) in ten times running.

In addition, for the sake of comparison between GRASP-CVC and GA for CVC, we also set a cut-off time to 1000 seconds to the two algorithms.

4.3. Experimental Results

In this subsection, we will provide the computational results of GRASP-CVC (GRASP-CVC) GA for CVC (GA) and the 2-approximation algorithm (2-Aprox) on the two chosen benchmarks. In the results, we provide the following information: the number of vertices and edges of each instance (), the best known size of the solution (), the best solution size solved by the corresponding algorithms (), the average size of solutions solved by the corresponding algorithms (), and the average time consumed by the corresponding algorithms (). In addition, the size with star () has been proved to be the optimal size of solution.

In Table 1, we present the experimental results on DIMACS benchmark. As is shown in the table, GRASP-CVC finds the better quality CVC than GA and 2-Aprox on all the 37 DIMACS instances. On many instances, the solutions found by GRASP-CVC are very close to the optimal MVC and it even finds the solutions of the same size as optimal MVC on 10 instances in a very short time, which means it finds the optimal CVC solutions on these 10 instances. Besides, the GRASP-CVC consumes less time compared to GA on most of the instances, which indicates that the GRASP-CVC is very efficient. Moreover, the GA fails to find a solution within the cut-off time on several instances (C2000.9.mis, C2000.5.mis, C4000.5.mis, and so on), so the column for GA is marked as “”. Another point worth noting is that though the 2-Aprox takes less time compared to the other algorithms, its solutions are not so satisfactory.

Table 2 provides the results on BHOSLIB benchmark. We can get the same conclusion as on DIMACS that the GRASP-CVC performs better than the other two algorithms on BHOSLIB instances, even though it takes much more time than 2-Aprox. The solutions found by GRASP-CVC are close to the optimal MVC and the columns and of GRASP-CVC have the same values on almost all of the instances, which means that the GRASP-CVC gets almost solutions of the same size in each of the 10 times of running, and this also demonstrates the stability of the GRASP-CVC.

The comparative and experimental analyses above show that the GRASP-CVC possesses very good effectiveness and efficiency for CVC problem. It performs better than the other two algorithms in solution quality and outperforms the GA whether in solution quality or in time consumption. Moreover, the GRASP-CVC gets almost solutions of the same size in each of the 10 times running, which demonstrates the stability of the GRASP-CVC.

5. Conclusion

In this paper, a heuristic algorithm GRASP-CVC for connected vertex cover problem was proposed. A greedy function and a restricted candidate list () were proposed to help in constructing a high quality initial solution. Furthermore, the configuration checking () strategy was employed to reduce the cycling problem and improve the efficiency of the search. Experimental results demonstrate that GRASP-CVC works better than the comparison algorithms, which validates the effectiveness and efficiency of our GRASP-CVC solver. In the future, we will further study various heuristic methods and hope to design a more powerful heuristic algorithm to deal with .

Data Availability

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This work was fully supported by the National Natural Science Foundation of China under Grants No. 61370156, No. 61403076, and No. 61763003; Research Fund for the Doctoral Program of Higher Education No. 20120043120017; Program for New Century Excellent Talents in University No. NCET-13-0724; the Large-Scale Scientific Instrument and Equipment Sharing Project of Jilin Province (20150623024TC-03); The Natural Science Foundation for Youths of Jilin Province (20160520104JH).