testant: an ant colony system approach to sequential testing under precedence constraints

7
TestAnt: An ant colony system approach to sequential testing under precedence constraints Bülent Çatay a , Özgür Özlük b , Tonguç Ünlüyurt a,a Sabanci University, Faculty of Engineering and Natural Sciences, Tuzla 34956, Istanbul, Turkey b San Francisco State University, College of Business, 94132 CA, USA article info Keywords: Metaheuristics Ant colony optimization Sequential testing Diagnosis abstract We consider the problem of minimum cost sequential testing (diagnosis) of a series (or parallel) system under precedence constraints. We model the problem as a nonlinear integer program. We develop and implement an ant colony algorithm for the problem. We demonstrate the performance of this algorithm for special type of instances for which the optimal solutions can be found in polynomial time. In addition, we compare the performance of the ant colony algorithm with a branch and bound algorithm for ran- domly generated general instances of the problem. The ant colony algorithm is particularly effective as the problem size gets larger. Ó 2011 Elsevier Ltd. All rights reserved. 1. Introduction In its most general setting, the sequential testing problem re- quires the identification of the correct state of a system consisting of a number of components with the minimum expected cost. Dif- ferent states of the system could correspond to different types of failures or working conditions. The state of the system depends on the state of the components via a certain structure function. Both the state of the system and the state of the components be- long to discrete sets. For instance, if we have a reliability system, the individual components and the system could be in one of the two states, failing state or working state. In another context, the system could be in one of the many failure states or in working state. In order to learn the correct state of the system, one has to learn the states of a sufficiently large subset of the components, which requires costly tests. We also assume that we have apriori probabilistic information regarding the states of the components. Then the problem is to find a strategy that minimizes total ex- pected cost of this process. A feasible strategy, in a sense, classifies the current state of the system in a deterministic manner, by learn- ing the states of the individual component with the minimum ex- pected cost. The general sequential testing problem arises in different appli- cation areas such as diagnosis problems (e.g. see Ruan, Tu, Pattipati, & Patterson-Hines, 2004; Qiu & Cox, 1993), artificial intelligence problems (e.g. see Greiner, Hayward, Jankowska, & Molloy, 2006; Wang, 2005) etc. The sequential testing problem for series–parallel systems appears as a subproblem for a resource allocation problem for reliability systems in Azaiez and Bier (2007). In addition, there are many studies in the literature that theoretically work on the problem for special structure functions and for special cases of the input data regarding probability distributions and cost. Differ- ent application areas and results related to the general sequential testing problem can be found in Ünlüyurt (2004). In this particular study we consider the sequential testing prob- lem of a series system under precedence constraints. A series sys- tem functions if all its components function. A feasible strategy tests the components one by one until a failing component is found or all components are tested. Consequently, a strategy for this par- ticular system corresponds to a permutation of the components obeying the precedence constraints. In order to solve this problem, we propose an ant colony optimization (ACO) algorithm. We dem- onstrate the effectiveness of the proposed algorithm through an extensive experimental study. To the best of our knowledge, this is the first ACO algorithm proposed in the testing literature. Some preliminary results of this study were presented in Çatay, Özlük, and Ünlüyurt (2009). The rest of the article is organized as follows. In Section 2, we define the problem, provide a literature review and a mathematical model of the problem. In Section 3, we describe the proposed ACO algorithm. Section 4 outlines the greedy and the branch and bound (B&B) algorithms developed to test the performance of the proposed ACO algorithm. Section 5 is devoted to the experimental study. We conclude by discussing future research directions in Section 6. 0957-4174/$ - see front matter Ó 2011 Elsevier Ltd. All rights reserved. doi:10.1016/j.eswa.2011.05.053 Corresponding author. Tel.: +90 216 4839504; fax: +90 216 4839550. E-mail address: [email protected] (T. Ünlüyurt). Expert Systems with Applications 38 (2011) 14945–14951 Contents lists available at ScienceDirect Expert Systems with Applications journal homepage: www.elsevier.com/locate/eswa

Upload: buelent-catay

Post on 02-Sep-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Expert Systems with Applications 38 (2011) 14945–14951

Contents lists available at ScienceDirect

Expert Systems with Applications

journal homepage: www.elsevier .com/locate /eswa

TestAnt: An ant colony system approach to sequential testing underprecedence constraints

Bülent Çatay a, Özgür Özlük b, Tonguç Ünlüyurt a,⇑a Sabanci University, Faculty of Engineering and Natural Sciences, Tuzla 34956, Istanbul, Turkeyb San Francisco State University, College of Business, 94132 CA, USA

a r t i c l e i n f o

Keywords:MetaheuristicsAnt colony optimizationSequential testingDiagnosis

0957-4174/$ - see front matter � 2011 Elsevier Ltd. Adoi:10.1016/j.eswa.2011.05.053

⇑ Corresponding author. Tel.: +90 216 4839504; faxE-mail address: [email protected] (T. Ünlüy

a b s t r a c t

We consider the problem of minimum cost sequential testing (diagnosis) of a series (or parallel) systemunder precedence constraints. We model the problem as a nonlinear integer program. We develop andimplement an ant colony algorithm for the problem. We demonstrate the performance of this algorithmfor special type of instances for which the optimal solutions can be found in polynomial time. In addition,we compare the performance of the ant colony algorithm with a branch and bound algorithm for ran-domly generated general instances of the problem. The ant colony algorithm is particularly effective asthe problem size gets larger.

� 2011 Elsevier Ltd. All rights reserved.

1. Introduction

In its most general setting, the sequential testing problem re-quires the identification of the correct state of a system consistingof a number of components with the minimum expected cost. Dif-ferent states of the system could correspond to different types offailures or working conditions. The state of the system dependson the state of the components via a certain structure function.Both the state of the system and the state of the components be-long to discrete sets. For instance, if we have a reliability system,the individual components and the system could be in one of thetwo states, failing state or working state. In another context, thesystem could be in one of the many failure states or in workingstate. In order to learn the correct state of the system, one has tolearn the states of a sufficiently large subset of the components,which requires costly tests. We also assume that we have aprioriprobabilistic information regarding the states of the components.Then the problem is to find a strategy that minimizes total ex-pected cost of this process. A feasible strategy, in a sense, classifiesthe current state of the system in a deterministic manner, by learn-ing the states of the individual component with the minimum ex-pected cost.

The general sequential testing problem arises in different appli-cation areas such as diagnosis problems (e.g. see Ruan, Tu, Pattipati,& Patterson-Hines, 2004; Qiu & Cox, 1993), artificial intelligence

ll rights reserved.

: +90 216 4839550.urt).

problems (e.g. see Greiner, Hayward, Jankowska, & Molloy, 2006;Wang, 2005) etc. The sequential testing problem for series–parallelsystems appears as a subproblem for a resource allocation problemfor reliability systems in Azaiez and Bier (2007). In addition, thereare many studies in the literature that theoretically work on theproblem for special structure functions and for special cases ofthe input data regarding probability distributions and cost. Differ-ent application areas and results related to the general sequentialtesting problem can be found in Ünlüyurt (2004).

In this particular study we consider the sequential testing prob-lem of a series system under precedence constraints. A series sys-tem functions if all its components function. A feasible strategytests the components one by one until a failing component is foundor all components are tested. Consequently, a strategy for this par-ticular system corresponds to a permutation of the componentsobeying the precedence constraints. In order to solve this problem,we propose an ant colony optimization (ACO) algorithm. We dem-onstrate the effectiveness of the proposed algorithm through anextensive experimental study. To the best of our knowledge, thisis the first ACO algorithm proposed in the testing literature. Somepreliminary results of this study were presented in Çatay, Özlük,and Ünlüyurt (2009).

The rest of the article is organized as follows. In Section 2, wedefine the problem, provide a literature review and a mathematicalmodel of the problem. In Section 3, we describe the proposed ACOalgorithm. Section 4 outlines the greedy and the branch and bound(B&B) algorithms developed to test the performance of theproposed ACO algorithm. Section 5 is devoted to the experimentalstudy. We conclude by discussing future research directions inSection 6.

14946 B. Çatay et al. / Expert Systems with Applications 38 (2011) 14945–14951

2. Problem definition

2.1. Problem description and literature review

We consider a series (or parallel) system where the systemfunctions if and only if all (at least one of) the individual compo-nents function. The series (or parallel) system is a special case ofk-out-of-n systems where the system functions when at least kout of its n components are functioning. A series system is an n-out-of-n system and a parallel system is a 1-out-of-n system. Sinceall the results for the series can be adapted to the parallel case by adual argument, in what follows we will only consider a seriessystem.

For instance, the system that is tested could be a newly manu-factured machine that could be in working or failing state. The ma-chine consists of independent components that are themselves infailing or working states. The machine functions if all its indepen-dent components function. In order to demonstrate that this ma-chine is failing, one has to know that at least one componentdoes not function. On the other hand, to conclude that the machineis functioning properly one has to know that all the componentsare working. Finding out whether component i works or not re-quires a test with a cost of ci. By using historical data the probabil-ity that component i functions is estimated to be pi. A testingstrategy for a series system then inspects the components one byone until a failing component is found or all the components aretested. So an inspection strategy for this system is simply a permu-tation of all the components. The functionality of the componentsare independent from each other and the tests are perfect in thesense that we obtain correct information regarding the functional-ity of the components when they are tested. If a permutation p isused to test a series system, the expected cost of this strategy is gi-ven by

cpð1Þ þ ppð1Þcpð2Þ þ � � � þ ppð1Þppð2Þ . . . ppðn�1ÞcpðnÞ ð1Þ

since component p(i) is tested only if componentsp(1),p(2), . . . ,p(i � 1) are tested and all of them are functioning.With this formulation, finding an optimal sequence is easy. One justneeds to test all the independent components in increasing order of

ci1�pi

. This is an intuitive ordering since we first test the componentthat has less cost and high probability of failing since the testingstops when a component that is not functioning is detected. This re-sult has been published in the literature various times in differentareas and can be proved easily by an interchange argument (seee.g. Mitten, 1960).

In the case of a physical system, it may not be possible to testthe components in any sequence. Certain tests can be applied onlyafter other certain tests are performed. This could be due to thephysical location of the components or technological reasons.Essentially, these constraints correspond to precedence con-straints. One can describe the precedence constraints by an acyclicdirected graph where the nodes of the graph correspond to thecomponents and an arc from node i to node j means test j can beapplied only after test i has been applied. We will refer to thisgraph as the precedence graph.

In the existence of precedence constraints there are a few ana-lytical results for the sequential testing problem of a series system.It is proven in Reyck and Leus (2008) that when we have a generalprecedence graph, the problem is NP-hard. In Garey (1973) an opti-mal algorithm is provided when the precedence graph is a forestand each tree in the forest is either an out-tree or in-tree. In Chiu,Cox, and Sun (1999) an algorithm is proposed that is optimal forthe series system when the precedence graph is a special forestwhere the outdegree of each node is 0 or 1. So each tree in the for-est looks like a directed path. This result is a special case of the re-

sult in Garey (1973) for the series system. Both in Chiu et al. (1999)and Garey (1973), no computational results are reported. The algo-rithm proposed in Chiu et al. (1999) can also be used for the moregeneral k-out-of-n systems with precedence constraints and it isshown that the proposed algorithm is optimal for certain k-out-of-n systems. Let us note that for k-out-of-n systems a testingstrategy cannot be described by a permutation since the compo-nent to inspect next may depend on the results of tests that arealready obtained. In general, any feasible testing strategy fork-out-of-n systems can be described by a binary tree where thenodes correspond to the components and the two outgoing arcsfrom a node correspond to the failing and working condition ofthe components. Even when there are no precedence constraints,it is not always possible to represent optimal strategies fork-out-of-n systems by a permutation.

2.2. Mathematical model

We consider a series system consisting of n components. Thecost of testing component i is ci. The tests are perfect in the sensethat at a cost of ci we learn the correct state of component i. Thecomponents can be in one of the two states; 1 corresponds tothe functioning state and 0 corresponds to the failing state. Theprobability that component i functions is given as pi. We assumethat the functionality of the components are independent of eachother. For such a system a feasible testing sequence is a permuta-tion p of {1,2, . . . ,n}. The total expected cost of a solution p is givenbyPn

i¼1cpðiÞQi�1

j¼1ppðjÞ

� �. In our case, not all permutations are feasi-

ble due to the precedence constraints among the components.The precedence constraints can naturally be represented by a di-rected acyclic graph. If arc (i, j) exists in the precedence graph, thatmeans component j can be tested only if component i is alreadytested. Let P be the set of all feasible sequences satisfying the pre-cedence constraints. Then the problem can be formulated asfollows:

minp2P

Xn

i¼1

cpðiÞYi�1

j¼1

ppðjÞ ð2Þ

Alternatively, the problem can be formulated as a nonlinear integerprogramming problem where the objective function is a nonlinearfunction and the constraints are linear functions:

minXn

i¼1

Xn

r¼1

ðxirciÞYr�1

s¼1

Xn

j¼1

ðxjspjÞ !

ð3Þ

subject toXn

i¼1

xir ¼ 1; 8r 2 f1;2 . . . ;ng ð4Þ

Xn

r¼1

xir ¼ 1; 8i 2 f1;2; . . . ;ng ð5Þ

xjr 6Xr�1

s¼1

xis; 8ði; jÞ 2 A and r 2 f1;2 . . . ;ng ð6Þ

xir 2 f0;1g; 8i; r 2 f1;2; . . . ;ng ð7Þ

where A is the set of arcs in the precedence graph and the decisionvariables are defined as follows:

xir ¼1; if component i is tested in order r

0; otherwise

The objective function (3) represents the total expected cost of afeasible solution. The constraint (4) ensures that every componentis assigned an order and the constraint (5) ensures that every orderis assigned a component. Constraint (6) ensures that precedenceconstraints are satisfied.

B. Çatay et al. / Expert Systems with Applications 38 (2011) 14945–14951 14947

3. Proposed ant colony algorithm

In this section, we describe TestAnt, an ACO algorithm that wepropose to efficiently solve our problem. ACO is based on the for-aging behavior of ants searching for food sources. Ants initiallywander randomly. After finding a food source, they lay down anaromatic chemical substance, called pheromone, on the path backto their colony. If other ants searching for food find such a path,they are likely to follow it rather than traveling at random, thusreinforcing the path if they find food. As more and more ants followa path the level of pheromone on that path will enhance, which inturn will increase its selection probability by other ants. On theother hand, the pheromone evaporates over time, reducing theattractiveness of the path. The longer the path between the nestand the food source the more the pheromone evaporates. Thus,the pheromone levels remain higher on the shorter paths. The levelof pheromone on a path is basically based on the path length andthe quality of the food source.

ACO simulates this natural behavior of real ants to solve combi-natorial optimization problems by using artificial ants. To applyACO, the optimization problem is transformed into the problemof finding the best path on a weighted graph. The artificial antsincrementally build solutions by moving on the graph using a sto-chastic construction process guided by artificial pheromone and agreedy heuristic known as visibility (Dorigo, 2007). The amountof pheromone deposited on arcs is proportional to the quality ofthe solution generated and increases at run-time during the com-putation. This mechanism is the main principle behind variousalgorithms that belong to the ACO family. We skip further discus-sion of ACO and refer the interested reader to Dorigo and Stützle(2004) and http://www.iridia.ulb.ac.be/mdorigo/ACO/ for a com-plete review and details.

TestAnt is inspired from the ant colony system (ACS) of Dorigoand Gambardella (1997). ACS uses an elitist strategy when updat-ing the pheromone trails: only the global-best ant, i.e. the ant thathas built the shortest tour since the initiation of the algorithm, isallowed to lay pheromones. ACS also uses a pseudo-random pro-portional rule in selecting the next node to visit and local phero-mone updating while building solutions. The rationale in doingso is to enhance the importance of exploitation versus explorationof the search space. TestAnt differs from the ACS in the setting ofthe number of ants, the heuristic information, the implementationof the pseudo-random proportional rule as the transition rule, andthe way the pheromone trails are updated.

Initialization: We define the pheromone trail sir as the amount ofpheromone deposited on arc (i,r), where i denotes the componentand r denotes its position in the sequence. An initial amount ofpheromone s0 is deposited on each arc. We have observed thats0 = 1/qC0 performs well. Here, C0 denotes the cost correspondingto an initial feasible sequence. We obtain the initial solution usingthe greedy algorithm that is described in Section 4.1.

Test Sequence Construction: The visibility gi shows the degree ofdesirability for component i to be placed early in the sequence. If gi

is large, then the algorithm will tend to assign a higher selectionprobability to component i. Following the optimal strategy forthe case with no precedence constraints case the visibility functionis defined as:

gi ¼ ð1� piÞ=ci ð8Þ

TestAnt constructs a testing sequence as follows: each ant itera-tively starts from a component that has no preceding componentto be tested and then constructs its testing sequence by successivelyselecting a component from the feasible components set Nk

i . Foreach ant k that has recently sequenced component i in positionr;Nk

i is formed by taking not yet selected components that do not

violate the precedence constraints. The number of ants we utilizeis equal to the number of components that have no predecessors.Its value depends on the problem structure and is usually small.After selecting a component i, the ant k applies a probabilistic tran-sition rule to select the next component to be inserted in the se-quence: with probability q0 it selects the most favorable(attractive) component, i.e. component j; j 2 Nk

i , for which the prod-uct sa

jsgbj is highest or with probability (1 � q0) a component is ran-

domly chosen with the following probability:

pkjs ¼

sajsgb

jPl2Nk

isa

lsgb

l

; if j 2 Nki

0; otherwise

8><>: ð9Þ

where s = r + 1 and q0 (0 6 q0 6 1) is a parameter to control exploi-tation versus exploration. A small q0 allows the exploration of thesearch space whereas a large q0 encourages the exploitation by giv-ing a higher chance of selection to the component with the largestattractiveness. In ACS, q0 is a fixed parameter whereas in TestAnt, q0

is dynamic. It varies within the interval [qmin,qmax] and increaseswith run-time as follows:

q0 ¼ qmin þIter

NoOfIterðqmax � qminÞ ð10Þ

Iter refers to the current iteration and NoOfIter is the total number ofiterations. Our motivation in using a dynamic q0 is to favor theexploration at the early stages of the search and then to emphasizethe exploitation as the search progresses. Note that if qmin = qmax

then (5) gives the original ACS parameter q0 with q0 = qmin.Pheromone Reinforcement: Our pheromone reinforcement con-

sists of the local and global updates. The local update is performedwhile an ant is constructing the testing sequence: After the antchooses a component j in position s, the amount of pheromone trailon arc (j,s) is reduced by a factor (1 � �), where � is a positiveparameter less than 1. The aim is to give the following ants thatwill select a component for position s a higher chance to select adifferent component. In the global update, we allow the itera-tion-best and the global-best ants to deposit additional phero-mones. Our intention is to promote the best sequence and focuson its neighborhood without disregarding a ‘‘good’’ sequence ob-tained at each iteration. The formula is as follows:

sir :¼ ð1� qÞsir þ Dsibir þ Dsgb

ir ð11Þ

In this formula, q is the evaporation parameter as defined earlierand Dsib

ir ¼ 1=CibðDsgbir ¼ 1=Cgb for all (i,r)) pairs belonging to the test

sequence built by the iteration-best (global-best) ant where Cib(Cgb)is the cost of the corresponding sequence.

4. Benchmark algorithms

We implement the greedy algorithm and a B&B algorithm tobenchmark the performance of TestAnt.

4.1. Greedy algorithm

The greedy algorithm (referred to as Greedy) uses the idea ofthe optimal algorithm when there are no precedence constraintsand chooses the next component to test greedily. Recall that whenthere are no precedence constraints the optimal strategy is to in-spect the component with the smallest ci

1�piratio. When there are

precedence constraints, we greedily choose the component withthe smallest ci

1�piratio among those components whose all prede-

cessors are already tested. Let us denote by Prec(i) the set of nodesk such that (k, i) 2 A. In other words, Prec(i) is the set of immediatepredecessors of node i.

14948 B. Çatay et al. / Expert Systems with Applications 38 (2011) 14945–14951

0. Let Active be the set of nodes i for which Prec(i) = ;.1. Next component to test is the component j 2 Active with the

minimum ratio (ci/(1 � pi)).2. Delete node j from Active and update the precedence graph by

deleting node j, all arcs outgoing from node j and Active.3. Go to step 1 as long as there are more components to test.

Greedy is very easy to implement and provides feasible solu-tions almost in no time.

4.2. B&B algorithm

In order to obtain the optimal solution for at least some in-stances, we implement a B&B algorithm for this sequential testingproblem. Our motivation is to compare the solution obtained byTestAnt with the optimal solution for the problem instances wherean optimal solution can be found. Furthermore, the B&B algorithmexecuted for a certain amount of time would serve as another heu-ristic algorithm. In order to solve as large instances as possible, wemake use of the reduction theorems in Garey (1973) to preprocessthe precedence graph.

Loosely, these reduction theorems state that when certain con-ditions hold, either a precedence constraint can be relaxed or thenumber of nodes of the precedence graph can be decreased. Thesereductions focus on the ratios of terminal components in the pre-cedence graph. Let us recall that the ratio of component i is definedas ci/(1 � pi). A component is said to be terminal if it has no succes-sors in the precedence graph and non-terminal otherwise. Forexample, In Fig. 1, components 3, 4, 5 and 7 are terminal. Withthese definitions, we can summarize the reductions as follows:

(a) Reduction A: Let j be a terminal component with an imme-diate predecessor i that has a smaller ratio. Then it is possi-ble to update the precedence graph by replacing the arc fromi to j, with an arc from each immediate predecessor of i to j.The resulting precedence graph would produce the sameoptimal solution as the original graph. For instance, in theprecedence graph presented in Fig. 1, if ratio of component2 is smaller than the ratio of component 5, then the graphis updated by the removal of arc (2,5) and the addition ofarc (1,5).

(b) Reduction B: Let i be a non-terminal component with onlyterminal components as its successors and j be the compo-nent with the minimum ratio among the successors of i. Ifj has no immediate predecessors other than i and ratio of jis not higher than i then i and j occur one after another inan optimal solution. In Fig. 1, component 2 is a non-terminalcomponent with only terminal successors. If ratio of compo-nent 4 is smaller than that of component 5 and its ratio is

76

4

5

3

2

1

Fig. 1. Forest type precedence constraints.

also no higher than that of component 2, then there is anoptimal solution in which components 2 and 4 will be testedright one after another.

Let us note that when the conditions for Reduction A hold, theprecedence requirements are relaxed (the relaxation is mostapparent if component i has no predecessors). On the other hand,if the conditions for Reduction B hold, it is possible to replace com-ponents i and j with a single component with the testing cost ofci + picj and the probability of functioning is pipj. Consequently,the number of nodes in the updated precedence graph is one lessthan the original graph. These preprocessing rules are imple-mented before the B&B algorithm. We first attempt to applyReduction A on the precedence graph to reduce the number of pre-cedence relations and then we apply Reduction B to reduce thenumber of nodes of the precedence graph. These reductions mayproduce a precedence graph with no arcs in which case the greedyalgorithm can be run to achieve optimal solution. After the prepro-cessing, if the precedence graph still contains arcs, then a B&B algo-rithm is implemented in order to find the optimal solution. TheB&B algorithm used here is slightly different than the traditionalapproach used for integer programming models. In this B&B imple-mentation, each node of the B&B tree corresponds to a partial fea-sible testing sequence of the components. We define that the roothas depth 0 and the depth of any other node is one more than thedepth of its parent. Then the number of components in the partialsequence in a particular node of the B&B tree is the depth of thatnode. As an example, for the precedence graph given in Fig. 1, therewill be two nodes with depth of 1 that represent the partial feasi-ble sequences 1 and 6; there will be five nodes with depth of 2 thatrepresent the partial sequences 1–2, 1–3, 1–6, 6–1 and 6–7.

In this B&B implementation at each tree node, we calculate alower bound and an upper bound for the partial sequence thatthe node corresponds to. The lower bound of a node is calculatedusing Greedy from Section 4.1 assuming that there are no prece-dence constraints for the components that are not in the partialfeasible sequence of the associated node. We compute the upperbound of the node again by using Greedy (this time keeping theprecedence constraints) for the tests that are not in the partial fea-sible sequence of that node. Note that the solution that providesthe upper bound is a feasible solution to our original problemwhereas the lower bound is a solution to a partial relaxation ofthe problem.

The implementation uses a depth-first-search in order to find afeasible solution quickly. At each depth of the B&B tree, we calcu-late the lower bound of all nodes at that depth and continue thedepth-first-search at the node that has the smallest lower boundand is not yet traversed. Using the example above, let’s assumethat at depth 1 we identify the node containing component 1 asthe partial sequence with the smallest lower bound. In that case,the depth-first-search algorithm calculates the lower bounds forthe partial sequences 1–2, 1–3 and 1–6, and then goes in the direc-tion of the node with the smallest lower bound. We use the upperbound in order to prune the B&B tree; when the lower bound of anode exceeds the best upper bound, we do not branch on that nodeany further. We update the upper bound, whenever we find a newfeasible solution that is better than the best feasible solution foundso far.

5. Computational study

To test the effectiveness of TestAnt, we have generated randominstances of the problem for two different cases: forest type andgeneral type. For the former type, we compare the results obtainedby TestAnt and Greedy with the optimal solutions whereas for the

Table 2Percentage optimality gaps with respect to probability distribution for forest typeinstances.

Distribution TestAnt % gap Greedy % gap

U (0,1) 0.48 2.61U (0.5,1) 1.76 8.03U (0.75,1) 4.07 12.12

Table 3Percentage optimality gaps with respect to maximum outdegree for forest typeinstances.

Max. outdegree TestAnt % gap Greedy % gap

2 1.19 3.655 3.02 11.52

B. Çatay et al. / Expert Systems with Applications 38 (2011) 14945–14951 14949

latter type, we compare the results of TestAnt with Greedy and thebest solutions obtained by B&B method in 600 s. All algorithms areexecuted on an Intel Pentium T2130 1.86 GHz processor with 1 GbRAM.

TestAnt and Greedy are coded using C++. The parameters are setaccording to initial experimental runs as: qmin = 0.1, qmax = 0.9,a = 1, b = 3, q = � = 0.1. For each problem instance we performed10 runs of 2000 iterations each. The number of iterations is rela-tively large because the number of ants is usually small (as men-tioned earlier) and the convergence is slow. The pheromone trailsare re-initialized if the solution does not improve after 200 consec-utive iterations. The B&B algorithm is implemented in VBA and isexecuted only for the general type problem instances.

5.1. Results for forest type problems

In forest type problem instances, the precedence graph is a for-est where each tree in the forest is an out-tree meaning that thedirection of the arcs are away from the root. An example for sucha precedence graph can be seen in Fig. 1. These problems can besolved to optimality by the polynomial time algorithm of Garey(1973). Our goal in executing TestAnt for these problems is to ob-tain the optimality gap for TestAnt on this class of special prob-lems. We have implemented this polynomial time algorithm inC++ and we obtained the optimal solutions in a few seconds foreach instance. For this class of problems, the number of compo-nents is taken as 20, 50, 100 and 200. In the precedence graphthe maximum outdegree is taken as 2 or 5. The cost of testing com-ponents is determined uniformly between 1 and 10. The probabil-ity vector is generated by uniform distribution from (0,1), (0.5,1)and (0.75,1). For each set of parameters 10 random instances aregenerated. For forest type problems, in total we have 240instances.

For forest type problems, we compare performance of TestAntand Greedy. TestAnt finds the optimal solutions for 49 instancesout of 240 forest type instances. The average optimality gaps arebetter for TestAnt for all problem sizes in comparison with Greedy.The optimality gaps are from 4.90% to 9.49% for Greedy whereasthe gaps are from 1.27% to 2.98% for TestAnt for different valuesfor the number of components. We observe that both TestAntand the Greedy tend to perform better for larger instances. Thisis probably due to the fact that missing a component that comesearly in the optimal sequence cannot be compensated later whenthere are not many components. The average optimality gaps withare shown in Table 1 with respect to the problem size. The averagerunning time of TestAnt for 2000 iterations is 1.3 s for N = 20, 8.6 sfor N = 50, 44.4 s for N = 100 and 288.7 s for N = 200.

We observe that the optimality gaps of the algorithms getworse as randomly derived probabilities are closer to 1 from a nar-rower range. The optimality gaps with respect to probability distri-butions is shown in Table 2. When the probabilities are derivedfrom uniform (0,1), it is easier for the heuristic algorithms to dis-tinguish the components in terms of the ratios. When the probabil-ities are closer to each other, the ratios are closer to each other andit is more likely to pick a non-optimal component. On the otherhand, in terms of the maximum outdegree of the nodes in the pre-

Table 1Percentage optimality gaps with respect to the number of components for forest typeinstances.

N TestAnt % gap Greedy % gap

20 1.27 7.4850 2.98 9.49

100 2.04 8.46200 2.12 4.90

cedence graph, it turns out that the algorithms tend to performbetter when the maximum outdegree is 2. This could be due tothe fact that the number of trees in the forest increases when themaximum outdegree is 2. So this resembles more to the case withno precedence constraints. The average optimality gaps with re-spect to the maximum outdegree in the precedence are given inTable 3. The detailed results for forest type instances can be foundin Appendix A.

5.2. Results for general type problems

For the general precedence case, we consider 20, 50, 100 and200 components. As in the previous case, the cost values are takenas uniform between 1 and 10. The probability vector is generatedusing the same probability distributions. In the general precedencecase, we use a parameter called intensity. For a precedence matrixfor n components, the maximum number of non zero entries is(n2 + n)/2. Intensity refers to the percentage of non zero entriesout of this maximum number. We use 25%, 50% and 75% for theintensity parameter. Again for each set of parameters we generate10 random instances. In total, we have 360 instances for the gen-eral precedence case. We will refer to this class of problems as gen-eral type problems.

We execute the B&B algorithm for at most 600 s for each in-stance and either the best solution found in 600 s or the optimalsolution is reported. The number of optimal solutions out of the360 general type instances that can be obtained by the B&B algo-rithm (after preprocessing) with respect to the number of testsand different intensity values is given in Table 4. Recall that inten-sity refers to the ratio of the number of arcs in the precedencegraph to the maximum possible number of arcs. For each valueof N, there are 90 instances in total. We observe that all instanceswith 20 tests are solved to optimality whereas no instance with200 tests can be solved to optimality in 600 s. The instances thatcan be solved optimally for 50 or 100 tests are those with relativelymore precedence constraints.

Table 4Number of instances solved to optimality by B&B with respect to number ofcomponents and intensity values.

N Intensity Total

25% 50% 75%

20 30 30 30 9050 5 26 30 61

100 0 3 18 21200 0 0 0 0

Table 5Percentage gaps from the best solutions found by B&B with respect to number ofcomponents.

N TestAnt % gap Greedy % gap

20 0.21 2.0750 �0.11 1.43

100 �0.25 0.57200 �0.86 0.25

Table 6Percentage gaps from the best solutions found by B&B with respect to intensity forgeneral type instances.

Intensity TestAnt % gap Greedy % gap

25% �0.69 3.2850% 0.15 1.2575% 0.003 0.66 0 200 400 600 800 1000 1200 1400 1600 1800 2000

47

48

49

50

51

52

53

54

55

Iteration

Cost

12345

Fig. 2. Convergence of TestAnt for N = 200 and different b values.

50

51

52

53

54

55

Cost

(0.1,0.9)0.10.30.50.70.9

14950 B. Çatay et al. / Expert Systems with Applications 38 (2011) 14945–14951

We show the average gap of the results obtained by the heuris-tic algorithms from the best solution found by the B&B in 600 s inTable 5. Again TestAnt outperforms Greedy on average for all prob-lem sizes. The average gaps of Greedy from the best solutionsfound by the B&B algorithm range from 0.25% to 4.32 % whereasthe gaps for TestAnt are from �0.86% to 0.21%. TestAnt also outper-forms the best solutions found by the B&B algorithm on averagewhen the problem size is 50, 100 and 200 and TestAnt performsbest when N = 200. On the other hand, when N = 200, the B&B algo-rithm cannot improve the first solution that it finds for all the 90instances in 600 s. For N = 20 where all problems are solved to opti-mality, it is interesting to observe that optimality gaps of the foresttype problem instances are smaller than the optimality gaps for thegeneral type problem instances. The average running time of Tes-tAnt is 0.6 s when N = 20, 2.3 s when N = 50, 7.8 s when N = 100and 25.11 s when N = 200.

In Tables 6 and 7, we show the percentage gap of TestAnt andGreedy from the best solution found by B&B algorithm with re-spect to intensity and probability distributions. We observe thatboth TestAnt and Greedy perform better as the intensity increases.This could be due to the fact that when there are fewer feasiblesolutions, Greedy is not likely to pick a non-optimal componentsince most of them are not even feasible.

With respect to the probability distributions, we observe thatGreedy performs better as the probabilities are closer to each other.TestAnt performs best when probabilities are drawn from uniform(0.75,1). This may seem contradictory to our observation for foresttype instances. In the general case, we are not comparing the solu-tions obtained by the heuristic algorithms with the optimal solu-tions but with the best solutions obtained by the B&B algorithm in600 s. We have already seen that the B&B algorithm cannot findthe optimal solutions for larger instances. So these instances are alsoaveraged in terms of probability distributions and we observe thatthe heuristic algorithms perform relatively better as the probabili-ties are closer to each other. The detailed results for the general typeproblems can be found in Appendix A.

Table 7Percentage gaps from the best solution found by B&B with respect to probabilitydistribution for general type instances.

Distribution TestAnt % gap Greedy % gap

U (0,1) �0.11 2.18U (0.5,1) �0.06 1.87U (0.75,1) �0.36 1.13

5.3. Convergence behavior of TestAnt

Fig. 2 depicts the typical convergence behavior of TestAnt forvarying b values over 2000 iterations for N = 200. All curves repre-sent the average of 5 runs. As seen in the figure, for N = 200, b = 3provides the best solution at the end of 2000 iterations. Note thatwe observed a faster convergence rate in the smaller instances, asexpected.

Fig. 3 shows the typical convergence behavior of TestAnt for dif-ferent transition strategies over 2000 iterations for N = 200 pre-senting the average of 5 runs. The dynamic pseudo-randomproportional rule shows the best performance with fast conver-gence in the early iterations. We observe that the convergence rateis again higher for instances with smaller values of N.

0 200 400 600 800 1000 1200 1400 1600 1800 200047

48

49

Iteration

Fig. 3. Convergence of TestAnt for N = 200 and different q0 values.

Table A.1Percentage optimality gaps for forest type instances.

N Probability Outdegree = 2 Outdegree = 5

TestAnt Greedy TestAnt Greedy

20 U (0,1) 0.04 0.45 1.71 12.36U (0.5,1) 0.88 5.87 3.83 12.23U (0.75,1) 0.73 6.41 0.44 7.59

50 U (0,1) 0.15 0.75 1.73 3.01U (0.5,1) 1.11 4.68 3.40 16.19U (0.75,1) 4.54 10 6.96 22.32

100 U (0,1) 0 0.77 0.25 3.45U (0.5,1) 0.54 3.03 2.13 15.32U (0.75,1) 3.57 6.42 5.74 21.77

200 U (0,1) 0.00 0.03 0.00 0.05U (0.5,1) 0.92 1.90 1.26 4.99U (0.75,1) 1.77 3.54 8.79 18.91

Table A.2Percentage gaps from the best solutions found by B%B in 600 s for general typeinstances.

N Probability 25% 50% 75%

TestAnt Greedy TestAnt Greedy TestAnt Greedy

20 U (0,1) 0.00 5.97 0.01 1.47 0.00 0.00U (0.5,1) 0.58 4.18 0.23 1.82 0.00 0.07U (0.75,1) 0.72 3.62 0.33 1.40 0.02 0.08

50 U (0,1) 0.00 3.36 0.00 0.59 0.00 0.00U (0.5,1) 0.50 4.34 0.08 1.85 0.00 0.00U (0.75,1) �1.71 1.40 0.15 1.30 0.00 0.01

100 U (0,1) �0.72 0.04 �0.24 0.00 0.00 0.01U (0.5,1) �1.96 0.05 2.57 2.86 0.02 0.52U (0.75,1) �1.81 0.20 �0.15 1.25 0.03 0.24

200 U (0,1) �0.74 0.32 �0.06 0.00 0.00 0.00U (0.5,1) �2.76 0.56 �0.51 0.07 0.00 0.09U (0.75,1) �3.06 0.07 �0.64 1.10 �0.02 0.06

B. Çatay et al. / Expert Systems with Applications 38 (2011) 14945–14951 14951

6. Conclusion and future work

In this paper, we presented TestAnt, an ACO algorithm designedfor solving the sequential testing problem of a series system underprecedence constraints. We demonstrated the efficiency of TestAntby comparing its performance with those of Greedy and a B&Balgorithm. The experiments performed on random instancesshowed that TestAnt produces good and robust results in relativelyshort computation times.

The performance of TestAnt may be improved by developing amore efficient visibility function and implementing a different

pheromone update mechanism. In addition, a local search algo-rithm may be utilized to further enhance the solution quality, ifneeded. The B&B algorithm could be developed further in termsof branching strategies and by different bounding schemes.

From a computational point of view, effective and efficient heu-ristic algorithms are needed for k-out-of-n systems, which is amore general class of systems. To our knowledge, there are a fewanalytical results related to testing of k-out-of-n systems underprecedence constraints; yet no computational results have been re-ported in the literature. In this case, the feasible solutions will notnecessarily be described by a permutation but rather by binarydecision trees. This will make it difficult to adapt the algorithmsfor the simple series case to k-out-of-n systems.

Appendix A

First we present the percentage optimality gaps for TestAnt andGreedy for different parameters of the forest type instances in Ta-ble A.1. Then we present the percentage gaps from the best solu-tions found by the B&B algorithm found in 600 s for general typeinstances in Table A.2.

References

Azaiez, M., & Bier, V. (2007). Optimal resource allocation for security in reliabilitysystems. European Journal of Operational Research, 181, 773–786.

Çatay, B., Özlük, O., & Ünlüyurt, T. (2009). An ant colony algorithm for thesequential testing problem under precedence constraints. In IEEE internationalconference on service operations and logistics, and informatics, IEEE/SOLI(pp. 1800–1805).

Chiu, S., Cox, L., & Sun, X. (1999). Optimal sequential inspections of reliabilitysystems subject to parallel-chain precedence constraints. Discrete AppliedMathematics, 97, 327–336.

Dorigo, M. (2007). Ant colony optimization. Scholarpedia, 2(3), 1461.Dorigo, M., & Gambardella, L. (1997). Ant colony system: A cooperative learning

approach to the traveling salesman problem. IEEE Transactions on EvolutionaryComputing, 1, 53–66.

Dorigo, M., & Stützle, T. (2004). Ant colony optimization. Cambridge, Massachussets:MIT Press.

Garey, M. (1973). Optimal task sequencing with precedence constraints. DiscreteMathematics, 4, 37–56.

Greiner, R., Hayward, R., Jankowska, M., & Molloy, M. (2006). Finding optimalsatisficing strategies for and–or trees. Artificial Intelligence, 170(1), 19–58.

Mitten, L. (1960). An analytic solution to the least cost testing sequence problem.The Journal of Industrial Engineering (January–February), 17.

Qiu, Y., Jr., & Cox, L. A. (1993). Heuristic testing procedures for general coherentsystems. European Journal of Operational Research, 69, 65–74.

Reyck, B., & Leus, R. (2008). R & d project scheduling when activities may fail. IIETransactions, 40, 367–384.

Ruan, S., Tu, F., Pattipati, K., & Patterson-Hines, A. (2004). On a multimode testsequencing problem. IEEE Transactions on Systems, Man and Cybernatics Part B,34(3), 1490–1499.

Ünlüyurt, T. (2004). Sequential testing of complex systems: A review. DiscreteApplied Mathematics, 142(1–3), 189–205.

Wang, J. (2005). A cost-reducing question-selection algorithm for propositionalknowledge-based systems. Annals of Mathematics and Artificial Intelligence,44(1–2), 35–60.