Genetic algorithms to balanced tree structures in graphs

Genetic algorithms to balanced tree structures in graphs

Swarm and Evolutionary Computation 32 (2017) 132–139 Contents lists available at ScienceDirect Swarm and Evolutionary Computation journal homepage: ...

1MB Sizes 0 Downloads 51 Views

Swarm and Evolutionary Computation 32 (2017) 132–139

Contents lists available at ScienceDirect

Swarm and Evolutionary Computation journal homepage: www.elsevier.com/locate/swevo

Genetic algorithms to balanced tree structures in graphs$ Riham Moharam, Ehab Morsy n Department of Mathematics, Suez Canal University, Ismailia 41522, Egypt

art ic l e i nf o

a b s t r a c t

Article history: Received 22 August 2015 Received in revised form 30 May 2016 Accepted 20 June 2016 Available online 22 June 2016

Given an edge-weighted graph G = (V , E ) with vertex set V and edge set E, we study in this paper the following related balanced tree structure problems in G. The first problem, called Constrained Minimum Spanning Tree Problem (CMST), asks for a rooted tree T in G that minimizes the total weight of T such that the distance between the root and any vertex v in T is at most a given constant C times the shortest distance between the two vertices in G. The Constrained Shortest Path Tree Problem (CSPT) requires a rooted tree T in G that minimizes the maximum distance between the root and all vertices in V such that the total weight of T is at most a given constant C times the minimum tree weight in G. The third problem, called Minimum Maximum Stretch Spanning Tree (MMST), looks for a tree T in G that minimize the maximum distance between all pairs of vertices in V. It is easy to conclude from the literatures that the above problems are NP-hard. We present efficient genetic algorithms that return (as shown by our experimental results) high quality solutions for these problems. & 2016 Elsevier Ltd. All rights reserved.

Keywords: Minimum Spanning Tree Shortest Path Tree Tree Spanner Balanced Spanning Tree Minimum Maximum Stretch Spanning Tree Genetic Algorithms

1. Introduction Let G = (V , E ) be an edge-weighted connected graph with vertex set V and edge set E. Let n and m denote the cardinalities of V and E respectively (i.e., |V | = n and |E| = m). A spanning tree Tm in G is a Minimum Spanning Tree (MST) if there is no other spanning tree in G that attains a total weight less than that of Tm. Kruskal's and Prim's algorithms are well known polynomial time algorithms for computing a minimum spanning tree in weighted graphs. For any vertex r in G, a spanning tree Ts rooted at r is a shortest path tree if, for every vertex v ∈ V , the distance between r and v in Ts equals the shortest distance between the two vertices in G. Dijkstra's algorithm is one of the well known polynomial time algorithms for computing shortest path tree in weighted graphs [44]. Tree structures are widely used in many applications like network routing, communication networks and distributed systems. In particular, the shortest path tree minimizes the delay from the source to every destination through a routing tree, and the minimum spanning tree minimizes the total routing cost along a tree. See [10,21,26,31,45] and the references therein. Thus, balanced tree structures are appropriate routing trees for communication ☆ Preliminary versions of this paper appeared in the proceedings of the Federated Conference on Computer Science and Information Systems and the International Conference on Advanced Intelligent Systems and Informatics, 2015. This research was partially supported by Alexander von Humboldt Foundation. n Corresponding author. E-mail addresses: [email protected] (R. Moharam), [email protected] (E. Morsy).

http://dx.doi.org/10.1016/j.swevo.2016.06.005 2210-6502/& 2016 Elsevier Ltd. All rights reserved.

networks that aim to balance the above two objectives. Also, in the case of concurrent requests through a routing tree, it is required to simultaneously minimize the distances between all vertex pairs in the constructed tree (see [14,25,36] and the references therein). Note that, there exist weighted graphs in which the total weight of a shortest path tree may be much more than that of a minimum spanning tree, and vertices that are close to the designated root can be far away from the root in a minimum spanning tree (see [29] for an illustrative example). A rooted tree in a given graph balances a minimum spanning tree and a shortest path tree if its total weight is at most a constant times the minimum spanning tree weight, and the distance between the root and any vertex in the tree is at most a constant times the shortest distance between the two vertices in the graph. Formally, for any α , β ≥ 1, a rooted spanning tree T in G is called (α , β )-balanced spanning tree if, (i) for every vertex v, the distance between the root and v in T is at most α times the shortest distance between the two vertices in G, and (ii) the total weight of T is at most β times the minimum tree weight in G. Given a constant C ≥ 1, we first consider the following two variants of the (α , β )-balanced spanning tree problem. The Constrained Minimum Spanning Tree Problem (CMST) asks for a tree T in G that minimizes the total weight of T (i.e., minimizes β) such that the distance between the root and any vertex v in T is at most C times the shortest distance between the two vertices in G. A formal definition for the CMST can be described as follow. For any pair of vertices u and v in G, dT (u, v ) (respectively, dG (u, v )) denotes the shortest distance between u and v in T (respectively, G). For a

R. Moharam, E. Morsy / Swarm and Evolutionary Computation 32 (2017) 132–139

subgraph G′ of G, let w (G′) denote the total weight of G′ (i.e., the total weights of all edges in G′). Constrained Minimum Spanning Tree Problem (CMST): Input: An edge-weighted graph G = (V , E ), a root r ∈ V , and a constant C ≥ 1. Feasible solution: A spanning tree T in G such that dT (r , v ) ≤ C ·dG (r , v ) for all v ∈ G . Goal: Find a feasible solution that minimizes w (T ) /w (Tm ). Similarly, the Constrained Shortest Path Tree Problem (CSPT) requires a tree T in G that minimizes the maximum distance between the root and all vertices in G (i.e., minimizes α) such that the total weight of T is at most C times the minimum tree weight in G. This problem can be defined formally as follows. Constrained Shortest Path Tree Problem (CSPT): Input: An edge-weighted graph G = (V , E ), a root r ∈ V , and a constant C ≥ 1. Feasible solution: A spanning tree T in G such that w (T ) ≤ C ·w (Tm ). Goal: Find a feasible solution that minimizes maxv ∈ V dT (r , v ). A tree t-spanner problem is a well known balanced tree structure problem that looks for a tree T in G such that the distance between every pair of vertices in T is at most t times the shortest distance between the two vertices in G. In other words, for any t ≥ 1, a spanning tree T of G is called tree t-spanner if, for any two vertices u and v in G, it holds that dT (u, v ) ≤ t·dG (u, v ). The value of t, called the stretch factor of T, estimates the goodness of the distance approximation of T. In this paper, we are concerned with the Minimum Maximum Stretch Spanning Tree (MMST) problem, the problem of finding a tree t-spanner with the smallest possible stretch factor t [20,35]. A formal description for the MMST is given as follows. Minimum Maximum Stretch Spanning Tree Problem (MMST): Input: An edge-weighted graph G = (V , E ). Feasible solution: A spanning tree T in G. Goal: Find a feasible solution T that minimizes the stretch factor t. It is well known that, for any α , β ≥ 1, the problem of deciding whether G contains an (α , β )-balanced spanning tree is NP-complete [29]. Consequently, the CMST and CSPT problems are NPhard problems. Also, for any t ≥ 1, the problem of deciding whether G contains a tree t-spanner is NP-complete [9], and hence the MMST problem is NP-hard. In this paper, we present efficient genetic algorithms for the above defined problems. Up to our knowledge, these are the first evolutionary algorithms for these problems. Our experimental results show that the proposed algorithms return high quality solutions for the problems. The rest of this paper is organized as follows. Section 2 reviews some results on related problems. Section 3 presents the proposed genetic algorithms. Section 4 evaluates our algorithms by applying it to randomly generated instances of the two problems. Section 5 makes some concluding remarks.

2. Related work In this section, we present results on related problems. Let G = (V , E ) be a given edge-weighted graph. The eccentricity of a vertex v ∈ V is the greatest distance between v and any other vertex in V. The radius of G is the minimum eccentricity of any vertex. The diameter of G is maximum eccentricity of any vertex in the graph. Bharath-Kumar and Jaffe [30] studied the problem of finding a rooted tree in G such that the total distances from the root to all vertices is at most a constant times the minimum total distances from the root to all vertices. A tree in G is called shallow-light tree if its diameter is at most a constant (greater than or equal 1) times the diameter of G and

133

with total weight at most a constant times the minimum spanning tree weight. Awerbuch et al. [2] proved that each graph has a shallow-light tree. Cong et al. [12] proposed a model of timing-driven global routing for cell-based design to improve the construction of a shallow-light tree based on the idea of finding minimum spanning tree with bounded radius. They designed an algorithm to find, for any constant ϵ > 0, a spanning tree with radius (1 + ϵ)·R (using an analog of the classical Prim's minimum spanning tree structure), where R is the minimum possible tree radius. That is, they found a smooth trade-off between the radius and the cost of the tree. Afterwards, they proposed a new method [13] to improve their previous algorithm based on a provably good algorithm that simultaneously minimizes both the total weight and the longest interconnection path length of the tree. More specifically, their algorithm produced a tree with radius at most (1 + ϵ)·R and of total weight at most (1 + 2/ϵ) times the minimum tree weight. Given any α ≥ 1, Awerbuch et al. [3] proposed an algorithm that approximates a minimum spanning tree and a shortest paths tree in G. Namely, they modified the algorithm described in [2,12] to

(

compute an α , 1 +

4 α −1

)-balanced spanning tree in O (m + n log n)

time. Afterwards, Khullar et al. [29] improved the above result and presented a constructive linear time algorithm that outputs an

( α, 1 + )-balanced spanning tree in G. In other words, for any 2 α −1

γ > 0,

(1 +

the

algorithm

2 γ, 1 +

2 γ

of

Khullar

et

al.

[29]

outputs

an

)-balanced spanning tree in linear time.

For unweighted graphs (i.e., all edges in G have unit edge weights), Cai and Corneil [9] produced a linear time algorithm to find a tree t-spanner in G for any given t ≥ 2. Moreover, they showed that, for any t ≥ 4 , the problem of finding a tree t-spanner in G is NP-complete. Brandstädt et al. [7] substantially strengthened the hardness result in [9]. Namely, they showed that, for any t ≥ 4 , tree t-spanner problem is NP-complete even on chordal graphs of diameter at most t + 1 (respectively, t + 2) if t is even (respectively, odd). Afterwards, they proved that the tree t-spanner problem is NP-complete even for chordal bipartite graphs for t ≥ 5 [8]. In [22], Fekete and Kremer showed that it is NP-hard to determine a minimum value for t for which a tree t-spanner exists even for planar unweighted graphs. They designed a polynomial time algorithm that decides if the planar unweighted graphs with bounded face length contains a tree t-spanner for any fixed t. Moreover, they proved that for t ¼3, it can be decided whether the unweighted planar graph has a tree t-spanner in polynomial time. The problem was left open whether a tree t-spanner is polynomial time solvable in case of t ≥ 4 . Later, this problem is solved by Dragan et al. [15]. For any fixed t, they showed that it is possible in polynomial time not only to decide if a planar graph G has a tree tspanner, but also to decide if G has a t-spanner of bounded treewidth. In particular, for every fixed values of t and k, they showed that the problem, for a given planar graph G to decide if G has a tspanner of treewidth at most k, is not only polynomial time solvable, but is fixed parameter tractable (with k and t being the parameters). Recently, Dragan and Köhler [16] examined the tree t-spanner on chordal graphs, generalized chordal graphs, and general graphs. For unweighted graphs G, they proposed a new algorithm that constructs a tree ( 2⌈t /2⌉⌊ log2n⌋)-spanner in O(mn log2n) time or a tree ( 6t⌊ log2n⌋)-spanner in O( m log n) time for the arbitrary graphs. After that, they improved these results and constructed a tree (2⌊ log2n⌋)-spanner in O(m log n) time for chordal graphs. Also, they constructed a tree ( 2ρ⌊ log2n⌋)-spanner in O(m log2n) time or a tree ( 12ρ⌊ log2n⌋)-spanner in O( m log n) time for graphs that confess a Robertson–Seymour's tree-decomposition [16]. In

134

R. Moharam, E. Morsy / Swarm and Evolutionary Computation 32 (2017) 132–139

particular, they produced the same approximation ratio as in [20] but in a better running time. In this paper, we present the first evolutionary algorithms for the three problems CMST, CSPT, and MMST defined in the previous section. The experimental results show that the proposed algorithms return high quality solutions for the problems.

3. Genetic algorithm In this section, we propose genetic algorithms to CMST, CSPT and MMST problems defined in Section 1. We first briefly describe the main steps of typical genetic algorithms in the next subsection. For a subgraph G′ of a given graph G, the sets V (G′) and E (G′) denote the sets of vertices and edges of G′, respectively. 3.1. Algorithm overview The Genetic Algorithm (GA) is an iterative optimization approach based on the principles of genetics and natural selection [19]. The first step of genetic algorithms is to determine a suitable data structure to represent individual solutions (chromosomes), and then construct an initial population (first generation) of a prescribed cardinality pop − size . A typical intermediate iteration of genetic algorithms can be outlined as follows. Starting with the current generation, we use a predefined selection technique to repeatedly choose a pair of individuals (parents) in the current generation to reproduce, with probability pc, a new set of individuals (offsprings) by applying crossover operation to the selected pair. To keep an appropriate diversity among different generations, we apply mutation operation with specific probability pm to genes of individuals of the current generation to get more offsprings. A new generation is then selected from both the set of offsprings and the current generation based on their fitness values (the more suitable solutions have more chances to be included in the next generation). The algorithm terminates when it meets prescribed stopping criteria. A formal description of the proposed genetic algorithm is given in Algorithm 1. Algorithm 1. Genetic algorithm for the balanced tree structures. 1. Compute an initial population I0 (cf. Section 3.3). 2. gen ← 1. 3. While ( gen ≤ maxgen) do 4. For i¼1 to pop − size do 5. Select a pair of chromosomes from Igen-1 (cf. Section 3.5). 6. Apply crossover operator with probability pc to the selected pair of chromosomes to get two offsprings (cf. Section 3.6). 7. Endfor 8. For each chromosome in Igen  1, apply mutation operator with probability pm to get an offspring (cf. Section 3.7). 9. Extend Igen  1 with feasible offsprings output from lines 6 and 8. 10. Find a chromosome Tgen  1 in Igen  1 that has the minimum fitness value (cf. Section 3.4). 11. If gen ≥ 2 and w (Tgen − 2 ) = w (Tgen − 1) = w (Tgen ), then break. Select pop − size chromosomes from Igen-1 to form Igen (cf. Section 3.5). 13. gen ← gen + 1. 14. Endwhile 15. Output Tgen. 12.

In genetic algorithms, determining representation method, population size, selection technique, crossover and mutation

probabilities, and stopping criteria are crucial since they mainly affect the convergence of the algorithm (see [1,24,32,39,43]). Note that, checking the feasibility of an offspring in Step 9 of the algorithm takes linear time. Namely, given a rooted spanning tree in the underlying graph, it takes linear time to compute the total weight of the tree, and the distances between the root and all vertices. The rest of this section is devoted to describe steps of Algorithm 1 in details. 3.2. Representation Choosing a proper representation to encode an individual solution (chromosome) may affect the performance of the algorithm. There are three common encoding methods that can be used to encode spanning trees in genetic algorithms; characteristic vectors-based encoding [17,37], node-based encoding [33], and edgebased encoding [42]. Recently, many studies have showed that edge-based encoding is the most appropriate method for representing spanning trees for the problems affected by edge weights and applying operators that always yield feasible trees [4,23,27,38,42]. Raidl and Julstrom [38] presented a comparison study on common spanning tree representations. In general, they showed that, for evolutionary algorithms, edge-based representation is the best representation especially for large and hard problem instances. Vector-based encoding uses a vector of binary numbers to indicate whether each edge of the underlying graph is a part of the solution or not. This implies that the vectorbased representation is inefficient from the space complexity point of view since it uses large space even if the graph is sparse. On the other hand, node-based encoding, also called Prüfer number-based encoding, requires complex encoding and decoding processes between chromosomes and solutions (Prüfer numbers can be encoded and decoded in O (n log n)), and hence it is inefficient from the computation point of view. Moreover, Prüfer numbers have poor locality and heritability properties and are thus unsuitable for evolutionary search. This motivates us to use edge-based representation in the proposed algorithms. Let G = (V , E ) be a given undirected graph such that V = {1, 2, … , n}. Note that, each edge e ∈ E with end points i and j can be defined by an unordered pair {i, j}, and consequently, any subgraph G′ of G is uniquely defined by the set of unordered pairs of all its edges. In particular, any spanning tree T in G is induced by a set of exactly n − 1 pairs corresponding to its edges since T is a subgraph of G that spans all vertices in V and has no cycles. Therefore, each chromosome (spanning tree) can be represented as a sequence of unordered pairs of integers each of which represent a gene (edge) in the chromosome. 3.3. Initial population Before initializing the first generation of the genetic algorithm, we have to first decide its size pop − size . As mentioned before, this decision on population size affect the convergence of the algorithm. In particular, small population sizes may lead to weak solutions, while, large population sizes increase the space and time complexity of the algorithm. Many literatures studied the influence of the population size to the performance of genetic algorithms (see [39] and the references therein). In this paper, we discuss the effect of the population size on the convergence time of the algorithm (cf. Section 4). We apply random initialization to generate an initial population. Namely, we compute each chromosome in the initial population by repeatedly applying the following simple procedure as long as the length of the chromosome (number of edges) is less than n − 1. Let T denote the tree constructed so far by the

R. Moharam, E. Morsy / Swarm and Evolutionary Computation 32 (2017) 132–139

procedure (initially, T consists of a random vertex from V(G)). We first select a random vertex v ∉ V (T ) from the set of the neighbors of all vertices in T, and then add the edge e = (u, v ) to T, where u is the neighbor of v in T. It is easy to verify that the above procedure returns a tree after exactly n − 1 iterations. The generated tree T is added to the initial population only if it is a feasible solution to the corresponding problem (cf. Section 1). The above procedure is repeated as long as the number of spanning trees in the current initial population is less than pop − size . 3.4. Fitness function In this section, we define the fitness value of an individual (chromosome) tree T, denoted by fv(T), for the CMST, CSPT, and MMST problems. Let ov(T) denote the objective value of T. Recall that, for the CMST problem, ov(T) equals the ratio of the total weight of T to that of the minimum spanning tree, i.e., w (T ) ov (T ) = w (T ) .

135

total fitness values of all chromosomes in the set from which it will be selected. Stochastic Universal Sampling Selection (SUS): [6,11] It is a single phase sampling; instead of a single selection pointer used in roulette wheel approach, SUS uses h equally spaced pointers, where h is the number of chromosomes to be selected from the underlying population. Formally, all chromosomes are represented in number line randomly and a single random pointer ptr ∈ 0, h1 ⎤⎦ is generated to indicate the first chromosome to be selected. The remaining h − 1 individuals whose fitness spans the positions of the pointers ptr + i/h, i = 1, 2, … , h − 1 are then chosen. Tournament Selection (TRWS): [6,19] This is a two stages selection technique. We first select a set of k < pop − size chromosomes randomly from the current population. From the selected set, we choose the more fit chromosome by applying the roulette wheel selection approach. Tournament selection is performed according to the required number of chromosomes.

(

m

Similarly, the maximum ratio of the minimum distance between the root and a vertex in T to the minimum distance between the two vertices in the underlying graph defines the objective d (r , v ) value ov(T) of T in the CSPT problem, i.e., ov (T ) = maxv ∈ V (G) dT (r , v) . G

Finally, for the MMST, the maximum ratio of the minimum distance between a pair of vertices in T to the minimum distance in G defines the objective value ov(T) of T, i.e., d (u, v ) ov (T ) = maxu, v ∈ V (G) dT (u, v) . G

Note that the above combinatorial optimization problems are minimization problems (cf. Section 1), and hence chromosomes of minimum objective values have good chances to survive and reproduce. Thus, the fitness value fv(T) of a chromosome T is defined to be the reciprocal of its objective value ov(T) throughout the execution of the proposed genetic algorithms, i.e., fv (T ) = 1/ov (T ). 3.5. Selection process In this paper, we apply three common selection techniques: roulette wheel selection, stochastic universal sampling selection, and tournament selection. All these techniques are called fitnessproportionate selection techniques since they are based on a predefined fitness function used to evaluate the quality of individual chromosomes. We assume that, in an execution of the algorithm, the same selection technique is used throughout the crossover process, mutation process, and the process of choosing the next generation. The rest of this section is devoted to briefly describe these selection techniques. Roulette Wheel Selection (RWS): [11,19] In the Roulette wheel technique, the probability of selecting a chromosome from the underlying population is based on its fitness value. More precisely, each chromosome is selected with the probability that equals to its normalized fitness value, i.e., the ratio of its fitness value to the

3.6. Crossover process In each iteration of the algorithm we repeatedly select a pair of chromosomes (parents) from the current generation and then apply crossover operator with probability pc to the selected chromosomes to get new chromosomes (offsprings). Simulations and experimental results of the literatures show that a typical crossover probability lies between 0.75 and 0.95. There are two common crossover techniques: single-point crossover and multi-point crossover. Many researchers studied the influence of crossover approach and crossover probability to the efficiency of the whole genetic algorithm, see for example [31,43] and the references therein. In this paper, we use a multi-point crossover approach by exchanging a randomly selected set of edges between the two parents. In particular, we repeat the following procedures pop − size times. We select a pair of chromosomes T1 and T2 from the current generation, we generate a random number s ∈ (0, 1], and apply the following crossover operation to T1 and T2 if s < pc holds. Define the two sets E1 = E (T1) − E (T2 ) and E2 = E (T2 ) − E (T1) ( |E1| = |E2 | holds). Let t = |E1| = |E2 |, and generate a random number k from [1, t ]. We first choose a random subset E1′ of cardinality k from E1, and then add E1′ to T2 to get a subgraph T′ (i.e., T′ = T2 ∪ E1′). Clearly, T′ contains k cycles each of which contains a distinct edge from E1′. For every edge e = (u, v ) in E1′, we apply the following ∼ procedure to fix a cycle containing e. Let T be the current subgraph ∼ (initially, T = T′). We first find a path P T∼(u, v ) between u and v in ∼ the set of edges E (T ) − {e}. We then choose an edge e∼ in P T∼(u, v ) ∼ randomly and delete it from the subgraph T . See Fig. 1 for an illustrative example of the crossover operation. Similarly, we apply the above crossover technique by interchanging the roles of T1 and T2 to get one more offspring. Note

Fig. 1. An example of crossover process applying to parents T1 and T2 in (a) and (b), respectively. E1 = E (T1) − E (T2 ) = {e1, e2, e3 } (solid edges that in (a)). (c) k ¼ 2 edges are selected from E1 (solid edges in (c)) and added to T2. (d) Fixing the cycles to get a new offspring.

136

R. Moharam, E. Morsy / Swarm and Evolutionary Computation 32 (2017) 132–139

that, we only consider the feasible offsprings as candidate chromosomes for the next generation. 3.7. Mutation process To maintain the diversity among different generations of the population (and hence avoid local minimum), we apply a genetic (mutation) operator to chromosomes of the current generation with predefined (usually small) probability pm. Namely, for each chromosome T, we generate a random number s ∈ (0, 1], and then mutate T if s < pm holds by replacing a random edge (gene) in T with a random edge from E (G ) − E (T ). Many results analyzed the role of mutation operator in genetic algorithms [1,24,31]. Formally, a chromosome T is mutated as follows. We first select a random edge e = (u, v ) in the graph G but not in the chromosome T, i.e., e is randomly chosen from the set E (G ) − E (T ) of edges. It is easy to see that the subgraph E (T ) ∪ {e} contains exactly one cycle including e. We then select a random edge e′ in the path PT (u, v ) between u and v in T. Let T′ denote the offspring obtained from T by exchanging the two edges e and e′, i.e., E (T′) = (E (T ) − {e}) ∪ {e′}. See Fig. 2 for an illustrative example of the mutation process. The resulting spanning tree T′ is considered as a candidate chromosome for the next iteration if it is feasible solution of the corresponding problem.

the network size. It is seen from the results presented in this section that the obtained trees are optimal solutions for almost all instances the algorithms apply to. All results presented in this section were performed in MATLAB R2014b on a computer powered by a core i7 processor and 16 GB RAM under ubuntu 14.04 LTS system. We first discuss the effect of the population size on the computational time of the whole algorithm. 4.1. The effect of population size and selection technique For the sake of determining the appropriate population size pop − size , we apply the proposed algorithms with population sizes n , n/3, 2n/3, n, 4n/3, 5n/3, 2n, 7n/3, 8n/3, and n log n, where n is the graph size. The obtained results show that the change in the computational time is insignificant as long as the population size is set to constant multiples of n (i.e., pop − size = cn for a constant c > 0), and n is the most appropriate value for the population size (see Figs. 3–8). Figs. 3–8 show that the computational times of the algorithms are almost equal when Roulette Wheel and Stochastic Universal Sampling selection techniques, and both are less than that of Tournament selection technique. The reason is that Tournament selection technique is a two stages selection technique as described in Section 3.5.

4. Experimental results 4.2. Performance of the proposed genetic algorithms In this section, we evaluate the proposed genetic algorithms by applying them to several random instances of the studied problems. These instances are generated by applying Erdos and Renyi [18] approach in which an edge is independently included between each pair of nodes with randomly chosen probability p ∈ [0, 1]. Here, we generate random graphs with sizes 50 and 100, and the edge weights are randomly assigned from the range [1, 100]. We apply the proposed algorithms with maximum number of iterations maxgen ¼300, crossover probability pc ¼0.9, and mutation probability pm ¼0.2. The algorithms terminates if either the number of iterations exceeds maxgen or the solution does not change for three consecutive iterations. All obtained solutions are compared with the corresponding optimal solutions computed by considering all possibilities of feasible spanning trees in the underlying graphs. Many approaches have been proposed to generate all spanning trees of an undirected graph [5,28,34,40,41]; the running times of them are based on the number of spanning trees in the graph. Kapoor and Ramesh [28] proposed the best known approach for listing all spanning trees in an undirected weighted graph. They proved that all spanning trees in an undirected weighted graph of size n can be listed in O(nN) time, where N refers to the number of spanning trees in the graph. Note that, in most networks, the number of spanning trees N is exponential in

In this section we show the performance of the proposed genetic algorithms by applying them to different instances of the CMST, CSPT, and MMST problems. Tables 1 and 2 show the results of the algorithm for CMST instances of sizes 50 and 100, respectively. The results of the algorithm for CSPT instances of sizes 50 and 100 are shown in Tables 3 and 4, respectively. Table 5 presents the results of the algorithm for MMST instances of sizes 50 and 100. Finally, we study the effect of the number of edges of the underlying graph on the computational time of the proposed algorithms. Here, we apply the proposed algorithms to random graphs, each of size 100, with different number of edges ranging from 500 to the maximum number of edges that each graph can have (i.e., n (n − 1) /2 = 4950). Fig. 9 shows that the execution time of the algorithms increase as the number of edges increases.

5. Conclusion In this paper, we have studied three balanced tree structure problems in a given edge-weighted graph G, the Constrained Minimum Spanning Tree (CMST), the Constrained Shortest Path

Fig. 2. An example of mutation process. (a) A random edge e is selected from the set E (G ) − E (T ) . (b) The cycle is fixed by selecting a random edge e′ in P T (4, 5) . (c) The resulting offspring.

R. Moharam, E. Morsy / Swarm and Evolutionary Computation 32 (2017) 132–139

137

Fig. 3. The influence of pop − size on the running time of the algorithm for the CMST with n¼ 50 and C¼1.3.

Fig. 6. The influence of pop − size on the running time of the algorithm for the CSPT with n ¼100 and C¼ 1.3.

Fig. 4. The influence of pop − size on the running time of the algorithm for the CMST with n¼ 100 and C¼ 1.3.

Fig. 7. The influence of pop − size on the running time of the algorithm for the MMST with n¼ 50 and C ¼1.3.

Fig. 5. The influence of pop − size on the running time of the algorithm for the CSPT with n¼ 50 and C¼ 1.3.

Fig. 8. The influence of pop − size on the running time of the algorithm for the MMST with n¼ 100 and C¼ 1.3.

138

R. Moharam, E. Morsy / Swarm and Evolutionary Computation 32 (2017) 132–139

Table 1 Objective values of the optimal and the obtained solutions of the CMST in a graph with size n ¼50. C

1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2

ov(T)

Table 5 Objective values of optimal solution and the obtained solutions of the MMST in graphs of sizes 50 and 100. n

ov(T)-Optimal

ov(T)-RWS

ov(T)-SUS

ov(T)-TRWS

1.176 1.176 1.121 1.121 1.099 1.059 1.059 1.012 1 1

1.176 1.176 1.121 1.121 1.099 1.059 1.059 1.012 1 1

1.176 1.176 1.176 1.121 1.099 1.099 1.059 1.012 1 1

1.176 1.176 1.121 1.121 1.099 1.059 1.059 1.012 1 1

50 100

ov(T) ov(T)-Optimal

ov(T)-RWS

ov(T)-SUS

ov(T)-TRWS

1.109 1.148

1.109 1.148

1.109 1.178

1.109 1.148

Table 2 Objective values of the optimal and the obtained solutions of the CMST in a graph with size n ¼100. C

1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2

ov(T) ov(T)-Optimal

ov(T)-RWS

ov(T)-SUS

ov(T)-TRWS

1.128 1.128 1.108 1.108 1.072 1.072 1.049 1.049 1 1

1.128 1.128 1.108 1.108 1.083 1.072 1.049 1.049 1 1

1.128 1.128 1.177 1.108 1.083 1.072 1.072 1.049 1 1

1.128 1.128 1.108 1.108 1.072 1.072 1.049 1.049 1 1

Table 3 Objective values of the optimal and the obtained solutions of the CSPT in a graph with size n ¼50. C

1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9

ov(T) ov(T)-Optimal

ov(T)-RWS

ov(T)-SUS

ov(T)-TRWS

1.320 1.320 1.187 1.187 1.115 1.101 1.075 1.075 1

1.320 1.320 1.187 1.187 1.115 1.101 1.075 1.075 1

1.416 1.320 1.320 1.187 1.115 1.101 1.075 1.075 1

1.320 1.320 1.187 1.187 1.115 1.101 1.075 1.075 1

Table 4 Objective values of the optimal and the obtained solutions of the CSPT in a graph with size n ¼100. C

1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9

ov(T) ov(T)-Optimal

ov(T)-RWS

ov(T)-SUS

ov(T)-TRWS

1.113 1.113 1.096 1.096 1.064 1.064 1.033 1 1

1.113 1.113 1.096 1.096 1.064 1.064 1.033 1 1

1.113 1.113 1.096 1.096 1.064 1.064 1.033 1.033 1

1.113 1.113 1.096 1.096 1.064 1.064 1.033 1 1

Fig. 9. The influence of the number of edges on the running time of the algorithm for instances of size 100.

Tree (CSPT), and the Minimum Maximum Stretch Spanning Tree (MMST). In the CMST (respectively, CSPT), we are given an upper bound on how far the required tree is from the shortest path tree (respectively, the minimum spanning tree), and the objective is to find the closest tree to the minimum spanning tree (respectively, the shortest path tree) under this bound. The MMST aims to construct a spanning tree in G such that the maximum ratio of the distances between every pair of vertices in this tree to the shortest distance between the two vertices in G is minimized. It is easy to conclude from the literatures that the above problems are NPhard. We have designed genetic algorithms for these problems evaluated by applying them to random graph instances. The proposed algorithms output hight quality spanning trees for all instances they have been applied to. It might be interesting to relax our model to construct balanced spanning subgraphs instead of trees (balanced subgraph structures).

References [1] O. Abdoun, J. Abouchabaka, C. Tajani, Analyzing the performance of mutation operators to solve the travelling salesman problem, Int. J. Emerg. Sci. IJES 2 (1) (2012) 61–77. [2] B. Awerbuch, A. Baratz, D. Peleg, Cost-sensitive analysis of communication protocols, in: Proceedings on Principles of Distributed Computing, 1990, pp. 177–187. [3] B. Awerbuch, A. Baratz, D. Peleg, Efficient Broadcast and Light-weight Spanners, Manuscript, 1991. [4] S. Arora, M.L. Garg, Strongly biased crossover operator for subgraph selection in edge-set based graph representation, in: Proceedings of the 3th International Conference on Soft Computing for Problem Solving, Springer, Roorkee, India, 2014, pp. 601–612. [5] B. Biswas, K. Basuli, S. Naskar, S. Chakraborti, S.S. Sarma, A Combinatorial Algorithm to Generate All Spanning Trees of A Weighted Graph in Order of Increasing Cost, arXiv preprint arXiv:1209.4206, 2012. [6] T. Blickle, L. Thiele, A comparison of Selection Schemes Used in Genetic Algorithms (Technical Report No. 11), Swiss Federal Institute of Technology (ETH) Zurich, Computer Engineering and Communications Networks Lab (TIK),

R. Moharam, E. Morsy / Swarm and Evolutionary Computation 32 (2017) 132–139

1995. [7] A. Brandstädt, F.F. Dragan, H.-O. Le, V.B. Le, Tree spanners on chordal graphs: complexity and algorithms, Theor. Comput. Sci. (2004) 329–354. [8] A. Brandstädt, F.F. Dragan, H.-O. Le, V.B. Le, R. Uehara, Tree spanners for bipartite graphs and probe interval graphs, Algorithmica (2007) 27–51. [9] L. Cai, D. Corneil, Tree spanners, SIAM J. Discrete Math. (1995) 359–387. [10] R. Campos, M. Ricardo, A fast algorithm for computing minimum routing cost spanning trees, Comput. Netw. 52 (17) (2008) 3229–3247. [11] A. Chipperfield, P. Fleming, H. Pohlheim, C. Fonseca, The Matlab Genetic Algorithm User's Guide, UK SERC, 1994. [12] J. Cong, A. Kahng, G. Robins, M.Sarrafzadeh, C.K. Wong, Performance-driven global routing for cell based IC's, in: Proceedings of IEEE International Conference on Computer Design, 1991, pp. 170–173. [13] J. Cong, A. Kahng, G. Robins, M. Sarrafzadeh, C.K. Wong, Provably good performance-driven global routing, IEEE Trans. CAD (1992) 739–752. [14] M.J. Demmer, M.P. Herlihy, The arrow distributed directory protocol, in: Proceeding of the 12th International Symposium on Distributed Computing (DISC), Springer, Andros, Greece, 1998, pp. 119–133. [15] F.F. Dragan, F.V. Fomin, P.A. Golovach, Spanners in sparse graphs, J. Comput. Syst. Sci. (2010) 1108–1119. [16] F.F. Dragan, E. Köhler, An approximation algorithm for the tree t-spanner problem on unweighted graphs via generlized chordal graphs, Algorithmica (2014) 884–905. [17] L. Davis, D. Orvosh, A. Cox, Y. Qiu, A genetic algorithm for survivable network design, in: Proceedings of the 5th International Conference on Genetic Algorithms, 1993, pp. 408–415. [18] P. Erdos, A. Renyi, On random graphs, Publ. Math. 290 (1959). [19] A.P. Engelbrecht, Computational Intelligence: An Introduction, John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex PO19 8SQ, England, 2007. [20] Y. Emek, D. Peleg, Approximating minimum max-stretch spanning trees on unweighted graphs, SIAM J. Comput. (2008) 1761–1781. [21] A.M. Farley, D. Zappala, A. Proskurowski, K. Windisch, Spanners and message distribution in networks, Dicr. Appl. Math. (2004) 159–171. [22] S.P. Fekete, J. Kremer, Tree spanners in planar graphs, Discrete Appl. Math. (2001) 85–103. [23] J. Gottlieb, B.A. Julstrom, F. Rothlauf, G.R. Raidl, Prüfer numbers: a poor representation of spanning trees for evolutionary search, in: Proceedings of the 2001 Genetic and Evolutionary Computation Conference, 2001, pp. 343–350. [24] J. Hesser, R. Männer, Towards an optimal mutation probability for genetic algorithms, in: Proceedings of 1st Workshop in Parallel Problem Solving From Nature, 1991, pp. 23–32. [25] M. Herlihy, S. Tirthapura, R. Wattenhofer, Competitive concurrent distributed queuing, in: Proceedings of the 20th Annual ACM Symposium on Princibles of Distributed Computing, 2001, pp. 127–133. [26] G. Huang, X. Li, J. He, Dynamic minimal spanning tree routing protocol for large wireless sensor networks, in: Proceedings of the 1st IEEE Conference on

139

Industrial Electronics and Applications, Singapore, 2006, pp. 1–5. [27] B.A. Julstrom, Encoding rectilinear Steiner trees as lists of edges, in: Proceedings of the 16th ACM Symposium on Applied Computing, 2001, pp. 356– 360. [28] S. Kapoor, H. Ramesh, Algorithms for enumerating all spanning trees of undirected and weighted graphs, SIAM J. Comput. 24.2 (1995) 247–265. [29] S. Khullar, B. Raghavachari, N. Young, Balancing minimum spanning trees and shortest-path trees, Algorithmica 14 (1995) 305–322. [30] K.B. Kumar, J.M. Jaffe, Routing to multiple destinations in computer networks, IEEE Trans. Commun. 31 (3) (1983) 343–351. [31] C. Li, H. Zhang, B. Hao, J. Li, A survey on routing protocols for large-scale wireless sensor networks, Sensors 11 (2011) 3498–3526. [32] W.Y. Lin, W.Y. Lee, T.P. Hong, Adapting Crossover and Mutation Rates in Genetic Algorithms, in: the Sixth Conference on Artificial Intelligence and Applications, Kaohsiung, Taiwan, 2001. [33] R. Mathur, I. Khan, V. Choudhary, Genetic algorithm for dynamic capacitated minimum spanning tree, Int. J. Comput. Technol. Appl. 4 (2013) 404–413. [34] T. Matsui, An algorithm for finding all the spanning trees in undirected graphs, Department of Mathematical Engineering and Information Physics, Faculty of Engineering, University of Tokyo, vol. 16, 1993, pp. 237–252. [35] D. Peleg, J.D. Ulman, An optimal sychronizer for the hypercube, SIAM J. Comput. (1989) 740–747. [36] D. Peleg, E. Reshef, Low complexity variants of the arrow distributed directory, J. Comput. Syst. Sci. (2001) 474–485. [37] P. Piggott, F. Suraweera, Encoding graphs for genetic algorithms: an investigation using the minimum spanning tree problem, Progress in Evolutionary Computation, Springer, Berlin Heidelberg 1995, pp. 305–314. [38] G.R. Raidl, B.A. Julstrom, Edge-sets: an effective evolutionary coding of spanning trees, IEEE Trans. Evolut. Comput. (2003). [39] O. Roeva, S. Fidanova, M. Paprzycki, Influence of the population size on the genetic algorithm performance in case of cultivation process modelling, in: the Proceedings of the Federated Conference on Computer Science and Information Systems, 2013, pp. 371–376. [40] A. Shioura, A. Tamura, T. Uno, An optimal algorithm for scanning all spanning trees of undirected graphs, SIAM J. Comput. 26.3 (1997) 678–692. [41] K. Sörensen, G.K. Janssens, An algorithm to generate all spanning trees of a graph in order of increasing cost, Pesq. Oper. 25.2 (2005) 219–229. [42] Q.P. Tan, A genetic approach for solving minimum routing cost spanning tree problem, Int. J. Mach. Learn. Comput. 2 (4) (2012) 410–414. [43] K. Vekaria, C. Clack, Selective crossover in genetic algorithms: an empirical study, Lecture Notes in Computer Science 1498 (1998) 438–447. [44] B.Y. We, K. Chao, Spanning Trees and Optimization Problems, Chapman & Hall, Boca Raton, USA, 2004. [45] B. Xiao, Q. ZhuGe, E.H.M. Sha, Minimum dynamic update for shortest path tree construction, in: Global Telecommunications Conference, San Antonio, TX, 2001, pp. 126–130.