11.07.2015 Views

Using Ants to Find Degree-Constrained Minimum Spanning Trees

Using Ants to Find Degree-Constrained Minimum Spanning Trees

Using Ants to Find Degree-Constrained Minimum Spanning Trees

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

We approve the thesis of Catherine Zrncic.Date of SignatureThang N. BuiAssociate Professor of Computer ScienceChair, Mathematics and Computer Science ProgramsThesis AdvisorSukmoon ChangAssistant Professor of Computer ScienceQin DingAssistant Professor of Computer ScienceLinda M. NullAssistant Professor of Computer ScienceGraduate Coordina<strong>to</strong>r


I grant The Pennsylvania State University the non-exclusive right <strong>to</strong> use this workfor the University’s own purposes and <strong>to</strong> make single copies of the work available<strong>to</strong> the public on a not-for-profit basis if copies are not otherwise available.Catherine Zrncic


The Pennsylvania State UniversityThe Graduate SchoolUSING ANTS TO FINDDEGREE-CONSTRAINED MINIMUMSPANNING TREESA Thesis inComputer SciencebyCatherine Zrncicc○ 2006 Catherine ZrncicSubmitted in Partial Fulfillmen<strong>to</strong>f the Requirementsfor the <strong>Degree</strong> ofMaster of ScienceMay 2006


The thesis of Catherine Zrncic was reviewed and approved ∗ by the following:Thang N. BuiAssociate Professor of Computer ScienceChair, Mathematics and Computer Science ProgramsThesis AdvisorSukmoon ChangAssistant Professor of Computer ScienceQin DingAssistant Professor of Computer ScienceLinda M. NullAssistant Professor of Computer ScienceGraduate Coordina<strong>to</strong>r∗ Signatures are on file in the Graduate School.


AbstractA spanning tree of a graph such that each vertex in the tree has degree at mostd is called a degree-constrained spanning tree. The problem of finding the degreeconstrainedspanning tree of minimum cost in an edge weighted graph is wellknown <strong>to</strong> be NP-hard. In this thesis we give an ant-based algorithm for findinglow cost degree-constrained spanning trees. <strong>Ants</strong> are used <strong>to</strong> identify a set ofcandidate edges from which a degree-constrained spanning tree can be constructed.Extensive experimental results show that the algorithm performs very well againstseven other algorithms on a set of 572 problem instances.iii


List of Figures2.1 Genetic Algorithm Structure . . . . . . . . . . . . . . . . . . . . . . 53.1 The AB-DCST Algorithm . . . . . . . . . . . . . . . . . . . . . . . 123.2 One Step in the Ant Movement Algorithm . . . . . . . . . . . . . . 143.3 Tree Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.1 AB-DCST Running Time . . . . . . . . . . . . . . . . . . . . . . . 275.1 Misleading Clustered Graph . . . . . . . . . . . . . . . . . . . . . . 31vi


List of Tables3.1 AB-DCST Algorithm Parameters . . . . . . . . . . . . . . . . . . . 193.2 Running Time of AB-DCST . . . . . . . . . . . . . . . . . . . . . . 244.1 Graph Types Used for Testing the AB-DCST Algorithm . . . . . . 26A.1 Data for Coordinate (CRD) Graphs . . . . . . . . . . . . . . . . . . 33A.2 Data for Symmetric (SYM) Graphs . . . . . . . . . . . . . . . . . . 34A.3 Data for Structured (STR) Graphs . . . . . . . . . . . . . . . . . . 34A.4 Data for Random Graphs . . . . . . . . . . . . . . . . . . . . . . . 35A.5 Data for Structured Hard (SHRD) Graphs . . . . . . . . . . . . . . 36A.6 Data for Random Hard (R) Graphs . . . . . . . . . . . . . . . . . . 36A.7 Data for Misleading Hard (M) Graphs . . . . . . . . . . . . . . . . 37vii


AcknowledgementsI would like <strong>to</strong> thank Joshua Knowles, Gunther Raidl, Andreas Ernst, and KarenHonda for providing the test graphs that made my comparisons possible. I amalso grateful <strong>to</strong> Dr. Thang Bui, my thesis advisor, for his guidance throughoutthe thesis process. Additionally, I would like <strong>to</strong> thank the members of the thesiscommittee, Dr. Sukmoon Chang, Dr. Qin Ding, and Dr. Linda Null, for theirvaluable feedback.viii


Chapter 1IntroductionThis thesis describes an ant-based algorithm for the degree-constrained minimumspanning tree (DCMST) problem. This is an interesting, real-world problem thatseems well suited <strong>to</strong> an ant algorithm approach. Numerous genetic algorithmshave been used <strong>to</strong> solve the DCMST problem, but <strong>to</strong> our knowledge this is thefirst ant-based algorithm for this problem.The DCMST problem entails finding a spanning tree of minimum cost suchthat no vertex in the tree exceeds a given degree constraint. This concept is usefulin designing networks for everything from computer and telephone communications<strong>to</strong> transportation and sewage systems [18][26]. For instance, switches in anactual communication network each have a limited number of connections available.Transportation systems must place a limit on the number of roads or tracksmeeting in one place – imagine trying <strong>to</strong> navigate an intersection where 15 roadscross! Additionally, limiting the degree of each node limits the potential impact ifa node fails [16].While the unconstrained minimum spanning tree (MST) problem can be solvedeasily in polynomial time, the DCMST problem is NP-hard [14]. In fact, even approximatingoptimal DCMST solutions within a constant fac<strong>to</strong>r is NP-hard [2][16].Therefore, heuristics are needed <strong>to</strong> find good solutions in a reasonable amount oftime. Recent work on the DCMST problem, as described in Section 2.4, has focusedon genetic algorithms (GAs) and finding more efficient representations <strong>to</strong>


1 INTRODUCTION 2use with those algorithms.Ant algorithms have been used <strong>to</strong> solve other types of constrained MST problemsincluding the capacitated MST [23], generalized MST [27], and k-cardinalitytree [6] problems. However, this approach has not previously been applied <strong>to</strong> theDCMST problem. In an ant algorithm, artificial ants maneuver based on localinformation and deposit pheromones as they travel. Our algorithm uses cumulativepheromone levels <strong>to</strong> determine candidate sets of edges from which degreeconstrainedspanning trees are built. Extensive experimental results show that thisant-based algorithm finds results that are generally better than results producedby existing GAs. The addition of a local optimization step, which is not implementedin the current algorithm, could further enhance performance, particularlyfor graphs designed <strong>to</strong> mislead greedy algorithms.The rest of this thesis is organized as follows. Chapter 2 provides a formaldefinition of the problem and describes previous works. Our ant-based algorithmis described in Chapter 3. Chapter 4 compares the performance of this algorithmagainst existing algorithms on a set of benchmark problems. The conclusion isgiven in Chapter 5. Portions of this thesis also appear in [7].


Chapter 2Preliminaries2.1 Problem DefinitionA tree is a connected set of edges and vertices that does not contain any cycles.A spanning tree of a graph G is a subgraph of G that is a tree and has the samenumber of vertices as G. An undirected graph G is said <strong>to</strong> be complete if thereis an edge between any pair of distinct vertices, i.e., no self-loop is allowed. Aweighted graph has a weight function w : E → R that associates a weight, or cost,with each edge in the graph. The weight of a tree is the sum of the weights forall edges in that tree. The degree constrained minimum spanning tree (DCMST)problem can be formally defined as follows:Input: An undirected complete graph G = (V, E) with non-negative weights onthe edges and an integer degree constraint d ≥ 2.Output: A spanning tree of G with minimum <strong>to</strong>tal edge weight such that thedegree of each vertex in the tree is ≤ d.Another way <strong>to</strong> view the DCMST problem is through its relationships withother NP-Hard problems. Consider a degree constraint of d = 2. Each vertex inthe resulting DCMST will have degree at most 2, so the tree will also be a path.Specifically, it will be a Hamil<strong>to</strong>nian Path – a simple path containing each vertexin the graph exactly once. If the ends of that path were connected, the resultwould be a Hamil<strong>to</strong>nian Cycle – a simple cycle containing each vertex in the graph


2 PRELIMINARIES 4exactly once. The lowest cost Hamil<strong>to</strong>nian Cycle of a complete graph is an optimalsolution <strong>to</strong> the Traveling Salesman Problem (TSP). Removing the most expensiveedge from an optimal TSP <strong>to</strong>ur (i.e., the best <strong>to</strong>ur for any starting city, not aspecific starting city) would result in a DCMST with d = 2.The TSP, Hamil<strong>to</strong>nian Cycle, and Hamil<strong>to</strong>nian Path problems are well-known<strong>to</strong> be NP-Hard [9]. Because of the relationship between these problems andDCMST for d = 2, it is clear the DCMST problem should also be NP-Hard –at least for this constraint. In fact, for any fixed constant d ≥ 2 (meaning that dis not a function n, the number of vertices in G), the problem of finding a minimumcost degree-constrained spanning tree of degree at most d is still NP-hard[14]. It is also known that for any fixed rational α > 1 and any fixed d, finding aspanning tree with degree constraint d and cost within a fac<strong>to</strong>r α of the optimalis NP-hard. However, there exists a polynomial time algorithm for the case whered = O(b log(n/b)), α = O(log(n/b)), and b is the maximum degree of any vertexin the input graph [22].Before discussing the degree-constrained minimum spanning tree problem specifically,it is useful <strong>to</strong> review some of the types of algorithms that have been usedon this problem in the past. The main approach <strong>to</strong> the DCMST problem has been<strong>to</strong> use genetic algorithms. The algorithm described in this thesis is an ant-basedalgorithm. The differences between these two types of algorithms are describedbelow.2.2 Genetic AlgorithmsCommonly used as a heuristic for NP-Hard problems in general and the DCMSTproblem specifically, a genetic algorithm (GA) is a type of algorithm that attempts<strong>to</strong> mimic biological evolution and natural selection. Standard GAs begin with aninitial population of potential solutions, called chromosomes. Each chromosomehas a fitness value indicating how good that solution is believed <strong>to</strong> be. Througha number of generations, the population is modified in hopes of obtaining a nearoptimalsolution. Exactly how the population is modified varies from one algorithm<strong>to</strong> the next, but the basic steps – shown in Figure 2.1 – include selection, crossover,mutation, and replacement operations.


2 PRELIMINARIES 5PopulationSelectionCrossoverMutationReplacementFigure 2.1. Genetic Algorithm StructureSelection refers <strong>to</strong> how parent chromosomes are selected from the population.Always selecting the best chromosomes (those with the highest fitness values)generally results in premature convergence and sub-optimal solutions. Therefore,other selection schemes including a random element are usually used. In anycase, a crossover operation is then used on the selected parents <strong>to</strong> obtain newpotential solutions, called offspring. Mutation allows random changes <strong>to</strong> takeplace in the offspring, which parallel the occurrence of genetic mutations in nature.This provides a mechanism for escaping local optima. Finally, the offspring areintroduced in<strong>to</strong> the general population according <strong>to</strong> the algorithm’s replacementscheme. Most commonly, the offspring may replace their parents, or they may beswapped with other chromosomes (for instance, those with the worst fitness values).GAs run for a certain number of cycles, called generations, then terminate basedon some s<strong>to</strong>pping criteria. The criteria could be the completion of a designatednumber of generations or not seeing significant improvement in solution qualityafter a number of generations. When the s<strong>to</strong>pping criteria are met, the chromosomewith the highest fitness in the population is presented as the solution.One element that has a great affect on the effectiveness of a genetic algorithm isthe way potential solutions are represented. Often, simple representations require


2 PRELIMINARIES 6complicated crossover or repair opera<strong>to</strong>rs. On the other hand, complex representationscan allow fast and straightforward opera<strong>to</strong>rs.2.3 Ant AlgorithmsAnt algorithms, which have been used <strong>to</strong> solve a number of NP-Hard problemsbut not the DCMST problem until now, also attempt <strong>to</strong> mimic nature. They areusually based on the observed behavior of a colony of ants <strong>to</strong> collectively solveproblems including nest building, food foraging, or even bacteria farming. Tocomplete these activities, ants communicate through chemicals called pheromones.<strong>Ants</strong> deposit pheromones as they travel, and other ants use the pheromones levelsaround them <strong>to</strong> guide their actions.Consider two ants taking different paths <strong>to</strong> a source of food. The ant thattravels the shorter path will arrive at the food source first and thus will return<strong>to</strong> its starting place before the other ant. Since the first ant has now traveledover the beginning of its path twice and the second ant has not yet returned,the concentration of pheromones on the shorter path will be greater than theconcentration on the other path. The next ants that begin <strong>to</strong> forage will be morelikely <strong>to</strong> choose the path with more pheromone, which is the shorter path. Theseants in turn will increase the pheromone concentration on that path even more.This will soon lead <strong>to</strong> the typical line of ants all following the same path.In nature, ants are obviously not locked in<strong>to</strong> following the same path forever.If something happens <strong>to</strong> the first path – the food source is depleted or an obstaclesuch as a leaf or stick falls across the path – the ants will find another path. Asants begin traveling other paths and thus increasing the pheromone concentrationselsewhere, the chemicals deposited on the original path will fade. This allows forpaths and destinations <strong>to</strong> change over time.While all ant algorithms are modeled on these concepts, there are several differentvariations. The first approach, called Ant System (AS), was used by Dorigoin 1992 <strong>to</strong> solve the Traveling Salesman Problem [11]. In his algorithm, each antconstructed a <strong>to</strong>ur and then updated the pheromone levels for that solution basedon the <strong>to</strong>tal length of the <strong>to</strong>ur. As part of this global update, the pheromonelevels of all edges were evaporated so that only the currently popular edges would


2 PRELIMINARIES 7be appealing <strong>to</strong> the ants. When constructing a <strong>to</strong>ur, an ant determined where <strong>to</strong>move based on two values. One was a visibility value (e.g., the distance betweencities in TSP) that did not change throughout the algorithm. The other was thepheromone level, which was updated each time a <strong>to</strong>ur was completed. An ant alsokept track of cities already visited in the current <strong>to</strong>ur in order <strong>to</strong> avoid prematurecycles. This process was repeated a number of times with a set of ants, and thebest <strong>to</strong>ur found overall was returned by the algorithm.Ant Colony System (ACS) was introduced in 1996 as a refinement <strong>to</strong> AS withthe goal of reducing running times [13]. ACS incorporated three changes compared<strong>to</strong> AS. The edge selection formula was changed slightly <strong>to</strong> encourage more exploitationof good solutions. The global pheromone update was changed so that onlythe best <strong>to</strong>ur found in a given cycle, rather than every <strong>to</strong>ur found, was updated.Finally, a new local pheromone update rule was used by ants each time they traversedan edge. Unlike the global update that increased pheromone levels as realants do in nature, this local update was designed <strong>to</strong> reduce an edge’s pheromonelevel each time an ant traveled across it in order <strong>to</strong> encourage other ants <strong>to</strong> choosedifferent edges and thus increase exploration. Other than these three changes, thestructure of ACS remained the same as AS.Another modification <strong>to</strong> AS was the Max-Min Ant System (MMAS) introducedby Stutzle and Hoos [25]. There are two main differences between MMAS andAS. As with ACS, only the pheromone levels of the best <strong>to</strong>ur are updated eachcycle. However, ACS enhances the global best <strong>to</strong>ur while MMAS enhances thebest <strong>to</strong>ur found during the current cycle, even if it is not the best <strong>to</strong>ur foundso far by the algorithm. The goal of not always using the global best <strong>to</strong>ur is<strong>to</strong> avoid premature convergence. The second difference between MMAS and ASis that pheromone levels are limited <strong>to</strong> a set interval. This is also designed <strong>to</strong>prevent early convergence because it avoids the situation where the pheromonelevel on one edge is so high that no other edges from that node have a reasonablechance of being selected. Initially, all pheromone levels are set <strong>to</strong> the maximumlimit. As the algorithm progresses, unpopular edges drop <strong>to</strong>ward the lower limitthrough evaporation. Other than these two changes, MMAS kept the structureof AS regarding edge selection and not having a local pheromone update. MMASwas found <strong>to</strong> be an improvement over both AS and ACS.


2 PRELIMINARIES 8The ant algorithms described above all fall in<strong>to</strong> the category of Ant ColonyOptimization (ACO). The Ant-Based (AB) approach used in our algorithm is differentfrom ACO in that the ants do not build complete solutions <strong>to</strong> the problem.Instead, the ants in an AB algorithm cooperate <strong>to</strong> identify a promising configurationfrom which one complete solution is built. Because the ants are concernedwith only a local portion of the problem, they need <strong>to</strong> know less global informationthan ants in an ACO algorithm. This makes AB algorithms more amenable <strong>to</strong> paralleland distributed processing. Additionally, AB algorithms have less complexselection methods, such as using only the pheromone level instead of a formulabased on both pheromone and some heuristic value [5][6]. Our AB algorithm usesa local pheromone update and a pheromone update on the global best <strong>to</strong>ur at theend of each cycle as in ACS, with one difference. Whereas the local pheromoneupdate in ACS was a way <strong>to</strong> encourage exploration, the local update in AB algorithmsis designed <strong>to</strong> mimic nature, with ants depositing additional pheromone asthey travel. We also use a strategy <strong>to</strong> prevent widely dispersed pheromone levelsas in MMAS. This algorithm is described in detail in Chapter 3.2.4 Previous WorkEarly heuristic algorithms for the DCMST problem used a branch and bound approach[18][26]. Other heuristics developed since then have included hill-climbing,simulated annealing, neural networks, and additional branch and bound algorithms[2][17]. Genetic algorithms (GA) were first applied <strong>to</strong> the DCMST problem in themid-1990’s [33], and that has been the focus of work on the DCMST problem <strong>to</strong>date.Zhou and Gen [33] used Prüfer codes <strong>to</strong> encode spanning trees for their GA. In2000, Knowles and Corne [16] used a different representation – s<strong>to</strong>ring a spanningtree in an n × (d − 1) array, where n is the number of vertices and d is the degreeconstraint. They used this representation in a GA as well as hill-climbing andsimulated annealing algorithms. Of their three algorithms, the GA found the bestsolutions and compared favorably <strong>to</strong> earlier algorithms. Also in 2000, GAs usingweighted [20] and edge-set [19] encodings were introduced. These representationss<strong>to</strong>red the edges and edge weights instead of a permutation of vertices. Testing


2 PRELIMINARIES 9showed that the weighted encoding performed better than previous algorithms,and the edge-set encoding in turn produced even better results [19][20].In 2001, Krishnamoorthy, Earnst, and Sharaiha [17] developed a new set ofheuristic algorithms for the DCMST problem. These algorithms included a GAusing a Prüfer encoding, Problem Space Search (PSS – another GA using a constructiveheuristic <strong>to</strong> create the initial population and a vertex-permutation encoding),and a simulated annealing algorithm. They also introduced a new exactalgorithm, which worked well for small graphs and was used <strong>to</strong> generate heuristicsolutions for larger graphs. These algorithms were compared against each otherand the optimal solutions, if known. Of the four, the PSS algorithm performedthe best overall [17].A few years later, Raidl and Julstrom [21] introduced an updated version ofthe edge-set encoding. A GA using this representation was compared againstseveral previous GAs, including the one from Knowles and Corne [16] and the PSSalgorithm [17]. The GA using the edge-set encoding, which utilized edge-weightknowledge when constructing potential solutions, consistently performed the bestand scaled up <strong>to</strong> larger problems (up <strong>to</strong> 500 vertices were tested) [21].In 2004, another GA based on a Prüfer encoding was introduced [10]. It showedgreat improvement over the original DCMST GA, but it was not compared <strong>to</strong> anycontemporary GAs. That algorithm was tested on graphs up <strong>to</strong> 1000 vertices. Alsoin 2004, Soak, Corne, and Ahn introduced a new encoding for trees and comparedit <strong>to</strong> the edge-set encoding from [28]. The two algorithms produced the sameresults for graphs of 30 and 40 vertices, while the new encoding performed betterwith 50 vertices.The ant-based algorithm described in this thesis was tested using the same datasets as many of the algorithms described above. Our solutions were compared<strong>to</strong> previously published results from each of the algorithms listed above, exceptthose from before the year 2000, the first version of the edge-set encoded GA [19],and the 2004 encoding by Soak, Corne, and Ahn [28]. This final algorithm wasnot used because the specific graphs tested in that paper were not available forcomparison. The other algorithms were excluded because more recent algorithmshave produced better results. Details on the data sets and result comparisons areprovided in Chapter 4.


Chapter 3Ant-Based DCMST Algorithm3.1 Algorithm Description3.1.1 Algorithm OverviewOur ant-based algorithm for the DCMST problem, called AB-DCST, consists ofa number of cycles. Each cycle has two stages: exploration and construction.In the exploration stage of each cycle, ants are used <strong>to</strong> discover a set of candidateedges from which a degree-constrained spanning tree is constructed. In theconstruction stage the algorithm builds such a tree. Thus, each cycle produces adegree constrained spanning tree. The smallest cost tree returned by all cycles isreturned by the algorithm.In every cycle, each ant explores a local section of the graph. The edges an anttravels across are chosen such that edges with a higher level of pheromone havea higher chance of being selected. The pheromone on an edge is increased whenan ant travels across that edge, leaving an increasingly appealing trail for otherants <strong>to</strong> follow. It should be noted that for an edge (i, j), the initial amount ofpheromone distributed on (i, j) is the same as the amount of pheromone an antleaves on (i, j) when the ant traverses it. Furthermore, the lower the edge costis, the higher this pheromone amount is. Effectively, ants will have a tendency <strong>to</strong>travel along lower cost edges as well as edges that have been traveled more oftenby other ants.After all ants have explored their local section of the graph, meaning each ant


3 ALGORITHM 11has traveled across a set number of edges, the entire graph is examined. The edgeswith the highest pheromone levels, which are the edges ants traveled most often,are selected as a candidate set of edges. A degree-constrained spanning tree is thenbuilt from these candidate edges in a greedy manner. Figure 3.1 shows the fullalgorithm. In the following sections we will describe the algorithm in more details.3.1.2 InitializationInitially one ant is assigned <strong>to</strong> each vertex of the graph. As the algorithm progresses,ants move about and each vertex may have zero or more ants. The nextstep in the initialization process is <strong>to</strong> calculate the initial pheromone level of eachedge. The initial pheromone level assigned <strong>to</strong> edge (i, j), denoted by IP(i, j), isdefined as follows:IP(i, j) = (M − c(i, j)) + (M − m)/3,where c(i, j) is the cost of the edge (i, j), and M and m are the maximum andminimum edge costs in the graph, respectively. Note that edges that have smallercost will have a higher initial pheromone level. As defined, the highest initialpheromone level is no larger than 4 times the lowest initial pheromone level. Thisscaling method is similar <strong>to</strong> that of [4]. Scaling methods such as this preventextremely large gaps in the initial pheromone levels even when such large gaps existin the edge costs. Generally, it is useful <strong>to</strong> have a large enough difference betweenthe pheromone levels so that good and bad features identified by pheromone canbe differentiated. However, extremely large differences in pheromone levels caneasily cause unwanted bias.We also use IP(i, j) as the amount of pheromone that an ant adds <strong>to</strong> the edge(i, j) whenever it traverses (i, j). Thus, the lower the cost of an edge, the more thepheromone level is increased every time that edge is traversed.Some initialization is done at the very beginning of each cycle, before enteringthe Exploration stage. On every 500th cycle, the pheromone evaporation andenhancement fac<strong>to</strong>rs are updated <strong>to</strong> change the balance between exploration andexploitation. Additionally, an array of partial pheromone sums is calculated for


3 ALGORITHM 12AB-DCST(G = (V, E), w, d)// w is the edge cost function// d is the degree constraint//Initialization Stateassign one ant <strong>to</strong> each vertex of the graphinitialize pheromone level of each edgeB ←− ∅ // best treecost(B) ←− ∞while s<strong>to</strong>pping criteria not met// Exploration Stagefor step = 1 <strong>to</strong> sif step = s/3 or step = 2s/3update pheromone levels for all edgesend-iffor each ant amove a along one edgeend-forend-forupdate pheromone levels for all edges// Tree Construction Stagewhile |T | ≠ n − 1identify a set C of candidate edgesusing pheromone levelsconstruct degree-constrained spanning tree T from Cend-whileif cost(T ) < cost(B)B ←− Tend-ifif no improvement in 100 cyclesevaporate pheromone from edges of the best tree Belseenhance pheromone levels for edges in the best tree Bend-ifupdate partial pheromone sumsend-whilereturn the best tree found BFigure 3.1. The AB-DCST Algorithmeach vertex, <strong>to</strong> be used by the ants for proportional selection. Each vertex i hasa set of partial sums, denoted by P S(i, 1), . . . , P S(i, n), where n is the number of


3 ALGORITHM 13vertices in the graph, P (i, j) is the current pheromone level of edge (i, j), and thepartial sum P S(i, j) for a vertex pair (i, j) is defined as follows:1. P S(i, 1) = P (i, 1)2. P S(i, j) = P S(i, j − 1) + P (i, j) for j > 1.Thus P S(i, n) equals the <strong>to</strong>tal sum of pheromone levels for all edges inciden<strong>to</strong>n vertex i.3.1.3 ExplorationIn this section we describe how ants move in the algorithm. The objective of theants is <strong>to</strong> help identify a set of edges from which we can construct a good degreeconstrainedspanning tree. The main ideas here are: (i) ants should move alongedges that have low cost, and (ii) ants should utilize information from other antsin deciding on where <strong>to</strong> go <strong>to</strong> next, i.e., which edge <strong>to</strong> traverse. These ideas canbe accomplished by letting each ant lay a certain amount of pheromone wheneverit moves across an edge. The amount of pheromone laid on an edge should dependon the cost of that edge so that the lower the edge cost, the higher the amoun<strong>to</strong>f pheromone level. An ant can then select an edge <strong>to</strong> traverse by examining theedges that are incident <strong>to</strong> the vertex that it is currently on and selecting one ofthose edges based on the pheromone level on the edges. Specifically, the ant selectsone of these edges at random such that edges with a higher level of pheromonehave a higher probability of being selected. This method of proportional selectionensures that ants favor high-pheromone (i.e., low cost) edges while still allowinglow-pheromone edges <strong>to</strong> be selected occasionally. This is important because a goodsolution for the overall graph may need <strong>to</strong> include an edge that appears <strong>to</strong> be abad choice from a local perspective.Proportional selection is started by first generating a random number in therange [1, P S(i, n)], where i is the ant’s current vertex. Then a binary search isused <strong>to</strong> quickly locate the first edge such that the partial sum value is at least therandom value. The use of these precalculated partial sums is one of the keys <strong>to</strong>getting good running times. Without the precalculation, pheromone levels would


3 ALGORITHM 14have <strong>to</strong> be added edge by edge until the random value is reached. This would have<strong>to</strong> be repeated for each ant in each step of the cycle.<strong>Ants</strong> are prevented from revisiting previous vertices so that they continue <strong>to</strong>explore new sections of the graph and <strong>to</strong> prevent edges from being overemphasizedby an ant caught in a cycle. If the selected edge leads <strong>to</strong> a vertex an ant hasalready visited during the current cycle, the ant selects a different edge. If the anttries five times and all five vertices have been visited, the ant does not move forthat step and the algorithm continues. This limit is used as a balance betweenallowing an ant <strong>to</strong> find a new vertex and preventing the ant from spending <strong>to</strong>omuch time on that search. This process of selecting one edge <strong>to</strong> traverse is calleda step and is summarized in Figure 3.2. If the ant fails <strong>to</strong> find a new vertex afterfive attempts, it simply does not move for that step.Move(a, i) // ant a is at vertex inAttemps ←− 0while nAttempts < 5select an edge (i, j) at random andproportional <strong>to</strong> its pheromone levelif vertex j is unvisitedmark edge (i, j) for pheromone updatemove a <strong>to</strong> vertex jmark j visitedbreakelsenAttempts + +end-ifend-whileFigure 3.2. One Step in the Ant Movement AlgorithmAfter an ant traverses an edge, that edge is marked for pheromone update. Theactual update is done at certain points in the algorithm as shown in Figure 3.1.This periodic update is done, instead of updating after each move, in order <strong>to</strong>provide ants with sufficiently accurate information without sacrificing running timeefficiency. Each time the pheromone levels are updated, the partial pheromonesums are recalculated as well. This is another reason not <strong>to</strong> apply the updates <strong>to</strong>o


3 ALGORITHM 15often.The pheromone level of an edge is modified by two fac<strong>to</strong>rs. First, the currentpheromone level of the edge is decreased through evaporation. This prevents antsfrom relying on old information for <strong>to</strong>o long a time, as the pheromone levels onedges that have not been selected recently will evaporate <strong>to</strong> insignificant levels.Second, the pheromone level of the edge is increased by an amount equal <strong>to</strong> theinitial level of pheromone assigned <strong>to</strong> that edge multiplied by the number of antsthat traversed that edge since the last pheromone update.As before, let P (i, j) denote the pheromone level of the edge (i, j). Also letu(i, j) be the number of delayed pheromone updates that need <strong>to</strong> be applied <strong>to</strong> edge(i, j). Next, we define the maximum and minimum allowable levels of pheromone,denoted by maxP and minP, respectively:maxP = 1000((M − m) + (M − m)/3)andminP = (M − m)/3,where M and m denote the maximum and minimum edge costs in the graph,respectively. Then P (i, j) is updated as follows.1. P (i, j) = (1 − η)P (i, j) + u(i, j)IP(i, j)2. If P (i, j) > maxP then P (i, j) = maxP − IP(i, j),else if P (i, j) < minP then P (i, j) = minP + IP(i, j),where η is the evaporation fac<strong>to</strong>r and IP(i, j) is given in Section 3.1.2. The evaporationfac<strong>to</strong>r η is assigned an initial value of 0.5. It is then gradually decreasedas the algorithm progresses. This is so that the algorithm has more chance <strong>to</strong>explore in the beginning and will be able <strong>to</strong> converge later on. It is clear from thedefinitions of IP(i, j) and P (i, j) that both depend on the cost of the edge (i, j).3.1.4 Tree ConstructionAfter the ants have completed their movements and the pheromone levels of allthe edges have been updated, we are ready <strong>to</strong> identify the edges from which <strong>to</strong>


3 ALGORITHM 16construct a degree-constrained spanning tree. To identify a set of candidate edges,we first sort the edges in the graph in the order of decreasing pheromone level.The <strong>to</strong>p nCandidates edges from this sorted list are selected <strong>to</strong> form a candidateset C. We next sort the edges in C in increasing order of edge cost. A degreeconstrainedspanning tree is then constructed using a version of the Kruskal’salgorithm [9]. Where the original algorithm checks whether an edge connects twodifferent components, the modified version also checks whether the addition ofthat edge <strong>to</strong> the tree would violate the degree constraint. The algorithm is givenin Figure 3.3.ConstructTree(G = (V, E), w, d)sort all edges by pheromone level in descending orderC ←− <strong>to</strong>p nCandidates edges (highest pheromone levels)sort C by cost in<strong>to</strong> ascending orderT ←− ∅while |T | ≠ n − 1if C ≠ ∅let (i, j) be the next edge in order of increasing costremove (i, j) from Cif i and j are not connected in Tand adding (i, j) would not violate the degree constraintadd (i, j) <strong>to</strong> Tend-ifelse // C is emptyadd <strong>to</strong> C the next nCandidates edgesin the order of decreasing pheromone levelsort C in<strong>to</strong> increasing order of edge costend-ifend-whilereturn TFigure 3.3. Tree ConstructionThe original edge array itself is not sorted. The position of each edge in thatarray must stay the same, as determined by its endpoints, so that specific edgescan be quickly referenced when needed (see Section 3.2.2). However, we also didnot want <strong>to</strong> create a second copy of the entire edge array in memory. Instead, we


3 ALGORITHM 17created an index array that contains indices in<strong>to</strong> the main edge array. These indicesare sorted throughout the algorithm based on the properties of the underlyingedges.Occasionally, the spanning tree cannot be completed using only the candidateedges. In that case, additional edges are selected until the full tree has been built.This is done by selecting the next nCandidates edges from the pheromone-sortedlist and repeating the process. This continues until the spanning tree is complete,meaning it contains n − 1 edges where n is the number of vertices in the graph,or the final block of edges has been examined. Very rarely, the tree can not becompleted by examining the edges in blocks. For our test data, this was observedless than 0.05% of the time for d = 2, and not at all for higher constraints. Whenthis does occur, the entire set of edges is re-sorted by cost and tree construction isrestarted using the full set of edges. <strong>Using</strong> the full set of edges, the algorithm isguaranteed <strong>to</strong> produce a degree-constrained spanning tree because the edges arefrom a complete graph.3.1.5 Pheromone EnhancementThe <strong>to</strong>tal cost of the spanning tree returned by the ConstructTree algorithm iscompared <strong>to</strong> the best solution found up <strong>to</strong> that point. If the new cost is lower,that tree is saved as the new best solution. Rather than s<strong>to</strong>ring a copy of the n − 1edges in the tree, a list of their indices in the original edge array is s<strong>to</strong>red. Thenthe pheromone levels for the best edges, i.e., those in the lowest-cost tree foundso far, are enhanced <strong>to</strong> promote exploitation of those good edges. Specifically, thepheromone levels of edges in the current best tree are updated as follows. Let (i, j)be an edge in the best tree found so far. Then,1. P (i, j) = γP (i, j)2. If P (i, j) > maxP then P (i, j) = maxP − IP(i, j),else if P (i, j) < minP then P (i, j) = minP + IP(i, j)where IP(i, j) is given in Section 3.1.2, and γ is the enhancement fac<strong>to</strong>r.Initially, γ is assigned a value of 1.5 and it is gradually increased as the algorithmprogresses. The intuition for this gradual growth of the enhancement fac<strong>to</strong>r


3 ALGORITHM 18is that spanning trees found in the beginning are not expected <strong>to</strong> be good ones,thus we should not enhance <strong>to</strong>o much the pheromone levels of edges in such trees.On the other hand, as the algorithm progresses it is expected <strong>to</strong> find better trees,and hence their edges should be enhanced more.To prevent convergence on a local optimum, this enhancement is reversed ifthere is no improvement after a set number of iterations. This escape is done byevaporating the pheromone from the best edges <strong>to</strong> bring them back in<strong>to</strong> balance soother edges have a better chance of being selected. The pheromone level of edgesin the current best tree is updated as above, with γ replaced by an evaporationfac<strong>to</strong>r ζ, which is chosen at random from the interval [0.1, 0.3].3.1.6 S<strong>to</strong>pping CriteriaThe algorithm s<strong>to</strong>ps if one of the following two conditions is satisfied: (i) there isno improvement found in 2,500 consecutive cycles, or (ii) the algorithm has runfor 10,000 cycles. The selection of these specific s<strong>to</strong>pping points is discussed inSection 3.2.1. When the algorithm s<strong>to</strong>ps, the current best tree is returned.3.2 Implementation Details3.2.1 ParametersOur algorithm depends on a number of parameters. The values used in this implementationwere determined based on comparative testing using a small set ofgraphs. In fact, only three graphs (30, 70, and 100 vertices) were used for muchof the early testing, with a few parameters tested on a 1000-vertex graph as well.These graphs were chosen randomly <strong>to</strong> cover a range of graph types and sizes,which is important because our goal was <strong>to</strong> create a good general algorithm thatwas not tuned for one specific type of graph. Also, the tuning graphs were notincluded in the data set for which results are reported in this thesis. The purposeof testing the parameters on such a limited number of graphs was <strong>to</strong> obtain a fairevaluation of the algorithm on the larger data set. If the parameters had beentuned using the entire data set instead, the results would not be a good indication


3 ALGORITHM 19Table 3.1. AB-DCST Algorithm ParametersParameter Value CommentsmaxCycles 10,000 Maximum allowed cycless 75 Steps: number of edges an anttraverses each cyclenCandiates 5n Candidate set sizea n Number of antsη 0.5 Initial pheromoneevaporation fac<strong>to</strong>rγ 1.5 Initial pheromoneenhancement fac<strong>to</strong>r∆η 0.95 Update constantapplied <strong>to</strong> η∆γ 1.05 Update constantapplied <strong>to</strong> γupdateCycles 500 Number of cycles betweenupdating η and γupdateSteps s / 3 Number of steps betweenapplying pheromone updatesescapeCycles 100 Number of cycles withoutimprovement before escapings<strong>to</strong>pCycles 2,500 Number of cycles withoutimprovement before s<strong>to</strong>ppingof how the algorithm would perform on general graphs (i.e., graphs not in our dataset). Table 3.1 shows the parameters used when running this algorithm.Two of the values, the fac<strong>to</strong>rs for evaporation and enhancement of pheromonelevels, change over time. Initially, evaporation is high and enhancement is low.These values are then updated by multiplying the current fac<strong>to</strong>rs by constants atregular intervals throughout the algorithm. For example, the enhancement ratestarts at 1.5 and is multiplied by 1.05 – resulting in a higher enhancement fac<strong>to</strong>r


3 ALGORITHM 20– every 500 cycles.As explained in Section 3.1.3, this allows for exploration of the graph in earlycycles. As the algorithm progresses, the evaporation fac<strong>to</strong>r is decreased while theenhancement fac<strong>to</strong>r is increased. This encourages exploitation as the solutionsbegin <strong>to</strong> converge on good trees. Starting values for evaporation and enhancementwere based on typical settings used by other algorithms. Then experimentationwas done <strong>to</strong> tune these values as well as the frequency of and constants used forupdating the values. The remaining parameters remain fixed as the algorithmruns.Our algorithm always uses one ant for each vertex. Different strategies weretested but resulted in poorer solutions. One possibility was <strong>to</strong> use a constantnumber of ants (e.g., 50) in order <strong>to</strong> keep the running time down for the largegraphs we were targeting. However, we found that using this strategy resulted inpoor solutions for large graphs (e.g., 200 vertices and up). Next, we tried settinga in relation <strong>to</strong> n, such as a = n/2 or a = 0.9n. Although this worked for midsizedgraphs, it still did not provide good solutions for the largest graphs (1000vertices). In those cases, the algorithm would find a poor solution early on andthen not make any improvement in subsequent cycles. <strong>Using</strong> n ants, one per vertex,always seemed <strong>to</strong> produce the best solutions.We experimented with the number of steps, s, in a similar manner. In the end,we set s <strong>to</strong> the smaller of 75 and n/2. A lower limit is needed because an ant cannottravel more than n − 1 edges without repeating a vertex. For example, consider agraph with n = 30. An ant could visit every vertex by step 29, with nowhere left<strong>to</strong> travel on steps 30 through 75. For the upper limit, different numbers of stepswere tested in order <strong>to</strong> find a good balance between running time and solutionquality. <strong>Using</strong> 50 steps worked well for small and mid-sized graphs, but not largergraphs – those solutions were significantly worse than when more steps were used.Therefore the algorithm produced good results for graphs with 100 or fewer verticesusing the n/2 limit, but something more was needed for larger graphs. Values up<strong>to</strong> n − 1 were tested. A setting of 75 steps was found <strong>to</strong> be a good turning pointwhere raising s higher did not have much affect. It is interesting <strong>to</strong> note that, evenwith s = n − 1, the algorithm could not make any improvement after an initialsolution was found for n = 1000 if fewer than n ants were used.


3 ALGORITHM 21One parameter that had an effect on both the running time and solution qualitywas the frequency of applying pheromone updates. This is done three times duringeach cycle: after one third, two thirds, and all of the steps have been completed.This provides a balance between supplying the ants with up-<strong>to</strong>-date pheromonelevels and keeping the running time down. Options on either end of this balancewere also tested. When the local pheromone updates were applied immediately,the running times were very long. On the other hand, we had expected the bestrunning times when only applying the local updates once per cycle after all stepswere completed. What we actually found was that, while this approach was quickerfor small graphs, it was actually slower for large graphs. We believe this is due<strong>to</strong> our AB-DCST algorithm converging on good solutions more quickly when theants have more up-<strong>to</strong>-date pheromone levels upon which <strong>to</strong> rely.Values for the remaining parameters were found in a similar manner. Startingvalues were determined based on typical settings used by other algorithms. Experimentationon the small set of tuning graphs was then done <strong>to</strong> identify adjustmentsthat improved solution quality.3.2.2 Data StructuresThe graph is read in<strong>to</strong> an array of edges that represents half of the n×n adjacencymatrix in row-major form. The other half of the adjacency matrix is not needed.It is redundant because the graph is symmetric i.e., c(i, j) = c(j, i). There is nowasted space in the edge array because the graph is complete. An index function isused <strong>to</strong> calculate the location of a specific edge in the array when needed. Althoughthe use of this index function is minimized because edges are simply cycled throughin order where possible, the computation is still done frequently. Therefore theindex calculation was implemented as an inline function <strong>to</strong> avoid the repeatedoverhead of regular function call. The elements of the edge array are edges datastructures that include the two endpoints of an edge, the edge cost, the currentpheromone level of the edge, and the number of delayed pheromone updates waiting<strong>to</strong> be applied.Another data structure designed for this algorithm is the Ant type. The datas<strong>to</strong>red for each ant includes the vertex the ant is currently on and a list of vertices


3 ALGORITHM 22already visited in the current cycle. The size of the visited array for each ant isset <strong>to</strong> the number of steps the ant will travel in each cycle. To determine whethera potential destination of vertex j in step k has already been visited, the visitedarray is scanned from v[0] <strong>to</strong> v[k]. If j is not found, the ant may proceed <strong>to</strong> thatvertex.Finally, a disjoint set data structure is used for tree construction. This wasimplemented simply as an array of size N with Union, <strong>Find</strong>, and Reset functionsdefined on that array. Initially, each element of the array is a separate connectedcomponent consisting of a single vertex. <strong>Find</strong> identifies the root of the componentcontaining a given vertex, and Union joins two components in<strong>to</strong> one. Theimplementation, which is based on that given in [31], uses the path compressionand union by rank heuristics <strong>to</strong> improve performance. The Reset function is usedbetween cycles <strong>to</strong> separate the graph back in<strong>to</strong> N disjoint components. <strong>Using</strong> theReset function avoids destroying and recreating the instance of this data structureafter every cycle.3.2.3 Running Time AnalysisThe running time of our algorithm can be determined by analyzing the runningtime of each phase of the algorithm. This analysis of Initialization, Exploration,and Tree Construction are described below, and the details are shown in Table 3.2.Initialization can be completed in O(n 2 ), the time needed <strong>to</strong> set the initialpheromone values for the (n × (n − 1))/2 edges. The exploration and tree constructionstages which follow initialization are repeated for each cycle, but thenumber of cycles is not dependent on the size of the input problem. At most, thenumber of cycles is maxCycles, or 10,000.Two things occur in the exploration stage: moving the ants and updating thepheromone levels. As in the initialization phase, the pheromone update requiresO(n 2 ) time. The process of moving an ant one step is dominated by the binarysearch used for proportional selection. Binary search is an O(log n) algorithmand is repeated for n ants, each for a constant number of steps. Thus the antmovements can be completed in O(n 2 ) time as well, which is the running time ofthe exploration stage.


3 ALGORITHM 23The first action of the tree construction stage <strong>to</strong> sort all edges, which can bedone in O(n 2 log n) time since there are O(n 2 ) items <strong>to</strong> be sorted. The candidateset, which contains only O(n) edges, can then be sorted by cost in O(n log n)time. Actually building the tree from a candidate set using Kruskal’s algorithmas implemented requires O(nα(n)) time, where α(n) is the very slowly-growinginverse Ackermann’s function [9]. If this process must be repeated because thetree could not be completed from the first block of edges, the time required is atmost O(n 2 α(n)) because the algorithm could examine O(n) blocks of edges. Onthe rare occasions when the entire edge set must be used <strong>to</strong> build a tree, O(n 2 log n)time is needed again <strong>to</strong> sort the edges by cost and <strong>to</strong> build the tree, as α(n) =O(log n). Enhancing and evaporating pheromone from the best edges takes onlyO(n) time because only n − 1 edges must be updated, and an additional fac<strong>to</strong>r ofO(n 2 ) is needed <strong>to</strong> update the partial pheromone sums. In all, the time requiredfor the tree construction stage is O(n 2 log n).The <strong>to</strong>tal time required by our AB-DCST algorithm is determined by thesethree phases, giving us O(n 2 ) + c(O(n 2 ) + O(n 2 log n)), where c is the number ofcycles completed. This, in turn, reduces <strong>to</strong> an overall running time of O(n 2 log n)).


3 ALGORITHM 24Table 3.2. Running Time of AB-DCST⎧⎪⎨O(n 2 log n)⎪⎩⎧⎪⎨O(n 2 )⎪⎩⎧⎪⎨O(n 2 )⎪⎩⎧⎪⎨O(n 2 log n)⎪⎩{O(n 2 ){O(n log n)O(n 2 )⎧⎪⎨O(n 2 log n)⎪⎩⎧⎪⎨O(n)⎪⎩O(n 2 )AB-DCST(G = (V, E), w, d)// w is the edge cost function// d is the degree constraint// Initialization Stageassign one ant <strong>to</strong> each vertex of the graphinitialize pheromone level of each edgeB ←− ∅ // best treecost(B) ←− ∞while s<strong>to</strong>pping criteria not met// Exploration Stagefor step = 1 <strong>to</strong> sif step = s/3 or step = 2s/3update pheromone levels for all edgesend-iffor each ant amove a along one edgeend-forend-forupdate pheromone levels for all edges// Tree-Construction Stagewhile |T | ̸= n − 1identify a set C of candidate edgesusing pheromone levelsconstruct degree-constrained spanning treeT from Cend-whileif cost(T ) < cost(B)B ←− Tend-ifif no improvement in 100 cyclesevaporate pheromone from edgesof the best tree Belseenhance pheromone levels for edgesin the best tree Bend-ifupdate partial pheromone sumsend-whilereturn the best tree found B


Chapter 4Experimental Results4.1 Data SetOur algorithm was run on a set of 143 complete graphs ranging from 15 <strong>to</strong> 1000vertices, with degree constraints of two through five giving a <strong>to</strong>tal of 572 probleminstances. Seven different types of graphs were used and are summarized inTable 4.1. There is not a single benchmark set of graphs for the DCMST problem,but most of the graphs in the selected data set were used by several differentalgorithms. We compared our results with previously published results for thesegraphs. For each problem instance in our test set, we used the best result foundby any previous algorithm for our comparison. It should be noted that no singlepaper had data for all of the graphs used here.These graphs fall in<strong>to</strong> two categories, Euclidean and non-Euclidean graphs.Euclidean graphs represent coordinate points with edge costs being the Euclideandistances between two points. Three types of Euclidean graphs were tested: CRD,SYM, and STR graphs. The CRD graphs contain points in a basic 2-dimensionalplane. The points in the SYM graphs come from higher dimensional space, increasingthe chance that nodes in the unconstrained MST will violate the degreeconstraint. The points in the structured (STR) graphs, which are also from higherdimensional space, are grouped in clusters. The CRD and SYM graphs were usedin several papers including [30] and [17], where the STR graphs were introduced.The remaining graphs do not correspond <strong>to</strong> Euclidean points and distances.The first type in this category is the purely random graph. Vertices simply have


4 RESULTS 26Table 4.1. Graph Types Used for Testing the AB-DCST AlgorithmType # Used Vertex RangeCRD 40 30 <strong>to</strong> 100SYM 29 30 <strong>to</strong> 70STR 35 30 <strong>to</strong> 100SHRD 7 15 <strong>to</strong> 30Random 11 15 <strong>to</strong> 1000R 9 50 <strong>to</strong> 200M 12 50 <strong>to</strong> 500TOTAL 143 15 <strong>to</strong> 1000ID numbers (vertex 1, 2, etc.) and the edge weights are chosen randomly fromthe interval [1, n] [10]. However, these random graphs rarely have unconstrainedMSTs with high-degree vertices, making them similar in difficulty <strong>to</strong> the Euclideangraphs which also tend <strong>to</strong> have low-degree MSTs [2].The last three sets of test graphs were structured <strong>to</strong> pose a greater challenge<strong>to</strong> DCMST algorithms. The structured-hard (SHRD) graphs were created by assigningnon-Euclidean costs in such a way that the number of optimal solutions islimited [17]. The random-hard (R) and misleading-hard (M) graphs were createdby building the unconstrained MST <strong>to</strong> contain star patterns with high degrees.Additionally, the M graphs contain edges specifically intended <strong>to</strong> mislead greedyalgorithms. The procedure for creating R graphs was introduced in [2] and used byKnowles and Corne in [16], who developed the method for creating the M graphs.4.2 Detailed ResultsOur ant-based algorithm shows a definite improvement over previous algorithms.For the entire data set, the average gain in solution quality is 16%. Only smallgains are possible for the smallest graphs, for which earlier algorithms already findvery good solutions. For the middle range where the data set contains the mostgraphs of each size (n = 30 <strong>to</strong> n = 100), the average gain is 5%.Our algorithm was implemented in C++ and run on a 3GHz Pentium 4 PCwith 2GB of RAM running the Linux operating system. To obtain our results, thealgorithm was run 50 times on each instance.


4 RESULTS 27Time(sec.)400035003000250020001500100050000 100 200 300 400 500 600 700 800 900 1000nd = 2, 3, 4, 5d = 3, 4, 52 × 10 −4 n 2 logn9 × 10 −4 n 2 lognFigure 4.1. AB-DCST Running TimeThe time needed for our algorithm <strong>to</strong> complete was highly dependent on graphsize. The smallest graphs (15 vertices) ran in about half a second, 100-vertexgraphs <strong>to</strong>ok just over one minute (70 seconds), and approximately one hour wasneeded for 1000-vertex graphs. While graph type did not have a noticeable effec<strong>to</strong>n running time, the degree constraint did. For each graph, our algorithm <strong>to</strong>okabout the same amount of time for d = 4 and d = 5, with less than 1% differencein running times. Compared <strong>to</strong> d = 5, our algorithm ran 5% longer for d = 3 andalmost 20% longer for d = 2. If d = 2 is not considered, the average running timesare not changed for n ≤ 100. For larger graphs, eliminating the results for d = 2reduces average running times considerably, bringing the average for n = 1000down <strong>to</strong> 35 minutes. This difference is shown in Figure 4.1, which also shows theO(n 2 log n) running time from Section 3.2.3.Tables A.1 through A.7 show our results for each type of graph in the data set.


4 RESULTS 28The average results for each graph size are given for each type of graph, insteadof displaying the results for each individual graph, in order <strong>to</strong> provide a betteroverview of solution quality. For all of the tables below, n is the number of verticesand d is the degree constraint. Best Known is the average of the best costs availablefrom previous heuristic algorithms for each graph type and size. AB-DCST showsthe average of our best costs for each category (type/size/constraint). AbsoluteGain is the difference between the previous results and our results. Gain(%)shows this difference as a percentage of Best Known. Finally, Time is the averagerunning time in seconds. For times that are more than 100 seconds, the values arerounded <strong>to</strong> the nearest integer.4.2.1 Euclidean GraphsOur results for the CRD, SYM, and STR graphs were compared against thosefound by the heuristic algorithms in [17]. For some categories, heuristic resultswere not given. In those cases our results were compared against the best knowncosts provided by the authors of [17]. Some of those costs have been proven <strong>to</strong> beoptimal and may have been obtained using exact algorithms. Those categories areindicated with an * after the best known cost.One issue with the CRD graphs was rounding. The graphs provided containedcoordinate points and the distances had <strong>to</strong> be calculated. These distances wererounded <strong>to</strong> integer values <strong>to</strong> meet the standard indicated in [17], but small differencescould have been introduced. For the SYM and STR graphs, the integer costswere provided and no rounding was needed.The average gains for the CRD, SYM, and STR graphs were 0.07%, 1.42%,and 0.19%, respectively. This limited improvement reflects the fact that both ourAB-DCST algorithm and previous algorithms obtained optimal or near-optimalsolutions for most of these problem instances. The overall average gain for thesethree graph types was 0.48%. See Tables A.1, A.2, and A.3.4.2.2 Non-Euclidean GraphsOur results for the random graphs were compared against those found by the GAin [10], whose authors supplied this data set. Only small gains were possible for


4 RESULTS 29the smaller graphs in this set (up <strong>to</strong> 30 vertices) because the DCMSTs are veryclose in cost <strong>to</strong> the unconstrained MSTs, and so the previous algorithm performedwell. Our average gain for random graphs with 50 <strong>to</strong> 1000 vertices was 80% (51%for all graphs in this set). See Table A.4.Previous results for the SHRD graphs were available from two recent geneticalgorithms for d = 3 through d = 5 [17] [21]. Only the best results from eithersource were used <strong>to</strong> find the Best Known average. Our results for d = 2 werecompared against the best known results provided by the authors of [17]. Ouralgorithm found lower-cost trees in all categories for which heuristic results wereavailable, and in all but one of the categories that were compared against overallbest-known results. For all SHRD graphs, our average gain was 2%. See Table A.5.Our results for the random-hard graphs (the R graphs) were better in all caseswhen compared <strong>to</strong> the best solutions from [16] and [20]. The average gain for thistype of graph was 7%. The greatest improvement was made for d = 5, with anaverage of 10% compared <strong>to</strong> an average gain of 3% for d = 4. No previous resultswere available for d = 2 or d = 3. See Table A.6.Our algorithm did not perform as well on the M graphs, which were designedspecifically <strong>to</strong> mislead greedy algorithms. On average, the trees returned by ouralgorithm had 22% higher costs than those previously reported in [16] and [21].This is not completely surprising considering that the tree construction algorithmin AB-DCST is essentially greedy, with some randomization. We expect that theaddition of a local optimization step <strong>to</strong> our algorithm will improve the results inthis area. No previous results were available for d = 2, 3, or 4. See Table A.7.


Chapter 5ConclusionOur experiments show that an ant-based approach can be successfully applied <strong>to</strong>the DCMST problem. These encouraging results lead <strong>to</strong> other questions that canbe investigated in the future. For instance, results for d = 2 have not generally beenpublished for previous algorithms. Our algorithm performed well compared <strong>to</strong> thebest-known solutions available for d = 2, so it would be interesting <strong>to</strong> see if therewas indeed an improvement over previous algorithms and also how it compares<strong>to</strong> algorithms specifically designed <strong>to</strong> solve the related TSP or Hamil<strong>to</strong>nian PathProblem.Further investigation in<strong>to</strong> the difficulty of finding good solutions for differentdegree constraints could also be useful. Research on the DCMST problem hasgenerally s<strong>to</strong>pped at d = 5. This boundary is apparently based on the fact thatthe unconstrained MST for a single-dimension Euclidean graph has d ≤ 5, but arandom or higher-dimensional Euclidean graph may have a higher degree MST. Ingeneral, the DCMST problem appears <strong>to</strong> become easier <strong>to</strong> solve as the degree constraintincreases. Intuitively, this makes sense because a higher degree constraintputs less restriction on the problem solution. However, as stated in Section 2.1,DCMST remains NP-Hard for any constraint that is not a function of n. An interestingquestion is whether there is some constraint that is a function of n (otherthan d = n − 1, which is equivalent <strong>to</strong> the unconstrained MST) for which theproblem becomes significantly easier.Another area of follow-up would be <strong>to</strong> add local optimization <strong>to</strong> our algorithmin an attempt <strong>to</strong> obtain better performance on graphs where the underlying MST


CONCLUSION 31a) Clustered Graph b) Greedy DCST (d=4) c) Optimized DCST (d=4)Low Cost EdgesMid Cost EdgesHigh Cost EdgesFigure 5.1. Misleading Clustered Graphis significantly different from the DCMST. In particular, we believe this will helpimprove the performance of our algorithm on the Misleading Hard graphs. Oneidea for local optimization would be an edge exchange, where the optimizationroutine attempts <strong>to</strong> quickly replace some edges in a tree with better ones. Insteadof just randomly selecting edges <strong>to</strong> replace, the selection could be based on somecharacterization of the vertices.For example, consider a graph arranged in clusters where some of the verticeshave numerous low-cost edges but different clusters are connected by more costlyedges. Furthermore, vertices that are not in the center of clusters are connectedmainly by very high cost edges. This is the general structure of an M graph [16]and is shown in Figure 5.1. <strong>Using</strong> a greedy procedure, the degree constraint ona central vertex would quickly be met using the low-cost edges. There would beno way remaining <strong>to</strong> connect the center of one cluster <strong>to</strong> another directly usingthe mid-cost edges (because that would violate the degree constraint of the centervertices), making it likely that a more expensive path would be chosen.The main idea here is that we have two vertices (the cluster centers) with alimited number of good (i.e., low-cost) connecting paths. If we could quantify the


CONCLUSION 32difficulty of connecting such vertices, a local optimization routine could examinethe most difficult vertices in an attempt <strong>to</strong> find shorter paths <strong>to</strong> connect them.Although this idea was inspired by the structure of the M graphs, the proposedoptimization scheme would be a standard greedy process that would apply <strong>to</strong> alltypes graphs instead of being tailored <strong>to</strong> improve performance only for M graphs.The difficulties with implementing this type of optimization include quantifyingthe difficulty of connecting two vertices and efficiently determining whether a highcostedge can be replaced by a set of edges that maintains the spanning tree andhas a lower <strong>to</strong>tal cost.Further parameter tuning might also yield a combination of settings that producesbetter results. Finally, the structure of our ant-based algorithm appears <strong>to</strong>be conducive <strong>to</strong> parallel implementation. <strong>Using</strong> a parallel algorithm should greatlyreduce the running time, making it possible <strong>to</strong> easily find solutions for larger andlarger graphs.


Appendix APerformance Tables for theAB-DCST AlgorithmTable A.1. Data for Coordinate (CRD) Graphsn d Best AB Abs. Gain TimeKnown DCST Gain (%) (sec)30 2 4107 ∗ 4172 −65 −1.58 4.6530 3 3761 3759 0 0.00 2.8530 4 3765 ∗ 3765 0 0.00 3.9230 5 3765 ∗ 3765 0 0.00 3.8750 2 5380 ∗ 5431 −51 −0.95 15.9150 3 4834 4834 0 0.00 14.8850 4 4819 ∗ 4819 0 0.00 14.8550 5 4819 ∗ 4819 0 0.00 14.7070 2 6622 ∗ 6593 29 0.44 34.0670 3 5851 5851 0 0.00 30.6170 4 5849 ∗ 5849 0 0.00 31.5370 5 5849 ∗ 5849 0 0.00 27.85100 2 7860 ∗ 7607 253 3.22 77.23100 3 6686 6686 0 0.00 66.94100 4 6698 ∗ 6698 0 0.00 67.07100 5 6698 ∗ 6698 0 0.00 66.95AVG 0.07


A RESULT TABLES FOR THE AB-DCST ALGORITHM 34Table A.2. Data for Symmetric (SYM) Graphsn d Best AB Abs. Gain TimeKnown DCST Gain (%) (sec)30 2 1793 ∗ 1890 −97 −5.41 2.6330 3 1290 1290 0 0.00 2.2430 4 1218 1218 0 0.00 1.9330 5 1216 ∗ 1216 0 0.00 1.9150 2 2342 ∗ 2075 267 11.40 10.5450 3 1303 1274 29 2.23 7.2450 4 1242 1242 0 0.00 7.1750 5 1215 1215 0 0.00 6.9170 2 2546 ∗ 2318 228 8.96 24.7470 3 1292 1296 −4 −0.31 20.4270 4 1228 1227 1 0.08 18.1470 5 1210 1209 1 0.08 18.24AVG 1.42Table A.3. Data for Structured (STR) Graphsn d Best AB Abs. Gain TimeKnown DCST Gain (%) (sec)30 2 7090 ∗ 7102 −12 −0.17 2.0530 3 6775 ∗ 6775 0 0.00 1.9730 4 6577 6575 2 0.03 2.0130 5 6544 6541 3 0.05 1.9750 2 7683 ∗ 7662 21 0.27 9.2750 3 7636 ∗ 7637 −1 −0.01 7.9150 4 7445 7436 9 0.12 7.7250 5 6916 6912 4 0.06 7.0970 2 8135 ∗ 8123 12 0.15 23.0870 3 7699 ∗ 7702 −3 −0.04 19.3270 4 7537 7507 30 0.40 19.4370 5 7350 7331 19 0.26 19.31100 2 8946 ∗ 8847 99 1.11 50.70100 3 8404 8372 32 0.38 46.11100 4 8193 8172 21 0.26 43.66100 5 8012 7998 14 0.17 44.56AVG 0.19


A RESULT TABLES FOR THE AB-DCST ALGORITHM 35Table A.4. Data for Random Graphsn d Best AB Abs. Gain TimeKnown DCST Gain (%) (sec)15 2 – 24 – – 0.3415 3 23.0 23 0.00 0.0 0.3415 4 23.0 23 0.00 0.0 0.3415 5 23.0 23 0.00 0.0 0.3420 2 – 49 – – 0.8820 3 36.0 37 −1.0 −2.78 0.8220 4 36.0 35 1.0 2.78 0.6620 5 35.0 35 0.00 0.0 0.6525 2 – 57 – – 1.8925 3 41.5 43 −1.5 −3.61 1.6125 4 41.6 41 0.6 1.44 1.4825 5 41.3 41 0.3 0.73 1.6130 2 – 63 – – 5.0330 3 51.7 52 −0.3 −0.58 2.9630 4 53.0 50 3.0 5.66 2.6330 5 53.7 50 3.7 6.89 2.9150 2 – 126 – – 19.1250 3 107.6 87 20.6 19.14 14.4450 4 112.2 85 27.2 24.24 15.1150 5 112.3 85 27.3 24.31 14.73100 2 – 272 – – 69.84100 3 477.1 175 302.1 63.32 72.65100 4 495.5 168 327.5 66.09 68.92100 5 509.0 168 341.0 66.99 66.93200 2 – 705 – – 357200 3 3006.3 379 2627.3 87.39 259200 4 2838.0 365 2473.0 87.14 251200 5 2776.4 360 2416.4 87.03 244300 2 – 1101 – – 810300 3 9216.0 534 8682.0 94.21 566300 4 9394.0 501 8893.0 94.67 490300 5 9407.1 497 8910.1 94.72 487400 2 – 1489 – – 1770400 3 21074.0 732 20342.0 96.53 963400 4 20802.4 701 20101.4 96.63 870400 5 20820.0 697 20123.0 96.65 848500 2 – 2412 – – 3022500 3 37445.4 917 36528.4 97.55 1553500 4 37518.9 848 36670.9 97.74 1410500 5 37445.4 841 36604.4 97.75 14201000 2 – 6587 – – 78991000 3 247474.0 16293 231181.0 93.42 20781000 4 245404.0 13529 231875.0 94.49 21301000 5 247605.0 12424 235181.0 94.98 2070AVG 51.08


A RESULT TABLES FOR THE AB-DCST ALGORITHM 36Table A.5. Data for Structured Hard (SHRD) Graphsn d Best AB Abs. Gain TimeKnown DCST Gain (%) (sec)15 2 901 ∗ 903 −2 −0.22 0.4315 3 592 591 1 0.17 0.4615 4 432 430 2 0.46 0.5815 5 337 336 1 0.30 0.3820 2 1841 ∗ 1690 151 8.20 0.9720 3 1097 1093 4 0.36 1.1820 4 805 802 3 0.37 1.1320 5 631 630 1 0.16 1.1725 2 2969 ∗ 2715 254 8.36 1.7725 3 1808 1757 51 2.82 3.3125 4 1294 1284 10 0.77 2.6225 5 1015 1008 7 0.69 2.7030 2 4560 ∗ 4009 551 12.08 2.6630 3 2592 2593 −1 −0.04 5.7230 4 1905 1905 0 0.00 4.1730 5 1504 1506 −2 −0.13 4.43AVG 2.16Table A.6. Data for Random Hard (R) Graphsn d Best AB Abs. Gain TimeKnown DCST Gain (%) (sec)50 2 – 5.616 – – 17.1750 3 – 4.659 – – 14.8750 4 4.458 4.285 0.173 3.88 15.1450 5 4.484 3.985 0.499 11.12 15.13100 2 – 10.228 – – 81.15100 3 – 8.694 – – 66.77100 4 8.413 8.052 0.361 4.29 66.51100 5 8.430 7.544 0.886 10.51 67.05200 2 – 19.839 – – 328200 3 – 17.165 – – 302200 4 16.225 15.969 0.256 1.58 175200 5 16.291 15.089 1.202 7.38 260AVG 6.46


A RESULT TABLES FOR THE AB-DCST ALGORITHM 37Table A.7. Data for Misleading Hard (M) Graphsn d Best AB Abs. Gain TimeKnown DCST Gain (%) (sec)50 5 5.960 6.068 −0.108 −1.81 18.10100 5 10.869 12.499 −1.630 −15.00 74.98200 5 17.876 20.834 −2.958 −16.54 263300 5 40.714 52.712 −11.998 −29.47 293400 5 55.237 75.397 −20.160 −36.50 1144500 5 80.205 104.507 −24.302 −30.30 1886AVG −21.60


References[1] Blum, C. and A. Roli, “Metaheuristics in Combina<strong>to</strong>rial Optimization:Overview and Conceptual Comparison,” ACM Computing Surveys, 35(3),2003, pp. 268–308.[2] Boldon, B., N. Deo, and N. Kumar, “<strong>Minimum</strong>-Weight <strong>Degree</strong>-<strong>Constrained</strong><strong>Spanning</strong> Tree Problem: Heuristics and Implementation on an SIMD ParallelMachine,” Parallel Computing, 22, 1996, pp. 369–382.[3] Bonabeau, E., M. Dorigo, and G. Theraulaz, “Inspiration for Optimizationfrom Social Insect Behaviour,” Nature, 406, July 2000, pp. 39–42.[4] Bui, T. N. and B. R. Moon, “Genetic Algorithm and Graph Partitioning,”IEEE Trans. on Computers, 45(7), July 1996, pp. 841–855.[5] Bui, T. N. and J. R. Rizzo, Jr., “<strong>Find</strong>ing Maximum Cliques with Distributed<strong>Ants</strong>,” Proceedings of the Genetic and Evolutionary Computation Conference(GECCO 2004), Lecture Notes in Computer Science, 3102, 2004, pp. 24–35.[6] Bui, T. N. and G. Sundarraj, “Ant System for the k-Cardinality Tree Problem,”Proceedings of the Genetic and Evolutionary Computation Conference(GECCO 2004), Lecture Notes in Computer Science, 3102, 2004, pp. 36–47.[7] Bui, T. N. and C. Zrncic, “An Ant-Based Algorithm for <strong>Find</strong>ing <strong>Degree</strong>-<strong>Constrained</strong> <strong>Minimum</strong> <strong>Spanning</strong> Tree,” accepted <strong>to</strong> appear in the Proceedingsof the Genetic and Evolutionary Computation Conference (GECCO 2006).[8] Colpan, M., “Solving Geometric TSP with <strong>Ants</strong>,” Masters Thesis, Dept. ofComputer Science, Pennsylvania State University, May 2005.


REFERENCES 39[9] Cormen, T. H., C. E. Leiserson, R. L. Rivest, and C. Stein, Introduction <strong>to</strong>Algorithms, Second Edition, MIT Press, 2001.[10] Delbem, C. B., A. de Carvalho, C. A. Policastro, A. K. O. Pin<strong>to</strong>, K. Honda,and A. C. Garcia, “Node-Depth Encoding for Evolutionary Algorithms Applied<strong>to</strong> Network Design,” Proceedings of the Genetic and Evolutionary ComputationConference (GECCO 2004), Lecture Notes in Computer Science,3102, 2004, pp. 678–687.[11] Dorigo, M., “Optimization, Learning, and Natural Algorithms,” Ph.D. Thesis,Politecnico di Milano, 1992.[12] Dorigo, M., G. D. Caro, and L. M. Gambardella, “Ant Algorithms for DiscreteOptimization,” Artificial Life, 5, 1999, pp. 137–172.[13] Dorigo, M., V. Maniezzo, and A. Colorni, “Ant System: Optimization by aColony of Cooperating Agents,” IEEE Trans. on Systems, Man, and Cybernetics- Part B, 26(1), Feb. 1996, pp. 29–41.[14] Garey, M. R. and D. S. Johnson, Computers and Intractability, a Guide <strong>to</strong>the Theory of NP-Completeness, W. H. Freeman and Company, 1979.[15] Gendreau, M. and J. Potvin, “Metaheuristics in Combina<strong>to</strong>rial Optimization,”Annals of Operations Research, 140, 2005, pp. 189–213.[16] Knowles, J. and D. Corne, “A New Evolutionary Approach <strong>to</strong> the <strong>Degree</strong>-<strong>Constrained</strong> <strong>Minimum</strong> <strong>Spanning</strong> Tree Problem,” IEEE Trans. On EvolutionaryComputation, 4(2), 2000, pp. 125–134.[17] Krishnamoorthy, M., A. T. Ernst, and Y. M. Sharaiha, “Comparison of Algorithmsfor the <strong>Degree</strong> <strong>Constrained</strong> <strong>Minimum</strong> <strong>Spanning</strong> Tree,” Journal ofHeuristics, 7, 2001, pp. 587–611.[18] Narula, S. C. and C. A. Ho, “<strong>Degree</strong> <strong>Constrained</strong> <strong>Minimum</strong> <strong>Spanning</strong> Tree,”Computers and Operations Research, 7, 1980, pp. 239–249.[19] Raidl, G. R., “An Efficient Evolutionary Algorithm for the <strong>Degree</strong>-<strong>Constrained</strong> <strong>Minimum</strong> <strong>Spanning</strong> Tree Problem,” Proc. IEEE CEC, 2000,pp. 104–111.


REFERENCES 40[20] Raidl, G. R. and B. A. Julstrom, “A Weighted Coding in a Genetic Algorithmfor the <strong>Degree</strong>-<strong>Constrained</strong> <strong>Minimum</strong> <strong>Spanning</strong> Tree Problem,” Proc. 2000ACM Symposium on Applied Computing, 2000, pp. 440–445.[21] Raidl, G. R. and B. A. Julstrom, “Edge-Sets: An Effective EvolutionaryCoding of <strong>Spanning</strong> <strong>Trees</strong>.,” IEEE Trans. On Evolutionary Computation,7(3), 2003, pp. 225–239.[22] Ravi, R., M. V. Marathe, S. S. Ravi, D. J. Rosenkrantz, and H. B. Hunt III,“Many Birds with One S<strong>to</strong>ne: Multi-Objective Approximation Algorithms,”Proc. of the 25th ACM Symposium on Computing (STOC), 1993, pp. 438–447.[23] Reimann, M. and M. Laumanns, “A Hybrid ACO Algorithm for the Capacitated<strong>Minimum</strong> <strong>Spanning</strong> Tree Problem,” Hybrid Metaheurustucs, 2004, pp.1–10.[24] Rothlauf, F., D. E. Goldberg, and A. Heinzl, “Network Random Keys -A Tree Representation Scheme for Genetic and Evolutionary Algotithms,”Evolutionary Computation, 10(1), 2002, pp. 75–97.[25] Stutzle, T. and H. H. Hoos, “MAX-MIN Ant System,” Future GenerationComputer Systms, 16, 2000, pp. 889–914.[26] Savelsbergh, M. and T. Volgenant, “Edge Exchanges in the <strong>Degree</strong>-<strong>Constrained</strong> <strong>Minimum</strong> <strong>Spanning</strong> Tree Problem,” Computers and OperationsResearch, 12(4), 1985, pp. 341–348.[27] Shyu, S. J., P. Y. Yin, B. M. T. Lin, and M. Haouari “Ant-Tree: An AntColony Optimization Approach <strong>to</strong> the Generalized <strong>Minimum</strong> <strong>Spanning</strong> TreeProblem,” Journal of Experimental & Theoretical Artificial Intelligence, 15(1),2003, pp. 103–112.[28] Soak, S., D. Corne, and B. Ahn, “A Powerful New Encoding for Tree-BasedCombina<strong>to</strong>rial Optimization Problems,” Lecture Notes in Computer Science,3242, 2004, pp. 430–439.[29] Tarasewich, P. and P. R. McMullen, “Swarm Intelligence: Power in Numbers,”Communications of the ACM, 45(8), August 2002, pp. 62–67.


REFERENCES 41[30] Volgenant, A., “A Lagrangean Approach <strong>to</strong> the <strong>Degree</strong>-<strong>Constrained</strong> <strong>Minimum</strong><strong>Spanning</strong> Tree Problem,” European Journal of Operational Research, 39, 1989,pp. 325–331.[31] Weiss, M. A., Data Structures & Algorithm Analysis in C++, Second Edition,Addison Wesley Longman, Inc., 1999.[32] Zeng, Y. and Y. Wang, “A New Genetic Algorithm with Local Search Methodfor <strong>Degree</strong>-<strong>Constrained</strong> <strong>Minimum</strong> <strong>Spanning</strong> Tree Problem,” Proceedings of the5th International Conference on Computational Intelligence and MultimediaApplications (ICCIMA ’03), 2003.[33] Zhou, G. and M. Gen, “A Note on Genetic Algorithms for <strong>Degree</strong>-<strong>Constrained</strong><strong>Spanning</strong> Tree Problems,” Networks, 30, 1997, pp. 91–95.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!