Temporal Constraints. Abstract. This paper addresses the problem of eciently updating a network of temporal constraints

Size: px
Start display at page:

Download "Temporal Constraints. Abstract. This paper addresses the problem of eciently updating a network of temporal constraints"

Transcription

1 Incremental Algorithms for Managing Temporal Constraints Alfonso Gerevini 1 Anna Perini 2 Francesco Ricci 2 1 DEA { University of Brescia, via Branze 38, Brescia, Italy 2 IRST { Istituto per la Ricerca Scientica e Tecnologica, Povo (TN), Italy fperini,riccig@irst.itc.it gerevini@bsing.ing.unibs.it Abstract This paper addresses the problem of eciently updating a network of temporal constraints when constraints are removed from an existing network, or when they are added to it. Such processing tasks are important in many AI-applications requiring a temporal reasoning module. First we analyze the relationship between shortest-paths algorithms for directed graphs and arc-consistency techniques. Then we focus on a subclass of STP called STP? for which we propose new fast incremental algorithms for consistency checking and for maintaining the feasible times of the temporal variables. Our method is based on a metagraph data structure and on shortest-paths algorithms for directed acyclic graphs. An experimental comparison of the proposed algorithms with the (non-incremental) Bellman-Ford's algorithm shows that drastic CPU-time reductions can be obtained. 1 Introduction The ecient management of temporal constraints is an important issue in several areas of Articial Intelligence (AI), including knowledge representation, planning & scheduling, and knowledge-based systems in general. In these areas determining the consistency of a given set of constraints, and computing for each temporal variable involved a \window" of feasible values (occurring times) are essential reasoning tasks. In many AI-applications these are \on-line" tasks prompted by the addition (or deletion) of constraints to (from) an existing data base of constraints which is managed by a specialized reasoning module. For example, during plan generation actions are incrementally added to a partial plan, which eventually will form a complete plan for achieving a given goal (if such a plan exists). During this process, when we attempt to extend the current plan with a new action, a temporal consistency check may be required to verify the satisability of the additional constraints imposed by the action. In scheduling the ecient incremental update of an existing schedule (satisfying a given data base of constraints), and of the feasible times for allocating the available resources is practically important. Unfortunately, most of the research on constraint-based temporal reasoning has addressed general methods, without focusing on the design of ecient incremental algorithms which can amortize the cost of reasoning. In [6] Dechter, Meiri and Pearl introduce TCSP, an important framework for metric temporal reasoning based on dierence constraints between continuous variables representing time points. Ernest Davis proved that for such a class of constraints determining consistency is NP-hard [6]. However, the reasoning problems become polynomial for a restriction of TCSP called STP, subsuming the qualitative relations in the continuous Point Algebra [16] and in the Convex This work has been partially supported by the Esprit III project #6095 CHARADE (Combining Human Assessment and Reasoning Aids for Decision Making in environmental Emergencies). 1

2 Simple Interval Algebra. 1 STP is based on constraints of the form y? x 2 I (STP-constraints), where x and y are point-variables and I is a (possibly open or semi-open) interval in the time domain. This paper rst analyzes the relationship between shortest-paths algorithms for graphs and arc-consistency techniques for STP-constraints. In particular, we illustrate an algorithm which by enforcing arc-consistency can check the consistency of a network of STP-constraints, as well as computing the earliest time and the latest time of the temporal variables. In the second part of the paper we present work in progress concerning new on-line algorithms for a subclass of STP called STP?. In STP? the interval I of each constraint is of the form (a, 1] or (a, 1), where a is any value on a continuous time line. The constraints of STP? (STP? - constraints) can express lower bounds on the distance between two points, but they can not express upper bounds. While such a restriction can be exploited to derive incremental algorithms more eciently than those currently known for STP, from a practical point of view we believe that STP? are still useful for many applications, despite their limited expressiveness. For instance, STP? - constraints were chosen to model the temporal information managed by an interactive planning and scheduling system for supporting forest re ghting [14]. Among the (few) related works, the study in [3] proposes an incremental method for maintaining STP-constraints which is based on an extension of arc-consistency techniques. Though our method can manage only STP? -constraints, in general our algorithms are more ecient then those outlined in [3]. This is mainly because a set of STP? -constraints can be managed through a special directed acyclic graph on which the search is controlled by using a dynamic topological order of the vertices. This data structure, called \distance metagraph", allows to considerably speed up the process of updating the representation, both when existing constraints are removed and when new constraints are added. Tate and Bell [2](or [15, section 7.8.2]) also have proposed an arc-consistency algorithm adapted to STP that manages the on-line addition of constraints. Section 2 investigates the relationship between known shortest-paths algorithms and arc-consistency algorithms for processing STP-constraints. Section 3 formally introduces Simple Negative Temporal Constraint Networks (STN? ) for representing STP? -constraints, and proves some basic properties. Section 4 proposes new algorithms for incremental consistency checking of a STN?, and for the incremental update of the feasible times (the interval determined by the earliest and the latest times) of each variable involved. Section 5 gives preliminary experimental results. Finally, section 6 gives our conclusions. 2 Arc-consistency and Graph Algorithms for STP A simple temporal constraint problem (STP) is dened by a set of STP-constraints represented through a simple temporal constraint network (STN) [6]. The vertices of a STN represent pointvariables whose domains are closed intervals of real values, and the edges represent STP-constraints. Given a STN T the distance graph G of T is a directed weighted graph with the same vertices as T, and with an edge from v to w labeled?a, and an edge from w to v labeled b for each constraint w? v 2 [a; b] in the STP represented by S. We shall assume that any STP has a global start time variable s preceding all the other variables in the STP, and a global nishing time variable f which is after all the other variables in the STP. Moreover, we assume that the domain of each variable except s is equal to R, while s has the domain [0; 0]. 2 Simple temporal networks are decomposable [6], and both consistency and the \minimal network" can be computed in O(n 3 ) time [6, 13]. It has also been proven that checking the consistency 1 The continuous Point Algebra (PA) is formed by the set of relations f<; ; =; ; >; <=>g; the Convex Simple Interval Algebra is formed by the interval relations of Allen's Interval Algebra [1] that can be translated into collections of point-relations in the continuous PA. 2 Note that these assumptions are not an actual restriction. In fact, the bounds a and b on the feasible values of the variable x (i.e., x 2 [a; b]) can be formulated as the pair of binary constraints s? x?a and x? s b. 2

3 Relax(x i ; x j ): 1 if d(x j ) > d(x i ) + w(x i ; x j ) 2 then d(x j ) d(x i ) + w(x i ; x j ) 3 (x j ) x i 4 return TRUE 5 else return FALSE Figure 1: The Relax procedure. of a simple temporal network network G and computing the feasible times of each temporal variable can be achieved by applying Floyd-Warshall's all-pairs shortest paths algorithm [6, 4] (or any other applicable all-pairs shortest paths algorithm). Actually, the tasks of consistency checking and of computing the feasible times can be achieved by using a more ecient single-source shortest paths algorithm such as Bellman-Ford's algorithm. Formally let G = (V; E) be the distance graph of STN T, Adj(x) is the set of vertices fy 2 V j (x; y) 2 Eg, G T = (V; E T ) the transpose graph of G E T = f(y; x) 2 V V j (x; y) 2 Eg (the weight of an edge (y; x) in G T is the same as the weight of (x; y) in G), and the P weight of a path k p = (x0; : : :; x k ) in G the sum of the weights of edges on the path (i.e., w(p) = i=1 w(x i?1; x i )). A path p in G from s to a vertex x is a shortest path if in G there exists no other path whose weight is less than the weight of p. A given STN is consistent if and only if its distance graph does not contain negative cycles, i.e., cycles with negative weights [6]. If G has no negative cycles, then two functions d : V! R and : V! V can be dened. d(x) is the shortest path distance (s.p. distance) from the source s to x (i.e., the minimum weight among the weights of the paths from s to x in G), and (x) is the vertex preceding x in a shortest path from s to x (i.e., the predecessor vertex of x [4]). 3 It can be shown that the graph induced by is a tree rooted at s [4, page 523]. We shall also indicate with d T and T the shortest path distance of G T and the predecessor function respectively. The proof of the following claim is based on well known properties of Bellman-Ford's algorithm [4, page 532]. Lemma 1 Let G = (V; E) be the distance graph of a simple temporal network and s be the start time variable represented in G. G is consistent (has no negative cycles) i Bellman-Ford's Single- Source-Shortest-Path(G; s) returns TRUE. Moreover, for each vertex x i of G?d T (x i ) is the earliest time of x i, and d(x i ) is the latest time of x i, where d(x i ) is the shortest path distance from s to x i in G, and d T (x i ) is the shortest path distance from s in G T. It should be observed that instead of using Bellman-Ford's algorithm, we can use other shortestpaths algorithms that can detect negative cycles in the graph. In particular, if the graph is acyclic we can use the more ecient DAG-Shortest-Paths algorithm given in [4]. The main part of Bellman-Ford's algorithm consists of an iteration in which each edge (x i ; x j ) (i; j = 1; : : : ; jv j) is relaxed jv j? 1 times, i.e., the procedure Relax of Figure 1 is applied to (x i ; x j ) jv j? 1 times. Bellman-Ford's algorithm can be considered a particular arc-consistency algorithm that does not suer from the termination problem, which may aect known algorithms for enforcing arc-consistency in continuous domains CSP. This problem relates to the possibility of generating an arbitrary long succession of edge revisions [5, 11]. Let us assume that during the execution of Bellman-Ford's algorithm on the graphs G and G T the two estimates?d T (x i ) and d(x i ) are stored, and let us indicate with start(x i ) the lower bound of the domain of x i and with end(x i ) the upper bound. The initial value of?d T (x i ) is set by Bellman-Ford's algorithm to?1, and the initial value of d(x i ) to +1. During the execution of Bellman-Ford's algorithm, if?d T (x i ) = start(x i ) and d(x i ) = end(x i ), then a call to Relax(x i ; x j ) 3 The predecessor of s is nil. 3

4 AC-BF(T ): 1 for i 1 to jv j? 1 2 do for each edge (u; v) 2 E [ E T 3 do Rene(u; v) 4 for each edge (u; v) 2 E [ E T 5 do if Rene(u; v) 6 then return FALSE 7 return TRUE Figure 2: The AC-BF(T ) arc consistency algorithm. produces the same eect as a call to the basic procedure \Rene(x i ; x j )" used by traditional arcconsistency algorithms [5, 11]. In fact, Rene(x i ; x j ) eliminates from the current domain of x j those values that are not compatible with the current domain of x i relative to the constraint between x i and x j. (It also returns TRUE if some value has been eliminated from the domain of x j.) That is, if the constraint between x i and x j is x j? x i a ij, then the new estimate for end(x j ) becomes minfend(x j ); a ij + end(x i )g, which is exactly the value produced by Relax(x i ; x j ) for d(x i ). An analogous argument can be formulated for the lower bound of the domain of x i, and so we can state the following theorem (AC-BF(T ) is shown in Figure 2) Theorem 1 Let T = (V; C) be a simple temporal constraint network with a source variable s. AC- BF(T ) enforces arc-consistency on T in O(jV jjcj) time. Moreover, T is consistent i AC-BF(T ) returns TRUE, and if T is consistent then AC-BF(T ) computes the earliest time and the latest time for each variable in V. Remark. Theorem 1 shows that enforcing arc-consistency is an ecient procedure for deciding consistency of an STN, extending to continuous domain variables a result by Van Hentenryck et al. for a similar set of constraints on discrete domain variables [9]. Moreover, Theorem 1 also extends the application of Faltings' arc-consistency algorithms for tree-structured constraint networks with continuous labels [7]. Finally, we observe that in practice AC-BF may need less time than O(jV jjej). In fact, Rene is usually implemented in such a way that if the domain of a variable becomes empty, then an error is returned. In this case the input network is surely inconsistent. 4 Tate and Bell further investigate this condition for improving eciency if constraints are added [2]. 3 Constraint Networks and Metagraphs for STP? We now introduce a subclass of the STNs called Simple Negative Temporal Networks (STN? ) representing the constraints of STP?, i.e., constraints either of the form x j? x i a, where a 0, or x i? x j a 0, where a 0 0. As will be shown in 4, STN? s have an appealing feature: their distance graph can be incrementally managed through ecient algorithms. Concerning their expressiveness, the following proposition can be easily proved. Proposition 1 Let X = fx1; x2; : : : ; x2n; s; fg be a set of point-variables where each x i -variable (1 i n) corresponds either to the starting time or the end time of an interval variable I i in fi1; I2; : : : ; I n g. The following classes of temporal constraints can be represented through a STN? whose vertices represent X: 1. simple unary constraints of the form x i 2 [2; 9]; 4 In terms of shortest path distances this means that at some point during their computation of we have?d T (x i ) > d(x i ) for some x i 2 V. 4

5 2. constraints stating the minimal duration of an interval; 3. deadline constraints of the form x i < d, where d is a real number expressing a certain \date"; 4. assertions of the qualitative relations in the Convex Simple Interval Algebra; 5 5. assertions of the basic qualitative relations in Allen's Interval Algebra extended with positive lag times. Before addressing the dynamic management of STP? -constraints, we introduce the notion of \distance metagraph" of the distance graph of a given STN (or STN? ). We shall use this data structure in the next section to extend the applicability of known DAG-shortest-path algorithms to the distance graph of a STN?. The distance metagraph of a distance graph is a directed acyclic graph in which sets of equivalent vertices are \collapsed" into a single vertex forming a metavertex. Two vertices x; y of a distance graph G which does not contain negative cycles are equivalent (written as x y) if and only if there exists in G a cycle connecting x and y whose length is zero. 6 More formally, let G = (V; E) be the distance graph of a STN T = (V; C), V the partition induced by the relation \". From G we can derive a new graph G = (V ; E ), where the set E of the edges is dened as E = f(x; Y ) 2 V V j 9x; y x 2 X ^ y 2 Y ^ (x; y) 2 Eg and each metavertex X in V represents a set ^X of equivalent vertices of G. Call G the distance metagraph of G. (Note that the subgraph of G formed by the vertices collapsed into a metavertex of G is a \strongly connected component" (SCC) of G [4].) The extension e(x; Y ) of an edge (X; Y ) is dened as e(x; Y ) = f(x; y) 2 E j x 2 X ^ y 2 Y g: The weight W (X; Y ) of an edge (X; Y ) is the minimum among the weights of the edges in e(x; Y ). Two basic operations are dened on a metagraph: merge and expand. We say that two vertices X and Y in V are merged if: (1) in V the (disjoint) sets of vertices represented by X and Y are merged to form a new metavertex XY ; (2) the edges of E are updated accordingly, i.e., for each Z in G (Z 6= X, Z 6= Y ) we have e(xy; Z) = f(t; z) 2 E j t 2 XY ^ z 2 Zg (analogously for e(z; XY )), and the weights on the edges entering into XY or leaving from XY are appropriately updated. We say that a metavertex X is expanded into two vertices Y and Z if ^X = ^Y [ ^Z, ^Y \ ^Z = ; and in V we replace X with Y and Z, updating E accordingly. These two operations can be easily generalized to the cases in which more than two vertices are merged, and a vertex is expanded to more than two vertices. Given a distance graph G = (V; E) with no negative cycles and with a source vertex s, we can compute a shortest path tree T of G and assign to each vertex of G a s.p. distance from s. Let 5 In order to translate the relations of the Convex Simple Interval Algebra into STP-constraints, it is necessary to use also the \<"relation. For example, the relation \A during B" should be translated into: start(b) - start(a) < 0 ^ end(b) - end(a) < 0. The < relations can be managed in STN? following a method similar to the method used by Kautz and Ladkin in [10]. I.e., we attach to the weight (label) on each edge of the distance graph a \bit" indicating whether the corresponding inequation is strict or not (e.g., the bit is 1 if the inequation is strict, 0 otherwise), and we dene a negative cycle as a cycle in which the sum of the weights is either less than zero, or equal to zero, and such that in the cycle there is at least one edge where the bit of the weight has value 1. 6 \" is an equivalence relation and if two vertices are equivalent, then they have the same s.p. distance from the source vertex of the graph. 5

6 (x) and d(x) be the predecessor of x in T and the s.p. distance from s to x in G respectively, and let [x] be the vertex X of V such that x 2 ^X and x 2 V. Suppose that for each X 2 V we choose a vertex x among those in ^X in such a way that [(x)] 6= [x], then we can extend the domains of the previously dened functions and d to the metavertices of G in the following way: d(x) = d(x) (X) = [(x)]: The following Lemma has a straightforward proof. Lemma 2 Let G be the distance graph of a STN T. G has no negative cycles i G has no negative cycles; if G has no negative cycles, then for all X 2 V there exists a vertex x in ^X such that d(x) = d(x) and (X) = [(x)]. Remark. If G is the distance graph of a consistent STN?, then Lemma 2 has a very useful consequence. In fact, since G is acyclic, its shortest paths can be computed by using a shortestpaths algorithm for DAGs such as DAG-Shortest-Paths given in [4, page 536]. DAG-Shortest-Paths takes O(jEj) time and space, and thus it is more ecient than the Bellman-Ford algorithm requiring O(jV jjej) time. Moreover, in the next section we shall see how Dag-Shortest-Paths can be modied to eciently support incremental assertions and retraction of temporal constraints. In the rest of the paper we shall use the notation Rep(X) to indicate a vertex x r of ^X such that (X) = [(x r )]. This vertex is called the representative vertex of ^X. 4 Incremental Algorithms for STP? This section illustrates how the shortest path tree of a distance metagraph and of the corresponding distance graph can be incrementally updated when new edges are added to the graph, and when they are removed from it. In the following we shall assume that G = (V; E) is the distance graph of an initial set of STP? -constraints which does not contain negative cycles, and that G = (V ; E ) is the associated metagraph. Since G is a DAG, it can be topologically ordered. We assume that < X0; X1; : : :; X n > is a topological order of the vertices of G, and we indicate with ord(y ) the position of the vertex Y in V with respect to such an order, e.g. ord(y ) = i if Y = X i. Two main operations can be performed on G: deleting an edge from G and adding an edge to it. The addition and deletion of a vertex are quite simple operations. In fact, in order to add a new vertex x to G it suces to (i) add it to V ; (ii) add a new metavertex X to G and set [x] = X; (iii) set (x) = ([x]) = N IL and d(x) = d([x]) = 1. A vertex can be deleted from G only if it is not connected to any other vertex. In this case such a vertex and the corresponding metavertex are simply removed from V and from V respectively. 4.1 Deleting an Edge Figure 3 gives the algorithm Delete for removing an edge from G and updating G. following Theorem states the correctness of Delete. The Theorem 2 When an edge (x; y) is removed from G Delete((x; y); G; G ) correctly updates the shortest-path tree and the shortest-path distances of G and G. Sketch of the proof. Let [x] = X and [y] = Y. Consider two possible cases: (a) X = Y, i.e. in G there is a cycle connecting x and y; (b) X 6= Y (see step 1 of Delete). Let us rst suppose that X 6= Y. It is easy to see that the topological order of the graph is still valid after the deletion of the edge. We have two cases to examine: either (Y ) 6= X or (Y ) = X. In the rst case the s.p. tree is not modied by the deletion of the edge, and therefore neither the shortest paths nor the s.p. distances do change (both in G and in G ). 6

7 Delete((x; y); G; G ) 0 Remove the edge (x; y) from G 1 if [x] 6= [y] then 2 if ([y]) = [x] and y = Rep([y]) then 3 for each (u; v) in e([x]; [y]) 4 if w(u; v) = W ([x]; [y]) and (u; v) 6= (x; y) then 5 Rep([y]) v 6 return 7 ([y]) N IL 8 Increase(f[y]g; G ) 9 else < [x1]; : : :; [x m ] >= L Recompute-Cycles([x]) 10 if jlj > 1 then 11 Replace [x] with L 12 shift forward m? 1 positions the vertices after [x] in the previous topological order and update their predecessor function 13 j index s.t. Rep([x]) = x j 14 ([x j ]) ([x]) 15 d([x j ]) d([x]) 16 Rep([x j ]) Rep([x]) 17 for i j + 1 to m 18 ([x i ]) [p(x i )] ; the predecessor in the rst DFS of Recompute-Cycles([x]) 19 d([x i ]) d([x]) 20 Rep([x i ]) x i 21 for i 1 to j? 1 22 ([x i ]) N IL 23 Rep([x i ]) N IL 24 Increase(f[x1]; : : : ; [x j?1]g; G ) Figure 3: The Delete procedure. Let us suppose that (Y ) = X. If w(x; y) 6= W (X; Y ), or if there is another edge (x 0 ; y 0 ) in G such that x 0 2 ^X, y 0 2 ^Y and w(x 0 ; y 0 ) = w(x; y), then the deletion of (x; y) does not produce any signicant change, and we just need to set the representative of ^Y to y 0 (see steps 2-6 of Delete). If w(x; y) = W (X; Y ) and (x; y) was the only edge in e(x; Y ) with weight w(x; y), then we run the algorithm Increase of Figure 4 with input fy g. Increase(fY g; G ) achieves the same result as DAG-Shortest-Path applied to the G. In fact, it \relaxes" the edges of the graph following the same order as DAG-Shortest-Path, but with the important dierence that the edges which are \not inuent" are not relaxed. Let us now suppose that Y = X, that is we have to remove from G an edge connecting two vertices \collapsed" into the same metavertex. In this case we have to check whether the subgraph G X = ( ^X; EX ) of G such that E X = f(t; z) 2 E j t; z 2 ^X; t 6= x; z 6= yg still forms a single SCC, and if this is not the case we have to compute the possible new SCCs in G X. This can be accomplished by two depth-rst searches (DFS), the rst on G X and the second on G T X [4, page 489]. We call this algorithm Recompute-Cycles (see Figure 5). Let us rst suppose that there is no cycle in G X. In this case the vertices in G X can be topologically ordered according to the decreasing \nishing times" computed by the rst DFS [4]. Let < x1; :::; x l > be such an order, for each vertex x i in ^X = fx1 ; :::; x l g we build a metavertex X i such that ^X i = fx i g. Then we derive a new topological order by replacing X with the sequence X 1 ; :::; X l (i.e., ord(x i ) = ord(x) + i? 1, i = 1::l), and by shifting forward l? 1 positions the vertices after X (steps of Delete). For each shifted vertex Y we must also update the value of (Y ), if (Y ) = X (because X has been \expanded", and it does not exist anymore). The other 7

8 Increase(U; G ): 1 for each vertex Y 2 V taken in topologically sorted order 2 if m(y ) or Y 2 U then 3 A d(y ) 4 d(y ) 1 5 for each X 2 Adj T (Y ) 6 Relax(X; Y ) 7 if d(y ) > A then 8 for each Z s.t. (Z) = Y 9 m(z) TRUE 10 (Z) N IL Figure 4: The procedure Increase. Recompute-Cycles(X) 1 Run DFS(G X ) starting from Rep(X) to compute the nishing time for each vertex in G X 2 if no cycle has been detected then 3 return the topologically ordered meta-vertices < X 1 ; : : : ; X l > 4 else compute G T X 5 call DFS(G T X ), but in the main cycle of DFS(GT X ), consider the vertices in order of decreasing nishing times (as computed in step 1) 6 output the new SCCs topologically ordered < [x1]; : : :; [x k ] >, here x i is the \forefather" of [x i ], i.e., the vertex with the highest nishing time from which [x i ] is reachable in G X Figure 5: The procedure Recompute-Cycles. vertices preceding X in the topological order are not inuenced. The new metavertices X 1 ; : : : ; X l have to be inserted into the new s.p. tree of G. Let us assume that x j = Rep(X) (steps of Delete). We have that all the paths from x j to other vertices in ^X have length zero, because GX has only edges with weight zero. Therefore, for each x i 2 ^X which is reachable from x j in G we have d([x i ]) = d([x j ]) = d(x) (steps 15 and 19 of Delete). The vertices in ^X which are reachable from x j are those that have a nishing time less than the nishing time of x j. Hence, they are all the vertices x i such that j < i l. The predecessor structure of the DFS tree can be used to reproduce the predecessor structure for the s.p. subtree regarding the vertices reachable from x j (step 18 of Delete). Note that the metavertices [x1]; : : :; [x j?1] whose representative vertices are not reachable from x j must be reinitialized (([x i ]) = N IL and d([x i ]) = 1, for i = 1::(j? 1)), and Increase(f[x1]; : : : ; [x j?1]g; G ) has to be run (steps and 24 of Delete). When the rst DFS on G X of Recompute-Cycles detects a cycle, G X has at least one SCC containing more than one vertex. A second DFS is then performed on G T X by Recompute-Cycles (steps 5 and 6), and a sequence of steps quite similar to those outlined above are performed by Delete (steps 10-24). 2 As a direct consequence of Theorem 2 the following holds: Theorem 3 Let S = (V; C) be a consistent STN?, and G the distance metagraph of the distance graph G of S. If G (G T ) has a shortest path structure dened by and d ( T and d T ), and a constraint x j?x i w is removed from C, then Delete((x i ; x j ); G ) (Delete((x j ; x i ); G T )) correctly 8

9 Add-Oriented((x; y); w; G ): 1 if Relax(([x]; [y])) then 2 L f[y]g 3 for each X after [y] in the t.o. of G 4 insert X at the end of L 5 m(x) FALSE 6 m([y]) = TRUE 7 for each X in L 8 if m(x) then 9 for all Z 2 Adj(X) 10 m(z) Relax(X; Z) Add((x; y); w; G; G ): 1 Add the edge (x; y) to G 2 if [x] = [y] then 3 if w < 0 then 4 return FALSE 5 else return TRUE 6 else if ord([x]) > ord([y]) then 7 if not Update-TO(([x]; [y]); w; G ) 8 return FALSE 9 Add-Oriented((x; y); w; G ) 10 return TRUE Figure 6: The procedures Add and Add-Oriented. updates the s.p. structure of G (G T ) and the latest time (earliest start time) of each variable in V. 4.2 Adding an Edge Figures 6, 7 and 8 give algorithms for the incremental addition of new edges to the distance graph G built from a set of STP? -constraints. The following theorems state their correctness. Theorem 4 When a new edge (x; y) whose weight is w is added to G, the procedure Add((x; y); w; G; G ) correctly updates the distance metagraph G, the corresponding functions and d, and the topological order of the vertices in G. Description of the algorithm Add. If [x] = [y] and (x; y) has negative weight, then the addition of the new edge gives rise to an inconsistency, whereas if it has weight zero G,, d and the topological order does not need to be updated (steps 1-5 of Add). Let us suppose that [x] 6= [y], we have [x] = X i and [y] = X j for some 0 i; j n, where i = ord(x i ), j = ord(x j ) and n is the number of the metavertices. Two cases are possible: i < j and j < i. In the rst case there is no violation of the topological order < X0; : : :; X n >, and the algorithm Add-Oriented((x; y); w; G ) correctly updates the functions and d (step 8 of Add). Essentially, Add-Oriented((x; y); w; G ) is an incremental shortest-paths algorithm for directed acyclic graphs [4], where only the edges leaving from a metavertex X such that d(x) has been updated need to be relaxed, and where the topological order of the vertices is exploited to enhance eciency. Let us now suppose that i > j. In this case the new edge violates the current topological order. Thus the new metagraph either becomes inconsistent (a negative cycle has been introduced), or it is still consistent and a new topological order can be found (possibly with some metavertices merged to form a new metavertex. This is attained by the algorithm Update-TO((X i ; X j ); w; G ) of Figure 7. 7 Update-TO((X i ; X j ); w; G ) uses the procedure Find-Cycles (see Figure 8) which performs a DFS 8 in the subgraph of G formed by the metavertices which in the topological order are between X j and X i. If a path from X j to X i is found and the weight w of the new edge 7 Update-TO is similar to the procedure \Insert" [12] whose correctness has been formally proven. In fact, Update-TO is a generalization of "Insert" in the sense that Update-TO can manage directed graphs containing cycles (i.e., the strongest connected components associated with the vertices of the metagraph), while Insert can only work for directed acyclic graphs. 8 In a DFS vertices are colored during the search to indicate their state. Each vertex is initially white, is grayed when it is "discovered" in the search, and is blackened when it is "nished", i.e., when all its descendant vertices have been examined. See [4, page 478] for more details. 9

10 Update-TO((X i ; X j ); w; G ): 1 if Find-Cycles(X j ; X i ; w; G ) 2 return FALSE 3 Let X be a new metavertex and ^X = ; 4 for k j to i 5 if color(x k ) = red then 6 Merge X ^ k in ^X 7 L empty list 8 M empty list 9 for k j to i 10 if color(x k ) = white then 11 insert X k at the end of L 12 else if color(x k ) = gray then 13 insert X k at the end of M 14 if X is not empty 15 Insert X at the end of L 16 append L to M and use that list as a new topological order of the metanodes between X i and X j 17 return TRUE Figure 7: The procedure Update-TO. (X i ; X j ) is negative, then we can conclude that a negative cycle is present in G. Therefore G is inconsistent (steps of Visit in Figure 8). If w = 0 and there is a path from X j to X i, then in G (and in G) there is a cycle and we have still to determine whether this cycle is negative or not. This check is performed at steps 7-9 of Visit. The procedure Find-Cycles returns TRUE when a negative cycle is present, or as a side eect it marks red all the vertices that are in the new SCC containing X i and X j. After this phase, Update-TO merges all the vertices marked red by Find-Cycles (Update-TO steps 4-6). Then it updates the topological order (steps 7-16). The last part of Add runs Add-Oriented(([x]; [y]); w; G ) for updating the functions and d. 2 As a direct consequence of Theorem 4 the following holds: Theorem 5 Let C be a consistent set of STP? -constraints and G=(V,E) its distance graph. If x j? x i w is added to C (w 0), then Add((x i ; x j ); G ) (Add((x j ; x i ); G T )) correctly checks whether the extended set of constraints C 0 is consistent, and if C 0 is consistent it correctly updates the s.p. structure of G (G T ) and the latest time (earliest time) of each variable in V. 5 Experimental results The algorithms described in the previous sections have been implemented in Common Lisp and integrated into the temporal reasoning system TimeGraph-II (TG-II) [8]. 9 In particular we have extended TG-II's data structures regarding the graph representation of qualitative relations and the implementation of the algorithms for detecting cycles in this representation. This section reports some preliminary experimental results obtained by running our algorithms on randomly generated distance graphs. We have used dierent classes of STP? -constraints. Each class is specied by three parameters: n, p0, W. n is the number of point variables (vertices); p0 is the percentage of the edges in the distance graph with weight 0; W is the upper bound on the randomly generated weight of an edge. 9 TG-II can eciently manage large data sets of qualitative temporal relations in the Point Algebra [16], as well as disjunctive constraints such as interval disjointness and point-interval exclusion. 10

11 Find-Cycles(u; v; w; G = (V; E)): 1 for each vertex x 2 V between u and v in the topological order of G 2 color(x) white 3 return Visit(u; v; w; G) Visit(u; v; w; G): 1 color(u) gray 2 if ord(u) < ord(v) then 3 for each z 2 Adj(u) 4 if color(z) = white then 5 if Visit(z; v; w; G) 6 return TRUE 7 if color(z) = red then 8 if w(u; z) < 0 then 9 return TRUE 10 else color(u) red 11 else if u = v 12 if w < 0 then 13 return TRUE 14 else color(v) red 15 return FALSE Figure 8: The procedure Find-Cycles. For each class we have generated 50 dierent consistent STP? problems. Each problem contains n (log 2 n) STP? -constraints, and it is built by rst randomly generating the constraints with weight 0 (their number depends on the value of p0) from which a distance graph G is derived. Then we compute the metagraph G of G, and a topological order for its vertices. Finally, the remaining constraints of the problem (those with w 6= 0) are randomly generated in the following way: (1) choose a pair i, j of vertices so that the metavertex [i] precedes the metavertex [j] in the topological order; (2) add the new edge (i,j) whose weight is randomly generated according to a uniform distribution on the interval [-W, 0); (3) run the DAG-shortest-paths algorithm on G to compute the earliest and the latest times of the time points. For example with n = 50 and p0 = 10% the procedure generates 50 problems containing each a total of 283 constraints, of which 28 have weight equal to 0 and the remaining having a weight w 2 [?W; 0). We have considered p0 equal to 5%, 10%, 15%, and 20%. Table 1 concerns the classes of STP? -constraints with p0= 5% and p0= 20%. This table reports for each class the number of vertices, the number of the metavertices (the mean and standard deviation), and the size of the metavertices (the mean, the standard deviation and the maximum value). 10 As shown by Table 1 we have considered distance graphs with a decreasing ratio of number of vertices and number of metavertices. With p0 = 5% we have graphs with about the same number of vertices and metavertices, while with p0 = 20% the number of metavertices varies from about 88% of n (when n = 50) to about 51% of n (when n = 400). For p0 = 20% the average size of a metavertex increases with respect to p0 = 5%, varying from about 10% of n (when n = 50) to about 40% of n (when n = 400). We have tested our algorithms for adding and deleting single edges on each STP? problem (distance graph) generated. In particular, for each problem we have tested the algorithm for adding a single constraint, by running the algorithm Add with 20 dierent new edges (always using the same initial graph) The size of a metavertex is the number of vertices of the distance graph that have been collapsed into that metavertex. 11 The pair x, y of vertices of each new edge is randomly chosen in such a way that no edges already exist between x and y; the weight of the new edge is chosen according to the parameters of the class of constraints under investigation. 11

12 Table 1: Main features of the STP? problems (data regarding the lowest/highest p0.) Metavertices number Metavertex size Vertices p0 Mean Std. Dev. Mean Std. Dev. Max. 50 5% % % % % % % % Table 2: CPU time for adding a randomly generated STP? constraint and for deleting a randomly chosen constraint. Problems with p0 = 5%. CPU-time for addition CPU-time for deletion Vertices Mean Std. Dev. Max. Mean Std. Dev. Max Table 2 reports the CPU-time 12 (the mean, the standard deviation and the maximum value) required for adding a single edge to networks with a number of vertices varying from 50 to 400 vertices and with 5% of edges with weight equal to 0. Table 3 reports the CPU-time required by Bellman-Ford's (BF) algorithm for 10 problems with p0 = 5% for each value of the number of vertices in the rst column of the table. These results show that incremental techniques are considerably more ecient that traditional graph algorithms, especially for large data sets. Table 4 further analyzes the CPU-time required for adding a consistent and an inconsistent constraint (edge). The results of these experiments, for which we used graphs with 100 vertices, show that on average the CPU-time required for adding a single constraint is lower when the constraint does not give rise to an inconsistency. This mainly depends on the fact that by exploiting the metagraph and the topological order, our algorithms can process certain new edges very eciently (e.g, those with weight zero and connecting vertices collapsed into the same metavertex, and those which do not violate the current topological order). Table 3: CPU time of the Bellman-Ford algorithm. Problems with p0 = 5% (40 problems). CPU-time for BF Vertices Mean Std. Dev Time unit is in millisecond. Tests have been run on a SUN Sparcstation

13 Table 4: CPU-times for adding consistent and inconsistent STP? constraints to a graph with 100 vertices. (50 problems) CPU t. (cons.) CPU t. (not cons.) p0 Cons.% Mean S.D. Max. Mean S.D. Max Similar experiments have been conducted for testing our algorithm Delete. Table 2 (the last three columns) reports the CPU-time (the mean, the standard deviation and the maximum value) for removing an edge. For each problem generated the deletion of 20 randomly chosen edges have been tested. These experiments show that the deletion of an edge (constraint) is on average more ecient than the addition of a new edge, and that the average CPU-time required for removing an edge increases even more slowly than the CPU-time required for adding an edge. On the other hand, the maximum CPU-time is considerably higher than the average value. This can be explained by the fact that when an edge connecting two vertices collapsed into a \large" metavertex is removed, the search activated for the possibly new SCCs (metavertices) can involve a large number of vertices and edges. The result concerning the deletion is even more interesting than that concerning the addition of a constraint for which incremental versions of the Bellman-Ford algorithm can be used. In fact deleting a constraint using procedures based on arc-consistency for updating the earliest and the latest times of the temporal variables requires reinitializing variable domains and propagating the constraints to the whole network. Additional experiments with less dense graphs where the number of edges was 4n gave analogous results, both for the deletion and for the addition of STP? -constraints. 6 Conclusions We have proposed a collection of techniques that can be implemented to build ecient temporal reasoning tools. The rst part of the paper analyzes the relationship between known shortest-paths algorithms for directed weighted graphs and arc-consistency techniques for STP-constraints. In particular we have shown the relationship between shortest path problems and arc consistency and presented an algorithm (AC-BF) which by enforcing arc-consistency can check the consistency of a network of STP-constraints, as well as computing the earliest time and the latest time of the temporal variables. AC-BF runs in O(jV jjcj) time, where jv j is the number of time points and jcj is the number of constraints. The second part of the paper investigates a subclass of STP called STP? whose constraints are of the form y? x d (d 0). For this class of constraints we have proposed new fast incremental algorithms for consistency checking and for maintaining the feasible times of the temporal variables. Our method is based on shortest-paths techniques for directed graphs made more ecient by using a distance metagraph whose vertices are maintained topologically ordered. An experimental comparison of the proposed algorithms with the (non-incremental) Bellman-Ford's algorithm shows that drastic CPU-time reductions can be obtained. This work has been partially carried out in the context of research aimed at extending the temporal reasoning tool TimeGraph-II to incrementally handle metric constraints. 13

14 References [1] J. F. Allen. Mantaining knowledge about temporal intervals. Communication of ACM, 26(11):832{843, [2] C. E. Bell and A. Tate. Use and justication of algorithms for managing temporal knowledge in o-plan. Tec. Rep. AIAI-TR-6, AIAI University of Edinburgh, Edinburgh, U.K., [3] R. Cervoni, A. Cesta, and A. Oddi. Managing dynamic temporal constraint networks. In K. Hammond, editor, Proceedings of the second international conference on articial intelligence planning systems, pages 196{ [4] T. H. Cormen, C. E. Leiserson, and R. L. Rivest. Introduction to algorithms. The MIT Press, [5] E. Davis. Constraint propagation with interval labels. Articial Intelligence, 32:281{331, [6] R. Dechter, I. Meiri, and J. Pearl. Temporal constraint networks. Articial Intelligence, 49, [7] B. Faltings. Arc-consistency for continuous variables. Articial Intelligence, 65:363{376, [8] A. Gerevini, L. Schubert, and S. Schaeer. The temporal reasoning tools TimeGraph-I-II. Int. Journal of Articial Intelligence Tools, [9] P. V. Hentenryck, Y. Deville, and C.-M. Teng. A generic arc-consistency algorithm and its specializations. Articial Intelligence, 57, [10] H. Kautz and P. Ladkin. Integrating metric and qualitative temporal reasoning. In Proceedings of the nineth National Conference on Articial Intelligence, [11] A. K. Mackworth. Consistency in network of relations. Articial Intelligence, 8:99{118, [12] A. Marchetti-Spaccamela, U. Nanni, and H. Rohert. On-line graph algorithms for incremental compilation. In J. V. Leeuwen, editor, Proceeding of the 19th Workshop on Graph Theoretic Concepts in Computer Science. Lecture Notes in Computer Science vol 790, pages 113{151. Spriger Verlag, [13] U. Montanari. Networks of constraints: fundamental properties and applications to picture processing. Inf. Sci., 7:95{132, [14] A. Perini and F. Ricci. An interactive planning architecture. In M. Ghallab and A. Milani, editors, New directions in AI Planning, pages 273{283. IOS Press, [15] E. Tsang. Foundations of Constraint Satisfaction. Academic Press, [16] M. Vilain, H. Kautz, and P. van Beek. Constraint propagation algorithms for temporal reasoning: a revised report. In Readings in Qualitative Reasoning about Physical Systems, pages 373{381. Morgan Kaufmann, San Mateo, CA,

On Computing the Minimal Labels in Time. Point Algebra Networks. IRST { Istituto per la Ricerca Scientica e Tecnologica. I Povo, Trento Italy

On Computing the Minimal Labels in Time. Point Algebra Networks. IRST { Istituto per la Ricerca Scientica e Tecnologica. I Povo, Trento Italy To appear in Computational Intelligence Journal On Computing the Minimal Labels in Time Point Algebra Networks Alfonso Gerevini 1;2 and Lenhart Schubert 2 1 IRST { Istituto per la Ricerca Scientica e Tecnologica

More information

Efficient Computation of Minimal Point Algebra Constraints by Metagraph Closure

Efficient Computation of Minimal Point Algebra Constraints by Metagraph Closure Efficient Computation of Minimal Point Algebra Constraints by Metagraph Closure Alfonso Gerevini and Alessandro Saetti Dipartimento di Elettronica per l Automazione Università degli Studi di Brescia, via

More information

Graph Representation

Graph Representation Graph Representation Adjacency list representation of G = (V, E) An array of V lists, one for each vertex in V Each list Adj[u] contains all the vertices v such that there is an edge between u and v Adj[u]

More information

DFS & STRONGLY CONNECTED COMPONENTS

DFS & STRONGLY CONNECTED COMPONENTS DFS & STRONGLY CONNECTED COMPONENTS CS 4407 Search Tree Breadth-First Search (BFS) Depth-First Search (DFS) Depth-First Search (DFS) u d[u]: when u is discovered f[u]: when searching adj of u is finished

More information

Eddie Schwalb, Rina Dechter. It is well known that all these tasks are NP-hard.

Eddie Schwalb, Rina Dechter.  It is well known that all these tasks are NP-hard. Coping With Disjunctions in Temporal Constraint Satisfaction Problems 3 Eddie Schwalb, Rina Dechter Department of Information and Computer Science University of California at Irvine, CA 977 eschwalb@ics.uci.edu,

More information

Unit 5F: Layout Compaction

Unit 5F: Layout Compaction Course contents Unit 5F: Layout Compaction Design rules Symbolic layout Constraint-graph compaction Readings: Chapter 6 Unit 5F 1 Design rules: restrictions on the mask patterns to increase the probability

More information

Unit 3: Layout Compaction

Unit 3: Layout Compaction Unit 3: Layout Compaction Course contents Design rules Symbolic layout Constraint-graph compaction Readings: Chapter 6 Unit 3 1 Design rules: restrictions on the mask patterns to increase the probability

More information

Chapter 22. Elementary Graph Algorithms

Chapter 22. Elementary Graph Algorithms Graph Algorithms - Spring 2011 Set 7. Lecturer: Huilan Chang Reference: (1) Cormen, Leiserson, Rivest, and Stein, Introduction to Algorithms, 2nd Edition, The MIT Press. (2) Lecture notes from C. Y. Chen

More information

Strongly Connected Components

Strongly Connected Components Strongly Connected Components Let G = (V, E) be a directed graph Write if there is a path from to in G Write if and is an equivalence relation: implies and implies s equivalence classes are called the

More information

22 Elementary Graph Algorithms. There are two standard ways to represent a

22 Elementary Graph Algorithms. There are two standard ways to represent a VI Graph Algorithms Elementary Graph Algorithms Minimum Spanning Trees Single-Source Shortest Paths All-Pairs Shortest Paths 22 Elementary Graph Algorithms There are two standard ways to represent a graph

More information

Introduction to Algorithms. Lecture 11

Introduction to Algorithms. Lecture 11 Introduction to Algorithms Lecture 11 Last Time Optimization Problems Greedy Algorithms Graph Representation & Algorithms Minimum Spanning Tree Prim s Algorithm Kruskal s Algorithm 2 Today s Topics Shortest

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Design and Analysis of Algorithms CS 5311 Lecture 19 Topological Sort Junzhou Huang, Ph.D. Department of Computer Science and ngineering CS5311 Design and Analysis of Algorithms 1 Topological Sort Want

More information

Lecture 10: Strongly Connected Components, Biconnected Graphs

Lecture 10: Strongly Connected Components, Biconnected Graphs 15-750: Graduate Algorithms February 8, 2016 Lecture 10: Strongly Connected Components, Biconnected Graphs Lecturer: David Witmer Scribe: Zhong Zhou 1 DFS Continued We have introduced Depth-First Search

More information

Shortest Path Problem

Shortest Path Problem Shortest Path Problem CLRS Chapters 24.1 3, 24.5, 25.2 Shortest path problem Shortest path problem (and variants) Properties of shortest paths Algorithmic framework Bellman-Ford algorithm Shortest paths

More information

CS 341: Algorithms. Douglas R. Stinson. David R. Cheriton School of Computer Science University of Waterloo. February 26, 2019

CS 341: Algorithms. Douglas R. Stinson. David R. Cheriton School of Computer Science University of Waterloo. February 26, 2019 CS 341: Algorithms Douglas R. Stinson David R. Cheriton School of Computer Science University of Waterloo February 26, 2019 D.R. Stinson (SCS) CS 341 February 26, 2019 1 / 296 1 Course Information 2 Introduction

More information

Graphs. Graph G = (V, E) Types of graphs E = O( V 2 ) V = set of vertices E = set of edges (V V)

Graphs. Graph G = (V, E) Types of graphs E = O( V 2 ) V = set of vertices E = set of edges (V V) Graph Algorithms Graphs Graph G = (V, E) V = set of vertices E = set of edges (V V) Types of graphs Undirected: edge (u, v) = (v, u); for all v, (v, v) E (No self loops.) Directed: (u, v) is edge from

More information

Computer Science & Engineering 423/823 Design and Analysis of Algorithms

Computer Science & Engineering 423/823 Design and Analysis of Algorithms Computer Science & Engineering 423/823 Design and Analysis of Algorithms Lecture 04 Elementary Graph Algorithms (Chapter 22) Stephen Scott (Adapted from Vinodchandran N. Variyam) sscott@cse.unl.edu Introduction

More information

CS521 \ Notes for the Final Exam

CS521 \ Notes for the Final Exam CS521 \ Notes for final exam 1 Ariel Stolerman Asymptotic Notations: CS521 \ Notes for the Final Exam Notation Definition Limit Big-O ( ) Small-o ( ) Big- ( ) Small- ( ) Big- ( ) Notes: ( ) ( ) ( ) ( )

More information

Graph: representation and traversal

Graph: representation and traversal Graph: representation and traversal CISC4080, Computer Algorithms CIS, Fordham Univ. Instructor: X. Zhang! Acknowledgement The set of slides have use materials from the following resources Slides for textbook

More information

Unit 2: Algorithmic Graph Theory

Unit 2: Algorithmic Graph Theory Unit 2: Algorithmic Graph Theory Course contents: Introduction to graph theory Basic graph algorithms Reading Chapter 3 Reference: Cormen, Leiserson, and Rivest, Introduction to Algorithms, 2 nd Ed., McGraw

More information

Computer Science & Engineering 423/823 Design and Analysis of Algorithms

Computer Science & Engineering 423/823 Design and Analysis of Algorithms Computer Science & Engineering 423/823 Design and Analysis of Algorithms Lecture 07 Single-Source Shortest Paths (Chapter 24) Stephen Scott and Vinodchandran N. Variyam sscott@cse.unl.edu 1/36 Introduction

More information

CSCE 750, Fall 2002 Notes 6 Page Graph Problems ffl explore all nodes (breadth first and depth first) ffl find the shortest path from a given s

CSCE 750, Fall 2002 Notes 6 Page Graph Problems ffl explore all nodes (breadth first and depth first) ffl find the shortest path from a given s CSCE 750, Fall 2002 Notes 6 Page 1 10 Graph Algorithms (These notes follow the development in Cormen, Leiserson, and Rivest.) 10.1 Definitions ffl graph, directed graph (digraph), nodes, edges, subgraph

More information

Lecture 10. Elementary Graph Algorithm Minimum Spanning Trees

Lecture 10. Elementary Graph Algorithm Minimum Spanning Trees Lecture 10. Elementary Graph Algorithm Minimum Spanning Trees T. H. Cormen, C. E. Leiserson and R. L. Rivest Introduction to Algorithms, 3rd Edition, MIT Press, 2009 Sungkyunkwan University Hyunseung Choo

More information

Part VI Graph algorithms. Chapter 22 Elementary Graph Algorithms Chapter 23 Minimum Spanning Trees Chapter 24 Single-source Shortest Paths

Part VI Graph algorithms. Chapter 22 Elementary Graph Algorithms Chapter 23 Minimum Spanning Trees Chapter 24 Single-source Shortest Paths Part VI Graph algorithms Chapter 22 Elementary Graph Algorithms Chapter 23 Minimum Spanning Trees Chapter 24 Single-source Shortest Paths 1 Chapter 22 Elementary Graph Algorithms Representations of graphs

More information

Taking Stock. IE170: Algorithms in Systems Engineering: Lecture 17. Depth-First Search. DFS (Initialize and Go) Last Time Depth-First Search

Taking Stock. IE170: Algorithms in Systems Engineering: Lecture 17. Depth-First Search. DFS (Initialize and Go) Last Time Depth-First Search Taking Stock IE170: Algorithms in Systems Engineering: Lecture 17 Jeff Linderoth Department of Industrial and Systems Engineering Lehigh University March 2, 2007 Last Time Depth-First Search This Time:

More information

Finding Strongly Connected Components

Finding Strongly Connected Components Yufei Tao ITEE University of Queensland We just can t get enough of the beautiful algorithm of DFS! In this lecture, we will use it to solve a problem finding strongly connected components that seems to

More information

CS 161 Lecture 11 BFS, Dijkstra s algorithm Jessica Su (some parts copied from CLRS) 1 Review

CS 161 Lecture 11 BFS, Dijkstra s algorithm Jessica Su (some parts copied from CLRS) 1 Review 1 Review 1 Something I did not emphasize enough last time is that during the execution of depth-firstsearch, we construct depth-first-search trees. One graph may have multiple depth-firstsearch trees,

More information

Tutorial. Question There are no forward edges. 4. For each back edge u, v, we have 0 d[v] d[u].

Tutorial. Question There are no forward edges. 4. For each back edge u, v, we have 0 d[v] d[u]. Tutorial Question 1 A depth-first forest classifies the edges of a graph into tree, back, forward, and cross edges. A breadth-first tree can also be used to classify the edges reachable from the source

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Design and Analysis of Algorithms CSE 5311 Lecture 18 Graph Algorithm Junzhou Huang, Ph.D. Department of Computer Science and Engineering CSE5311 Design and Analysis of Algorithms 1 Graphs Graph G = (V,

More information

Graphs. Part I: Basic algorithms. Laura Toma Algorithms (csci2200), Bowdoin College

Graphs. Part I: Basic algorithms. Laura Toma Algorithms (csci2200), Bowdoin College Laura Toma Algorithms (csci2200), Bowdoin College Undirected graphs Concepts: connectivity, connected components paths (undirected) cycles Basic problems, given undirected graph G: is G connected how many

More information

Elementary Graph Algorithms

Elementary Graph Algorithms Elementary Graph Algorithms Graphs Graph G = (V, E)» V = set of vertices» E = set of edges (V V) Types of graphs» Undirected: edge (u, v) = (v, u); for all v, (v, v) E (No self loops.)» Directed: (u, v)

More information

Algebraic Properties of CSP Model Operators? Y.C. Law and J.H.M. Lee. The Chinese University of Hong Kong.

Algebraic Properties of CSP Model Operators? Y.C. Law and J.H.M. Lee. The Chinese University of Hong Kong. Algebraic Properties of CSP Model Operators? Y.C. Law and J.H.M. Lee Department of Computer Science and Engineering The Chinese University of Hong Kong Shatin, N.T., Hong Kong SAR, China fyclaw,jleeg@cse.cuhk.edu.hk

More information

Minimum Spanning Trees Ch 23 Traversing graphs

Minimum Spanning Trees Ch 23 Traversing graphs Next: Graph Algorithms Graphs Ch 22 Graph representations adjacency list adjacency matrix Minimum Spanning Trees Ch 23 Traversing graphs Breadth-First Search Depth-First Search 11/30/17 CSE 3101 1 Graphs

More information

Basic Graph Algorithms

Basic Graph Algorithms Basic Graph Algorithms 1 Representations of Graphs There are two standard ways to represent a graph G(V, E) where V is the set of vertices and E is the set of edges. adjacency list representation adjacency

More information

Reference Sheet for CO142.2 Discrete Mathematics II

Reference Sheet for CO142.2 Discrete Mathematics II Reference Sheet for CO14. Discrete Mathematics II Spring 017 1 Graphs Defintions 1. Graph: set of N nodes and A arcs such that each a A is associated with an unordered pair of nodes.. Simple graph: no

More information

Single Source Shortest Path

Single Source Shortest Path Single Source Shortest Path A directed graph G = (V, E) and a pair of nodes s, d is given. The edges have a real-valued weight W i. This time we are looking for the weight and the shortest path from s

More information

CHAPTER 23: ELEMENTARY GRAPH ALGORITHMS Representations of graphs

CHAPTER 23: ELEMENTARY GRAPH ALGORITHMS Representations of graphs CHAPTER 23: ELEMENTARY GRAPH ALGORITHMS This chapter presents methods for representing a graph and for searching a graph. Searching a graph means systematically following the edges of the graph so as to

More information

Determining Resource Needs of Autonomous Agents in Decoupled Plans

Determining Resource Needs of Autonomous Agents in Decoupled Plans Determining Resource Needs of Autonomous Agents in Decoupled Plans Jasper Oosterman a Remco Ravenhorst a Pim van Leeuwen b Cees Witteveen a a Delft University of Technology, Algorithmics group, Delft b

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 7 Greedy Graph Algorithms Topological sort Shortest paths Adam Smith The (Algorithm) Design Process 1. Work out the answer for some examples. Look for a general principle

More information

Localization in Graphs. Richardson, TX Azriel Rosenfeld. Center for Automation Research. College Park, MD

Localization in Graphs. Richardson, TX Azriel Rosenfeld. Center for Automation Research. College Park, MD CAR-TR-728 CS-TR-3326 UMIACS-TR-94-92 Samir Khuller Department of Computer Science Institute for Advanced Computer Studies University of Maryland College Park, MD 20742-3255 Localization in Graphs Azriel

More information

On the Complexity of Interval-Based Constraint. Networks. September 19, Abstract

On the Complexity of Interval-Based Constraint. Networks. September 19, Abstract On the Complexity of Interval-Based Constraint Networks Rony Shapiro 1, Yishai A. Feldman 2, and Rina Dechter 3 September 19, 1998 Abstract Acyclic constraint satisfaction problems with arithmetic constraints

More information

Single Source Shortest Paths

Single Source Shortest Paths Single Source Shortest Paths Given a connected weighted directed graph G(V, E), associated with each edge u, v E, there is a weight w(u, v). The single source shortest paths (SSSP) problem is to find a

More information

Graph Algorithms. Definition

Graph Algorithms. Definition Graph Algorithms Many problems in CS can be modeled as graph problems. Algorithms for solving graph problems are fundamental to the field of algorithm design. Definition A graph G = (V, E) consists of

More information

Data Structures. Elementary Graph Algorithms BFS, DFS & Topological Sort

Data Structures. Elementary Graph Algorithms BFS, DFS & Topological Sort Data Structures Elementary Graph Algorithms BFS, DFS & Topological Sort 1 Graphs A graph, G = (V, E), consists of two sets: V is a finite non-empty set of vertices. E is a set of pairs of vertices, called

More information

Some Applications of Graph Bandwidth to Constraint Satisfaction Problems

Some Applications of Graph Bandwidth to Constraint Satisfaction Problems Some Applications of Graph Bandwidth to Constraint Satisfaction Problems Ramin Zabih Computer Science Department Stanford University Stanford, California 94305 Abstract Bandwidth is a fundamental concept

More information

Computer Science & Engineering 423/823 Design and Analysis of Algorithms

Computer Science & Engineering 423/823 Design and Analysis of Algorithms s of s Computer Science & Engineering 423/823 Design and Analysis of Lecture 03 (Chapter 22) Stephen Scott (Adapted from Vinodchandran N. Variyam) 1 / 29 s of s s are abstract data types that are applicable

More information

Graph Search. Adnan Aziz

Graph Search. Adnan Aziz Graph Search Adnan Aziz Based on CLRS, Ch 22. Recall encountered graphs several weeks ago (CLRS B.4) restricted our attention to definitions, terminology, properties Now we ll see how to perform basic

More information

Announcements. HW3 is graded. Average is 81%

Announcements. HW3 is graded. Average is 81% CSC263 Week 9 Announcements HW3 is graded. Average is 81% Announcements Problem Set 4 is due this Tuesday! Due Tuesday (Nov 17) Recap The Graph ADT definition and data structures BFS gives us single-source

More information

22 Elementary Graph Algorithms. There are two standard ways to represent a

22 Elementary Graph Algorithms. There are two standard ways to represent a VI Graph Algorithms Elementary Graph Algorithms Minimum Spanning Trees Single-Source Shortest Paths All-Pairs Shortest Paths 22 Elementary Graph Algorithms There are two standard ways to represent a graph

More information

Representations of Graphs

Representations of Graphs ELEMENTARY GRAPH ALGORITHMS -- CS-5321 Presentation -- I am Nishit Kapadia Representations of Graphs There are two standard ways: A collection of adjacency lists - they provide a compact way to represent

More information

Local consistency for ternary numeric constraints. Boi Faltings and Esther Gelle. Articial Intelligence Laboratory (LIA)

Local consistency for ternary numeric constraints. Boi Faltings and Esther Gelle. Articial Intelligence Laboratory (LIA) Local consistency for ternary numeric constraints Boi Faltings and Esther Gelle Articial Intelligence Laboratory (LIA) Swiss Federal Institute of Technology (EPFL) IN-Ecublens, 1015 Lausanne, Switzerland

More information

Consistency and Set Intersection

Consistency and Set Intersection Consistency and Set Intersection Yuanlin Zhang and Roland H.C. Yap National University of Singapore 3 Science Drive 2, Singapore {zhangyl,ryap}@comp.nus.edu.sg Abstract We propose a new framework to study

More information

Introduction. I Given a weighted, directed graph G =(V, E) with weight function

Introduction. I Given a weighted, directed graph G =(V, E) with weight function ntroduction Computer Science & Engineering 2/82 Design and Analysis of Algorithms Lecture 06 Single-Source Shortest Paths (Chapter 2) Stephen Scott (Adapted from Vinodchandran N. Variyam) sscott@cse.unl.edu

More information

Graph Algorithms. Chapter 22. CPTR 430 Algorithms Graph Algorithms 1

Graph Algorithms. Chapter 22. CPTR 430 Algorithms Graph Algorithms 1 Graph Algorithms Chapter 22 CPTR 430 Algorithms Graph Algorithms Why Study Graph Algorithms? Mathematical graphs seem to be relatively specialized and abstract Why spend so much time and effort on algorithms

More information

Trees and Graphs Shabsi Walfish NYU - Fundamental Algorithms Summer 2006

Trees and Graphs Shabsi Walfish NYU - Fundamental Algorithms Summer 2006 Trees and Graphs Basic Definitions Tree: Any connected, acyclic graph G = (V,E) E = V -1 n-ary Tree: Tree s/t all vertices of degree n+1 A root has degree n Binary Search Tree: A binary tree such that

More information

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1 CME 305: Discrete Mathematics and Algorithms Instructor: Professor Aaron Sidford (sidford@stanford.edu) January 11, 2018 Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1 In this lecture

More information

On the Relationships between Zero Forcing Numbers and Certain Graph Coverings

On the Relationships between Zero Forcing Numbers and Certain Graph Coverings On the Relationships between Zero Forcing Numbers and Certain Graph Coverings Fatemeh Alinaghipour Taklimi, Shaun Fallat 1,, Karen Meagher 2 Department of Mathematics and Statistics, University of Regina,

More information

Graph Algorithms: Chapters Part 1: Introductory graph concepts

Graph Algorithms: Chapters Part 1: Introductory graph concepts UMass Lowell Computer Science 91.503 Algorithms Dr. Haim Levkowitz Fall, 2007 Graph Algorithms: Chapters 22-25 Part 1: Introductory graph concepts 1 91.404 Graph Review Elementary Graph Algorithms Minimum

More information

CS473-Algorithms I. Lecture 13-A. Graphs. Cevdet Aykanat - Bilkent University Computer Engineering Department

CS473-Algorithms I. Lecture 13-A. Graphs. Cevdet Aykanat - Bilkent University Computer Engineering Department CS473-Algorithms I Lecture 3-A Graphs Graphs A directed graph (or digraph) G is a pair (V, E), where V is a finite set, and E is a binary relation on V The set V: Vertex set of G The set E: Edge set of

More information

CS473-Algorithms I. Lecture 14-A. Graph Searching: Breadth-First Search. Cevdet Aykanat - Bilkent University Computer Engineering Department

CS473-Algorithms I. Lecture 14-A. Graph Searching: Breadth-First Search. Cevdet Aykanat - Bilkent University Computer Engineering Department CS473-Algorithms I Lecture 14-A Graph Searching: Breadth-First Search 1 Graph Searching: Breadth-First Search Graph G =(V, E), directed or undirected with adjacency list repres. GOAL: Systematically explores

More information

Lecture 20 : Trees DRAFT

Lecture 20 : Trees DRAFT CS/Math 240: Introduction to Discrete Mathematics 4/12/2011 Lecture 20 : Trees Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT Last time we discussed graphs. Today we continue this discussion,

More information

Graph Algorithms. Andreas Klappenecker. [based on slides by Prof. Welch]

Graph Algorithms. Andreas Klappenecker. [based on slides by Prof. Welch] Graph Algorithms Andreas Klappenecker [based on slides by Prof. Welch] 1 Directed Graphs Let V be a finite set and E a binary relation on V, that is, E VxV. Then the pair G=(V,E) is called a directed graph.

More information

Outline. 1 Introduction. 2 Algorithm. 3 Example. 4 Analysis. 5 References. Idea

Outline. 1 Introduction. 2 Algorithm. 3 Example. 4 Analysis. 5 References. Idea Outline Computer Science 331 Graph Search: Breadth-First Search Mike Jacobson Department of Computer Science University of Calgary Lecture #31 1 2 3 Example 4 5 References Mike Jacobson (University of

More information

Graphs: basic concepts and algorithms

Graphs: basic concepts and algorithms : basic concepts and algorithms Topics covered by this lecture: - Reminder Trees Trees (in-order,post-order,pre-order) s (BFS, DFS) Denitions: Reminder Directed graph (digraph): G = (V, E), V - vertex

More information

Graph Algorithms Using Depth First Search

Graph Algorithms Using Depth First Search Graph Algorithms Using Depth First Search Analysis of Algorithms Week 8, Lecture 1 Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Graph Algorithms Using Depth

More information

Outline. Computer Science 331. Analysis of Prim's Algorithm

Outline. Computer Science 331. Analysis of Prim's Algorithm Outline Computer Science 331 Analysis of Prim's Algorithm Mike Jacobson Department of Computer Science University of Calgary Lecture #34 1 Introduction 2, Concluded 3 4 Additional Comments and References

More information

Copyright (C) 1997, 1998 by the Association for Computing Machinery, Inc. Permission to make digital or hard copies of part or all of this work for

Copyright (C) 1997, 1998 by the Association for Computing Machinery, Inc. Permission to make digital or hard copies of part or all of this work for Copyright (C) 1997, 1998 by the Association for Computing Machinery, Inc. Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided

More information

MODELLING AND SOLVING SCHEDULING PROBLEMS USING CONSTRAINT PROGRAMMING

MODELLING AND SOLVING SCHEDULING PROBLEMS USING CONSTRAINT PROGRAMMING Roman Barták (Charles University in Prague, Czech Republic) MODELLING AND SOLVING SCHEDULING PROBLEMS USING CONSTRAINT PROGRAMMING Two worlds planning vs. scheduling planning is about finding activities

More information

An algorithm for Performance Analysis of Single-Source Acyclic graphs

An algorithm for Performance Analysis of Single-Source Acyclic graphs An algorithm for Performance Analysis of Single-Source Acyclic graphs Gabriele Mencagli September 26, 2011 In this document we face with the problem of exploiting the performance analysis of acyclic graphs

More information

ECE250: Algorithms and Data Structures Single Source Shortest Paths Bellman-Ford Algorithm

ECE250: Algorithms and Data Structures Single Source Shortest Paths Bellman-Ford Algorithm ECE250: Algorithms and Data Structures Single Source Shortest Paths Bellman-Ford Algorithm Ladan Tahvildari, PEng, SMIEEE Associate Professor Software Technologies Applied Research (STAR) Group Dept. of

More information

CSI 604 Elementary Graph Algorithms

CSI 604 Elementary Graph Algorithms CSI 604 Elementary Graph Algorithms Ref: Chapter 22 of the text by Cormen et al. (Second edition) 1 / 25 Graphs: Basic Definitions Undirected Graph G(V, E): V is set of nodes (or vertices) and E is the

More information

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting CS2 Algorithms and Data Structures Note 10 Depth-First Search and Topological Sorting In this lecture, we will analyse the running time of DFS and discuss a few applications. 10.1 A recursive implementation

More information

Graph representation

Graph representation Graph Algorithms 1 Graph representation Given graph G = (V, E). May be either directed or undirected. Two common ways to represent for algorithms: 1. Adjacency lists. 2. Adjacency matrix. When expressing

More information

2386 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 52, NO. 6, JUNE 2006

2386 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 52, NO. 6, JUNE 2006 2386 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 52, NO. 6, JUNE 2006 The Encoding Complexity of Network Coding Michael Langberg, Member, IEEE, Alexander Sprintson, Member, IEEE, and Jehoshua Bruck,

More information

The Encoding Complexity of Network Coding

The Encoding Complexity of Network Coding The Encoding Complexity of Network Coding Michael Langberg Alexander Sprintson Jehoshua Bruck California Institute of Technology Email: mikel,spalex,bruck @caltech.edu Abstract In the multicast network

More information

A CSP Search Algorithm with Reduced Branching Factor

A CSP Search Algorithm with Reduced Branching Factor A CSP Search Algorithm with Reduced Branching Factor Igor Razgon and Amnon Meisels Department of Computer Science, Ben-Gurion University of the Negev, Beer-Sheva, 84-105, Israel {irazgon,am}@cs.bgu.ac.il

More information

Lecture 22 Tuesday, April 10

Lecture 22 Tuesday, April 10 CIS 160 - Spring 2018 (instructor Val Tannen) Lecture 22 Tuesday, April 10 GRAPH THEORY Directed Graphs Directed graphs (a.k.a. digraphs) are an important mathematical modeling tool in Computer Science,

More information

Finding a winning strategy in variations of Kayles

Finding a winning strategy in variations of Kayles Finding a winning strategy in variations of Kayles Simon Prins ICA-3582809 Utrecht University, The Netherlands July 15, 2015 Abstract Kayles is a two player game played on a graph. The game can be dened

More information

Maximal Tractable Fragments of the Region Connection Calculus: A Complete Analysis

Maximal Tractable Fragments of the Region Connection Calculus: A Complete Analysis Maximal Tractable Fragments of the Region Connection Calculus: A Complete Analysis Jochen Renz Institut fiir Informatik, Albert-Ludwigs-Universitat Am Flughafen 17, 79110 Freiburg, Germany Abstract We

More information

Dijkstra s Shortest Path Algorithm

Dijkstra s Shortest Path Algorithm Dijkstra s Shortest Path Algorithm DPV 4.4, CLRS 24.3 Revised, October 23, 2014 Outline of this Lecture Recalling the BFS solution of the shortest path problem for unweighted (di)graphs. The shortest path

More information

Undirected Graphs. DSA - lecture 6 - T.U.Cluj-Napoca - M. Joldos 1

Undirected Graphs. DSA - lecture 6 - T.U.Cluj-Napoca - M. Joldos 1 Undirected Graphs Terminology. Free Trees. Representations. Minimum Spanning Trees (algorithms: Prim, Kruskal). Graph Traversals (dfs, bfs). Articulation points & Biconnected Components. Graph Matching

More information

Representations of Weighted Graphs (as Matrices) Algorithms and Data Structures: Minimum Spanning Trees. Weighted Graphs

Representations of Weighted Graphs (as Matrices) Algorithms and Data Structures: Minimum Spanning Trees. Weighted Graphs Representations of Weighted Graphs (as Matrices) A B Algorithms and Data Structures: Minimum Spanning Trees 9.0 F 1.0 6.0 5.0 6.0 G 5.0 I H 3.0 1.0 C 5.0 E 1.0 D 28th Oct, 1st & 4th Nov, 2011 ADS: lects

More information

Taking Stock. Last Time Flows. This Time Review! 1 Characterize the structure of an optimal solution

Taking Stock. Last Time Flows. This Time Review! 1 Characterize the structure of an optimal solution Taking Stock IE170: Algorithms in Systems Engineering: Lecture 26 Jeff Linderoth Last Time Department of Industrial and Systems Engineering Lehigh University April 2, 2007 This Time Review! Jeff Linderoth

More information

n-ary constraints are provided by many constraint programming languages and libraries. There are two main approaches to deal with n-ary CSPs. The rst

n-ary constraints are provided by many constraint programming languages and libraries. There are two main approaches to deal with n-ary CSPs. The rst Arc Consistency on n-ary Monotonic and Linear Constraints Zhang Yuanlin and Roland H.C. Yap School of Computing National University of Singapore 3 Science Drive 2 Republic of Singapore 119260 fzhangyl,ryapg@comp.nus.edu.sg

More information

Backtracking algorithms for disjunctions of temporal constraints

Backtracking algorithms for disjunctions of temporal constraints Artificial Intelligence 120 (2000) 81 117 Backtracking algorithms for disjunctions of temporal constraints Kostas Stergiou a,, Manolis Koubarakis b,1 a APES Research Group, Department of Computer Science,

More information

Validating Plans with Durative Actions via Integrating Boolean and Numerical Constraints

Validating Plans with Durative Actions via Integrating Boolean and Numerical Constraints Validating Plans with Durative Actions via Integrating Boolean and Numerical Constraints Roman Barták Charles University in Prague, Faculty of Mathematics and Physics Institute for Theoretical Computer

More information

Fundamental Graph Algorithms Part Three

Fundamental Graph Algorithms Part Three Fundamental Graph Algorithms Part Three Outline for Today Topological Sorting, Part II How can we quickly compute a topological ordering on a DAG? Connected Components How do we find the pieces of an undirected

More information

COL 702 : Assignment 1 solutions

COL 702 : Assignment 1 solutions COL 70 : Assignment 1 solutions 1(a ( n T (n = T + bn log n ( n = T + b n ( n log + bn log n ( n = T + b n ( n 8 log + b n log ( n + bn log n = bn log n + b n log n + bn log n +... log n terms = nb [(log

More information

1 Dijkstra s Algorithm

1 Dijkstra s Algorithm Lecture 11 Dijkstra s Algorithm Scribes: Himanshu Bhandoh (2015), Virginia Williams, and Date: November 1, 2017 Anthony Kim (2016), G. Valiant (2017), M. Wootters (2017) (Adapted from Virginia Williams

More information

A SIMPLE APPROXIMATION ALGORITHM FOR NONOVERLAPPING LOCAL ALIGNMENTS (WEIGHTED INDEPENDENT SETS OF AXIS PARALLEL RECTANGLES)

A SIMPLE APPROXIMATION ALGORITHM FOR NONOVERLAPPING LOCAL ALIGNMENTS (WEIGHTED INDEPENDENT SETS OF AXIS PARALLEL RECTANGLES) Chapter 1 A SIMPLE APPROXIMATION ALGORITHM FOR NONOVERLAPPING LOCAL ALIGNMENTS (WEIGHTED INDEPENDENT SETS OF AXIS PARALLEL RECTANGLES) Piotr Berman Department of Computer Science & Engineering Pennsylvania

More information

LECTURE NOTES OF ALGORITHMS: DESIGN TECHNIQUES AND ANALYSIS

LECTURE NOTES OF ALGORITHMS: DESIGN TECHNIQUES AND ANALYSIS Department of Computer Science University of Babylon LECTURE NOTES OF ALGORITHMS: DESIGN TECHNIQUES AND ANALYSIS By Faculty of Science for Women( SCIW), University of Babylon, Iraq Samaher@uobabylon.edu.iq

More information

Path Consistency Revisited. Moninder Singh. University of Pennsylvania. Philadelphia, PA

Path Consistency Revisited. Moninder Singh. University of Pennsylvania. Philadelphia, PA Proceedings of the 7th IEEE International Conference on Tools with Articial Intelligence, 318-325, 1995. c Institute of Electrical and Electronics Engineers, Inc. (IEEE). Path Consistency Revisited Moninder

More information

Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest. Introduction to Algorithms

Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest. Introduction to Algorithms Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest Introduction to Algorithms Preface xiii 1 Introduction 1 1.1 Algorithms 1 1.2 Analyzing algorithms 6 1.3 Designing algorithms 1 1 1.4 Summary 1 6

More information

Minimum Spanning Trees

Minimum Spanning Trees Minimum Spanning Trees Problem A town has a set of houses and a set of roads. A road connects 2 and only 2 houses. A road connecting houses u and v has a repair cost w(u, v). Goal: Repair enough (and no

More information

A Simplified Correctness Proof for a Well-Known Algorithm Computing Strongly Connected Components

A Simplified Correctness Proof for a Well-Known Algorithm Computing Strongly Connected Components A Simplified Correctness Proof for a Well-Known Algorithm Computing Strongly Connected Components Ingo Wegener FB Informatik, LS2, Univ. Dortmund, 44221 Dortmund, Germany wegener@ls2.cs.uni-dortmund.de

More information

Faster Constraint Satisfaction Algorithms for Temporal Reasoning' (*)

Faster Constraint Satisfaction Algorithms for Temporal Reasoning' (*) TECHNICAL REPORT R-151 July, 1990 Faster Constraint Satisfaction Algorithms for Temporal Reasoning' (*) Itay Meiri and Judea Pearl Cognitive Systems Laboratory Computer Science Department University of

More information

W4231: Analysis of Algorithms

W4231: Analysis of Algorithms W4231: Analysis of Algorithms 10/21/1999 Definitions for graphs Breadth First Search and Depth First Search Topological Sort. Graphs AgraphG is given by a set of vertices V and a set of edges E. Normally

More information

Temporal Constraint Networks 3. Eddie Schwalb, Rina Dechter. Abstract

Temporal Constraint Networks 3. Eddie Schwalb, Rina Dechter. Abstract Processing Disjunctions in Temporal Constraint Networks 3 Eddie Schwalb, Rina Dechter Department of Information and Computer Science University of California at Irvine, CA 92717 eschwalb,dechter@ics.uci.edu

More information

Strongly connected: A directed graph is strongly connected if every pair of vertices are reachable from each other.

Strongly connected: A directed graph is strongly connected if every pair of vertices are reachable from each other. Directed Graph In a directed graph, each edge (u, v) has a direction u v. Thus (u, v) (v, u). Directed graph is useful to model many practical problems (such as one-way road in traffic network, and asymmetric

More information

Shortest path problems

Shortest path problems Next... Shortest path problems Single-source shortest paths in weighted graphs Shortest-Path Problems Properties of Shortest Paths, Relaxation Dijkstra s Algorithm Bellman-Ford Algorithm Shortest-Paths

More information