Incremental Computation of Dominator Trees

Size: px
Start display at page:

Download "Incremental Computation of Dominator Trees"

Transcription

1 Incremental Computation of Dominator Trees Vugranam C. Sreedhar Guang R. Gao ACAPS Laboratory School of Computer Science McGill niversity, CANADA Yong-fong Lee Application Development Technology Institute IBM Software Solutions Division San Jose, California Abstract Data flow analysis based on an incremental approach may require that the dominator tree be correctly maintained at all times [CR88]. Previous solutions to the problem of incrementally maintaining dominator trees were restricted to reducible flowgraphs [RR94, CR88]. In this paper we present a new algorithm for incrementally maintaining the dominator tree of an arbitrary flowgraph, either reducible or irreducible, based on a program representation called the DJ-graph [SG95, SGL94a]. For the case where an edge is inserted, our algorithm is also faster than previous approaches (in the worst case. For the deletion case, our algorithm is likely to run fast on the average cases. Introduction In the past few years, Static Single Assignment (SSA form [CFR 89, CFR 9], Sparse Evaluation Graphs (SEG [CCF9], and other related intermediate representations have been successfully used for efficient data flow analysis and program transformations [CLZ86, RWZ88, AWZ88, WZ85, WCES94]. Construction of these intermediate representations needs to first compute the dominance relation of a flowgraph. An inherent difficulty in aggressive program optimizations based on SSA is maintaining the correct SSA form after every program transformation. To achieve this one must correctly maintain the dominator tree of the flowgraph. In this paper we present a new algorithmic framework for incrementally maintaining the dominator tree of an arbitrary Copyright c 995 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 that copies are not made or distributed for profit or direct commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers, or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from Publications Dept., ACM Inc., fax + ( , or (permissions@acm.org. IR 95, /95, pp -2, San Francisco, California, SA c 995 ACM flowgraph. For this problem previous work most relevant to this paper includes only the Carroll-Ryder algorithm [CR88] and the Ramalingam-Reps algorithm [RR94]. Both methods are restricted to reducible flowgraphs. By contrast, our approach can handle irreducible as well as reducible flowgraphs. Our algorithms only performs updates based on the nodes which are affected by the corresponding insertion or deletion of an edge (thus reducing the total cost; furthermore, the properties of DJ-graphs are used to efficiently identify these affected nodes. For the case where an edge is inserted, our algorithm has an time complexity, where is the number of edges in the flowgraph better than previous approaches [CR88, RR94]. For the deletion case, our new incremental algorithm is also competitive in terms of running time. It is expected to run faster on the average cases while not compromising its worstcase time complexity. To incrementally maintain a dominator tree, we use properties of DJ-graphs [SG95, SGL94a] and iterated dominance frontiers [CFR 9]. A DJ-graph is nothing but a dominator tree augmented with join edges that potentially lead to merge points in the corresponding flowgraph. In a flowgraph, an edge is a join edge if does not strictly dominate. DJ-graphs allow us to solve a number of flowgraph problems [SGL94a, SG95]. In particular, it enables us to design an algorithm for computing - nodes for an arbitrary Sparse Evaluation Graph (SEG in linear time and space [SG95]. In this paper, we go one step further and show how to update a DJ-graph in response to changes made in the corresponding flowgraph. Since DJ-graphs are dominator trees augmented with join edges, the problem of updating DJ-graphs subsumes the problem of updating dominator trees. We are currently implementing a complete framework based on DJ-graphs for performing sparse and incremental analysis, including dominator updates. Organization. Section 2 introduces notation and terminology that will be used later. Section 3 illustrates the difficulty in updating dominator trees, and it defines our problem statement of updating DJ-graphs. Sections 4 and 5 together present our DJ-graph update algorithm in handling edge insertions and deletions, respectively. Section 6 discusses related work. Section 7 gives our concluding remarks. Appendix A gives the exhaustive Purdom-Moore dominator finding algorithm. Lastly,

2 Appendix B gives the Sreedhar-Gao linear time algorithm for computing iterated dominance frontiers for a set of nodes. START START 2 Background and Notation A flowgraph is a directed graph START, where is the set of nodes, is the set of flow edges, and START is the distinguished start node. Figure (a shows an example flowgraph. A path of length is a sequence of edges, where every. Given the flowgraph of a program, we define the reachable subgraph START to be a subgraph of such that all nodes in START are reachable from START. In the reachable subgraph REACH START, a node dominates another node iff all paths from START to pass through. We write to indicate that dominates, and write! when does not dominate. If and, then strictly dominates. We write! to indicate strictly dominates, and write!! when does not strictly dominate. The dominance relation is reflexive and transitive, and can be represented by a tree, called the dominator tree. For example, Figure (b shows the dominator tree of our example flowgraph. If is a parent node of in a dominator tree, then immediately dominates ; we write "$#&%(' to denote the immediate dominator of. Given a node in the dominator tree, we define +-,. to be the dominator subtree rooted at. Note that the nodes in +,/. is simply the set of all nodes dominated by. For each node in the dominator tree we associate a level number that is the depth of the node from the root. We write 2 to indicate the level number of a node. START3 4 is assumed to be one. The dominance frontier 576 of a node is the set of all such that dominates a predecessor of but does not strictly dominate [CFR 9]. We can extend the definition of dominance frontier 586 to a set of nodes : 576 9;: <(=?> We define iterated dominance nodes as the limit of the A A 586 B 8CD@?576 for a set of If is a set, we will use the notation E E to represent the number of elements in the set. Recently we proposed a linear time algorithm for computing the iterated dominance frontier for a set of nodes, using DJgraphs [SG95]. A DJ-graph is a dominator tree augmented with Note that a flowgraph does not need to be connected; that is, some nodes may not be reachable from the START node. ( (2 2 END Flowgraph (a Dominator Tree Figure : A flowgraph and its dominator tree join edges. A flowgraph edge is a join edge if its source node does not strictly dominate its destination node. In constructing the DJ-graph for the reachable subgraph REACH START, we first build its dominator tree and then appropriately insert the J-edges. Figure 2 shows the DJ-graph of our example flowgraph given in Figure (a. To see how a join edge is inserted, let us consider node 3. It has two incoming edges 3 and 7 3. Of these two edges only 7 3 is a join edge (since node strictly dominates 3, 3 is not a join edge. Clarification: We would like to clarify some terminology in order to avoid confusion in later discussions. Dominator trees and DJ-graphs are constructed only for the reachable subgraph REACHF STARTG. Whenever we use the phrase a flowgraph and its DJ-graph, we are referring to the reachable subgraph REACHF STARTG and its DJ-graph. A DJ-graph consists of a dominator tree and join edges. Therefore, whenever we use the term dominator tree, we also mean a DJ-graph without J-edges. Since a flowgraph and its DJ-graph contain the same set of nodes, whenever we use the term node H, the node H may belong to either the flowgraph or the DJ-graph, unless explicitly specified by using subscript notation with I for flowgraph and J for DJ-graph. When we describe a graph property without using subscripts, the property holds on both a flowgraph and its DJ-graph. Finally, the iterated dominance frontier of a node K is the same when computed on either the DJ-graph or the flowgraph. Thus, all of LMONPFQKRG, LMONPFSK2T&G and LMONPFSK22G will mean the same thing. (b 7 END 2

3 START END Figure 2: The DJ-graph of the example flowgraph sing the DJ-graph, we can easily compute the dominance frontier of a node based on Lemma 2.. When computing 576, we examine all the J-edges coming out of +-,.. The destination nodes of these J-edges are in the dominance frontier of when they satisfy certain level constraint [SG95]. We have also extended the above intuition and proposed a linear time algorithm for computing the iterated dominance frontier for a set of nodes [SG95]. Lemma 2. A node is in 586 in +,. 2. if and only if there exists a node 2 such that is a J-edge and 3 3 Dominator pdate: Motivation and Problem Definition Carroll and Ryder pointed out in [CR88]: The inherent difficulty in the dominator update problem lies in the non-locality of domination, to wit, given two nodes and in the flow graph, whether dominates depends on the presence or absence of paths through nodes arbitrarily far from either or. Adding or removing a single flow graph edge an act which can add or remove large numbers of paths can thus affect domination between nodes arbitrarily far from the altered edge. Consider our example flowgraph and its dominator tree shown in Figure (a and (b, respectively. Let us see what happens when a new edge 2 4 is inserted. With this new edge, the dominance relation for many nodes is affected. For example, in the newly modified flowgraph, node 3 will no longer dominate 4. Actually node 3 ceases to dominate 6 and 8 as well. The reason for this is obvious: By inserting 2 4 we have created alternative paths from START to nodes 4, 6 and 8 that do not pass through node 3. Notice that the insertion of 2 4 has affected node 8 that is far from both nodes 2 and 4. The situation is also true (but opposite when an edge is deleted; this deletion can again affect nodes arbitrarily far away. Also notice that, in the above example, the flowgraph becomes irreducible after 2 4 is inserted. Previous approaches to this problem that we are aware of, the Carroll-Ryder and the Ramalingam-Reps algorithms, cannot proceed further when this happens. Both methods use properties of flowgraphs and the dominance relation that are only valid for reducible flowgraphs. In our approach, we use properties of DJ-graphs to update dominator trees. These properties are valid for both reducible and irreducible flowgraphs. Consequently, we can handle irreducible flowgraphs while the previous approaches could not. One of our important observations is that the dominator tree alone is not sufficient to capture all the path information in a flowgraph; it only gives one type of path relationship among nodes in a flowgraph meaning, a node dominates another node iff all paths from START to must pass through. By adding J-edges to the dominator tree (a la DJ-graph we capture all the path in a flowgraph. Thus in a DJ-graph we capture both the path information and the domination relation in a unified representation. This allows us to easily compute the set of affected nodes when an edge is added or deleted. A node is called affected iff its immediate dominator will change because of a flowgraph update. Therefore, a key question to be answered in the rest of this paper is: how can we efficiently compute the set of affected nodes no matter how far away they may be from the updated edge? To summarize, the problem we consider in the next two sections is the DJ-graph update problem: We want to maintain the DJ-graph for the reachable subgraph of a flowgraph in which changes are made one at a time. This problem subsumes the dominator tree update problem. The algorithms given in Figures 3 and 5 collectively form our incremental algorithm for maintaining the DJ-graph when a new edge is inserted and an existing edge is deleted, respectively. These algorithms handle situations where and are reachable from START both before and after an update. We will handle other situations as special cases. 4 Dominator pdate: Insertion of an Edge In this section, we present a simple algorithm for updating the DJ-graph (and hence the dominator tree of a flowgraph in response to a flowgraph edge insertion. Recall that when an edge T T is inserted, it can affect nodes arbitrarily far away. One of our key observations is that all the affected 3

4 5 C pdateinsertedge : 2: 3: if! 4: " E C8@?576 "! #$# 5: foreach ( do 6: " #&%R' 7: + / cut the old D-edge / 8: if( T T is a flowgraph edge 9: "$! #$# : endif : "$ #$# / new D-edge / 2: endfor 3: foreach -. do 4: pdatelevelnumber 5: endfor 2 2 / if % '& H then we should insert a D-edge. See step / ; /? is the (old immediate dominator / / insert a J-edge from? to,9 / / pdate the level for nodes in / F7, G / Figure 3: An incremental algorithm for updating a DJ-graph when a new edge corresponding flowgraph is inserted into the nodes must be in the set is as follows: By inserting the edge T. The reason for this T, we may have created a path (in the flowgraph from STARTT to a node, say T, in T C@?586 T such that the path includes T T but bypasses the immediate dominator of T. However, not all the nodes in C7@?586 will be truly affected. We will formally prove later that the affected nodes are only those additionally satisfying certain level constraint. Once we find the exact set of affected nodes, we need to answer: What will be their new immediate dominators after the edge insertion? First note that will definitely dominate all the affected nodes. Ramalingam and Reps gave a stronger claim to answer this question: Not only does dominate all the affected nodes, but also it is actually their immediate dominator (Lemma 4.. We will utilize this claim in our algorithm too. Before presenting our algorithm for handling an edge insertion, we want to clarify the following point: We do not incrementally maintain the iterated dominance frontiers (IDFs for all the nodes in our approach. There are two reasons. First, we have a very efficient algorithm for in linear time when we are told that T T is the newly inserted edge [SG95]. Second, if we were to update IDFs, we would need to pay extra space and time overhead. The time required for updating IDFs for all the nodes can be much longer than that spent in for one node. 4. Algorithm Let T T be the newly inserted flowgraph edge. Assume that both T and T are reachable from START even before the insertion. The algorithm in Figure 3 gives a procedure to restructure the DJ-graph in response to changes in the dominance relation when T T is inserted. There are two supporting functions used in the algorithm: ( "$! #$# %(.85 #$# inserts into the DJ-graph a new edge of the appropriate type; and (2 + deletes. In the algorithm, we first compute 8 (step. Then we compute, at step 2, the set of affected nodes. E 2 : 3 2 ;. There are two conditions for a node to be in. : ( it must be in and (2 its level number must be greater than 2. sing our linear time algorithm for on-the-fly, we thus can avoid processing any node whose level number is not greater than 2 [SG95]. 2 Once we have computed., we pull up each affected node and make (i.e., its new immediate dominator (step. We also delete the D-edge to every affected node from its (old immediate dominator (step 7. If there is a flowgraph edge between these two nodes, we insert a J-edge in place of the deleted D-edge at step 8. Finally, we update the level number for all the descendant nodes of every affected nodes at step 4. Example. Consider our example flowgraph in Figure (a and its DJ-graph in Figure 2. Let us insert a new edge 2 4 in the flowgraph. The resulting flowgraph is shown in Figure 4(a. From the DJ-graph (in Figure O 2 we 9 can find 2 4 and compute After this we pull up all the affected nodes and make node their new immediate dominator. At the same time, we remove D-edges 3 4, 3 6 and 3 8. Since node 2 does not dominate 4, we insert a new J-edge 2 4. We also insert J-edges 3 4 and 3 8 in the DJ- 2 For convenience we provide a high-level description of our linear time algorithm in Appendix B. 4

5 graph, because their counterparts exist in the flowgraph. The updated DJ-graph is given in Figure 4(b. 4.2 Correctness and Complexity In this subsection, we prove the correctness of the algorithm given in Figure 3 (Theorem 4. and analyze its complexity (Theorem 4.2. Without loss of generality, we assume that T and T are reachable both before and after the insertion of T T. Theorem 4. is the main theorem that establishes the correctness of the algorithm. Its proof is based on Lemmas 4. and 4.4. Lemma 4. claims that a unique node will be the new immediate dominator of all the affected nodes. Lemma 4.4 gives a necessary and sufficient condition to determine the exact set of affected nodes. Its validity is further based on two other lemmas, Lemma 4.2 and Lemma 4.3. Lemma 4.2 claims that strictly dominates. Lemma 4.3 then "$#&%(' establishes a relation between any two nodes and when D@?586 and is reachable from. Lemma 4. Let T T be a newly inserted edge and let. Then must immediately dominate every affected node after the insertion. Proof: Let be affected after T T is inserted. Note that dominates even in the new flowgraph (since there exists no path from START to that avoids. Let be the new immediate dominator of after the insertion. Note that cannot be "$#&%(' before insertion (since is affected. Suppose that were not. Then!!. Consider any path : T T T T in the new flowgraph. must include T since. There are two possibilities: "$#&%('. Node T is in T T. This implies that T is also on any path from T to T before T T is inserted. Therefore, should have been the nearest common ancestor of and 8.. This contradicts 2. Node T is in T T. This implies that the insertion of T T should not have affected. Therefore, is already s immediate dominator before the edge insertion, so should not be affected. This contradicts our assumption that is an affected node. 2 START END Flowgraph (a START END DJ-graph Figure 4: The flowgraph and its DJ-graph after 2 (b 4 inserted Lemma 4. claims that, before the DJ-graph is updated, will be the new immediate dominator of all the affected nodes (after the update. This was originally given by Ramalingam and Reps in [RR94]. The lemma is one key result to support the correctness of our algorithm. It also forms the basis for our second key result (Lemma 4.4. Since neither possibility can be true, must be the same as ; that is, must be the immediate dominator of any affected node. To prove our second key result (Lemma 4.4, we need the following two supporting lemmas. Lemma 4.2 establishes a relation between a node and the immediate dominator of a. node Lemma 4.2 If Proof: Let then! the lemma. "$#&%R', then "$#&%(' sdom.. We will first show that if 586. sing this result we will prove the validity of Assume that does not strictly dominate. Then there must be a path from START to that does not pass through. Since 586, there must be a predecessor node strictly dominated by (follows from Lemma 2.. From this we can immediately see that there is a path from START in the DJ-graph that does not pass through, contradicting the assumption that "$#&%R'. Therefore!. Now, then there exist nodes + + such that +, +, and , where ". So we have "$#&%(' +! +, ". Consequently, "$#&%(' + "$#&%(' +, ". Hence "$#&%(' + "$#&%(' + ; that is, "$#&%(' "$#&%R'. This implies "$#&%('!. The next supporting lemma establishes a relation between any two nodes and such that is reachable from but is not This result is similar to Lemma 4 in [CFR 9]. 5

6 E C Lemma 4.3 Let be reachable from another Then there exists a node sdom. C7@?586, and let such that Proof: Assume!! (otherwise, the proof is trivial. Since is reachable from, let be a path from to. Let be the node on such that and is closest to among all nodes which are on and are must exists (e.g. in the extreme can be such a.. Such a Now we claim that all nodes on between and must be dominated by. We show this claim by contradiction. Assume that some of these nodes are not dominated by. Let + be one such nodes that is closest to on. Then by definition of dominance frontiers, + must be in 586 (hence a contradiction (since we know is the only node which lies between and! Based on this claim, we state that must be strictly dominated by. Otherwise, will be in 586 (hence ; this contradicts our lemma assumption. Next we present Lemma 4.4. sing this lemma we can determine the exact set of nodes that are indeed affected when a flowgraph edge T T is inserted. Before the edge was inserted, there must have been a path from "$#&%(' to that avoided ; for otherwise would also dominate, and so would not be the immediate dominator of. As a consequence, before the edge was inserted, must have already dominated. For if not, there would have been a path from START to avoiding, and this path could be continued as in the previous paragraph to u still avoiding. Since the path would still exist after insertion of the edge, this would contradict the fact that is the immediate dominator of after insertion. Hence before insertion, we must have ; i.e ". Next we will show that is either or is It is obvious to see that that if is same as, is in.. Now assume that. We will show that DD@?586. Assume to the contrary that is not Since is reachable from, either strictly dominate or there must be a node that strictly dominates (follows from Lemma 4.3. In both cases we can see that is not affected. But we know that is indeed affected, so must be Lemma 4.4 Let T T be a newly inserted edge in the flowgraph, and let. Let DomAffected and 2 2. Then a node is affected iff D DomAffected I. Proof: The if part: We want to show that if is in. then it is affected. Let "$#&%(' before T T is inserted. Since is in., This implies Thus we first conclude that cannot be the same as. also implies, or The fact If, then!. then " #&%R'! by Lemma 4.2. In summary, must strictly dominate. But!! because otherwise, in place of, would have been the nearest common ancestor of and (since Now consider the insertion of T T in the flowgraph. Since does not strictly dominate, the edge insertion creates at least one path STARTT T T A T that bypasses T both when and Consequently, is truly affected. The only if part: Here we will show that if is affected then is in.. First we will show that if is affected then 2 2. Finally, we state our first main theorem that establishes the correctness of our algorithm for handling an edge insertion. Theorem 4. The algorithm in Figure 3 correctly updates the DJgraph of a flowgraph when a new edge T flowgraph. T is inserted in the Proof: From Lemma 4. we know must immediately dominate all the affected nodes. Now to determine which nodes are indeed affected we use Lemma 4.4. Since we can in linear time with respect to the number of outgoing D-edges and J-edges from the nodes in +-,. (see [SG95] for details, the set. can also be computed in linear time. In addition, the time complexity for computing 8 is linear with respect to the number of nodes in +,/., and the functions "$ and + take time. Therefore, the worst-case time complexity for updating the DJ-graph in response to a flowgraph edge insertion is. Note that we never visit nodes outside of in the update process. +-,. Our second main theorem gives the worst-case time complexity of the algorithm given in Figure 3. Theorem 4.2 Assume that both T and T are reachable before the insertion of T T. Then the worst-case time complexity of the algorithm given in Figure 3 is, where is the number of edges. in the DJ-subgraph induced by the nodes in +-,. 6

7 4.3 Other Cases Let T T be the newly inserted edge in the flowgraph. Here we will describe how to handle other cases where the reachability of T and T from STARTT is different from what we have assumed in the previous subsection. The first case is where T is not reachable, for which we do nothing because we maintain the DJ-graph only for the reachable subgraph REACH START. In the second case, T becomes reachable only after the edge insertion. For this we first build (using exhaustive algorithm the DJ-subgraph for the sub-flowgraph induced by nodes reachable from T but not reachable from STARTT. In constructing this DJ-subgraph, we treat as its root. Since must dominate, we then insert a D-edge from to (to connect the newly built DJ-subgraph with the existing DJ-graph. Finally, from the viewpoint of updating DJ-graph, we pretend each T to be a newly inserted flowgraph edge, where edge T T becomes reachable only after T T is inserted, and T is reachable even before the edge insertion. This surprisingly corresponds to the case discussed in the previous subsection. To complete the DJ-graph update, we invoke the algorithm given T. in Figure 3 once for each T For example, node 9 is unreachable in Figure (a, but becomes reachable after we insert 9. Therefore, we first construct the DJ-subgraph for the sub-flowgraph induced by nodes 9,, and. Then we insert a D-edge from to 9. Finally, we use the algorithm given in Figure 3 to update the DJ-graph once for 5 and once for 7 as if they were newly inserted flowgraph edges. 5 Dominator pdate: Deletion of an Edge In this section, we show how to update a DJ-graph when a flowgraph edge T T is deleted. The effect of deleting an edge is opposite and complementary to that of inserting the same edge. When inserting T T, we pull up the affected nodes in the DJ-graph to the level of 2. Note that if. is not empty, it must include. Therefore, all the other affected nodes will be siblings to after the DJ-graph update. By contrast, when deleting T T, we pull down these affected nodes. In the deletion case, however, we have two major difficulties. First, it is hard to find the exact set of affected nodes. Second, the new immediate dominators of the affected nodes can be different. To overcome the first difficulty, we use a conservative approximation for the set of affected nodes. This set of possibly affected nodes is. E Since this set is a safe approximation, not every node in the set will be pulled down 3. can possibly be reduced by removing any node such that is a flowgraph edge, since can never be pulled down. For simplicity, we use only the two given conditions to determine if a node is in. in response to a flowgraph edge deletion. To overcome the second difficulty while avoiding an exhaustive algorithm, we observe that the new immediate dominator of any affected node must be a descendant of "$#&%('. Therefore, if any update on the DJ-graph needs to happen, it will only affect the nodes in +-,. "$#&%R'. Based on these two observations, we present an efficient incremental algorithm for only computing the possibly affected nodes new dominators, which are then used to compute their new immediate dominators. 5. Algorithm As pointed out previously, our approach to updating a DJ-graph in response to a flowgraph edge deletion will be centered at an incremental algorithm for computing the new dominators for all the possibly affected nodes. In the following, we will explain how we transform the exhaustive Purdom-Moore algorithm into an incremental algorithm that will be much more efficient in practice. The original Purdom-Moore algorithm is given in Appendix A for reference. Let 58%(' denote the set of dominators for node. Our modifications to the exhaustive Purdom-Moore algorithm are the following: First, " #&%R' will continue to dominate every possibly affected node in after the update, although it may no longer be its immediate dominator. We, therefore, can focus on the nodes in +-,. while ignoring others. Consequently, we will compute the 58%(' sets for all the possibly affected nodes as if no other nodes existed outside of +-,.. Second, we will monitor the ;&;# condition (step 39 in Algorithm A. only for the possibly affected nodes. Third, whenever 58%(' changes for a node (., the 57%R' set also changes for every descendant of. This seems to indicate that we also must observe the ;&;# condition for any descendant of every possibly affected node. Fortunately, 58%R' can be partially deduced from 58%R' as explained later. For our algorithm design, we partition all the nodes in into three classes: +-,.. PossiblyAffected: The set of nodes in this class is the same as. 2. PseudoAffected: This set consists of any proper descendant of a PossiblyAffected node. Note that a! & node s immediate dominator does not change, but its dominators may change. 3. NotAffected: This set is defined to capture all the nodes not in the first two classes. Neither does a!d "& node s immediate dominator change, nor do its dominators. 4 from the flow- For example, consider deleting 2 graph in Figure By examining 7

8 the DJ-graph in Figure 4(b, we will find that ( nodes 3, 4, 6 and 8 are!! & nodes; (2 nodes 5 and 7 are! & nodes; and (3 nodes and 2 are!d & nodes. Next we partition 58%R' for each node +-,. "$#&%R' into two parts: the static part 57%R' and the dynamic part 58%('. The static part captures nodes that will continue to dominate after the update. For example, consider the DJ-graph shown in Figure 4(b. Node and 2 will dominate node 2 even after the edge deletion, so 58%(' 2 2. By contrast, the dynamic part of a 57%R' set normally will change during the fixed point iteration. We are interested in 58%(' for only the!! & nodes because we want to compute their immediate dominators. Therefore, we carefully initialize and manipulate the 58%(' set in such a way that we update the 58%R' set only for the PossiblyAffected nodes. Let "$#&%R'. The first step of our approach is to initialize the 58%R' set for each node according to its class as follows. PossiblyAffected. For each PossiblyAffected node, 58%(' and 58%R' = all the nodes in +-,.. We basically need to recompute the dominators for each PossiblyAffected node. For instance, consider the DJ-graph in Figure 4(b. Node 4 is in PossiblyAffected and 57%R' PseudoAffected. Recall that the immediate dominator of a! & node will not change, but its 58%(' set may. Let be a PseudoAffected node. By definition, there will be a unique node!! "& that strictly dominates. Here we will discuss how to initialize the static part and compute the dynamic part of 58%('. Let be the set of nodes on the dominator tree path from to (excluding. All the nodes in will still dominate even after the update, so they are used to initialize 58%('. For example, consider the DJgraph in Figure 4(b again. The set for 5 is 5, so 58%(' D 5 5. Now for the dynamic part, we can see that the nodes in 58%(' that is not accounted for by the static part are all the nodes dominating. This implies that 58%(' is the same as 58%R'. Returning to our example; 58%(' %R' 3 57%R' 3 NotAffected. For a!d & node, neither its 58%(' set nor its immediate dominator will change. Therefore, we initialize 58%R' to be all the nodes dominating, and make its dynamic part empty. Again consider the DJ-graph in Figure 4(b. Node 2 is a NotAffected node, and 58%(' 2 2. Given the above initialization we present the algorithm shown in Figure 5. When the algorithm terminates, the dominators for each PossiblyAffected node will be in 58%R'. sing this information, we can easily determine the immediate dominators for all the possibly affected nodes. After this we can update the DJ-graph accordingly. In the above algorithm, after the completion of step 25 foreach loop, the variable 57%R'7, ' contains the intersection of the 58%(' sets from a node s immediate predecessors. There are two key points to note in this algorithm: ( We check the ;&;# condition only for the nodes in PossiblyAffected; and (2 If an immediate predecessor at step 26 belongs to! &, we make 58%(' be 58%(', where!! & and!. We, therefore, do. not explicitly recompute the dynamic part of 58%R' Example. Consider the flowgraph and its DJ-graph shown in Figure 4. Assume that 2 4 is to be deleted from the flowgraph. To update the DJ-graph, we first incrementally compute the 58%(' set O for every possibly af- fected node. Since , we have!! & ,!" & 5 7, and!d & 2. Also "$#&%(' O 4. The table in Figure 6 (a gives the initial values of the 58%R' sets. J6 J639K6 M -F$G M &F$G 3 PossiblyAffected N 4 PossiblyAffected N 6 PossiblyAffected N 8 PossiblyAffected N 5 PseudoAffected 5 M F 3G 7 PseudoAffected 7 M F 6G NotAffected 2 NotAffected 2 (a J6 56BJ2T M 3 6 & M F G & =! #"%$ M F& G M 3 6 (' J , (b for the exam- Figure 6: (a Initial and (b Final values of 58%R' ple. (In the above tables The fixed point value for the possibly affected nodes is shown in Figure 6 (b. As can be seen, our example converges in one iteration! Observe that when computing 57%R'7, ' at step 29 we always select the latest value of 58%('. In addition, whenever such a is a PseudoAffected node, we update its 58%(' set at step 26. In the actual implementation, we do not need to update 58%R' for! &. sing pointer data structures we can easily point to the set 58%(', where is an ancestor of and!! "&. 8

9 # T pdatedomdel 6: E $ : if! "$#&%(' / do not cut if H K is a D-edge! / 8: + 9: "$#&%(' 2: Partition all the nodes in +,/. 2: Initialize each node +-,. as described in the main text. 22: while( &# to any 58%(' such that!! & occur do 23: foreach!! "& do 24: 58%('7, ' +-,. / temporary variable / 25: foreach T. do / T is an immediate predecessor in the flowgraph / 26: if! "& 27: 58%(' 9 57%R', where!! & and! 28: endif 29: 58%('8, ' 58%('8, ' 58%(' C 58%(' 3: endfor 3: 58%(' C 57%R'7, ' into PossiblyAffected, PseudoAffected, and NotAffected. 32: endfor 33: endwhile 34: Compute the immediate dominators for all the possibly affected nodes. 35: pdate the DJ-graph accordingly. Figure 5: An incremental algorithm for updating a DJ-graph when an existing edge corresponding flowgraph is deleted from the Once we have computed the 58%(' sets, we can easily determine the new immediate dominators for all the affected nodes. In our example, node is the new immediate dominator of 3, which is the new immediate dominator of 4, 6 and 8. With this information we can proceed to update the DJ-graph. The updated DJ-graph is shown in Figure 2. One key point to observe in the above algorithm is how we initialize the starting solutions for different types of nodes (i.e., the 58%(' sets. If we were to start the iteration from the old fixed point (i.e., 57%R' initialized to the old the dominators we would get wrong result. We leave this as an exercise for readers to verify. For a comprehensive treatment on this and other related problems of incremental iteration, please see [RMP88, Mar89]. Another approach for updating the dominator tree when an edge is deleted is to apply fast exhaustive algorithms such as Lengauer and Tarjan s algorithm [LT79] or Harel s linear time algorithm [Har85] on the subgraph induced by the +-,. "$#&%R'. It will be interesting to see how the fast (or the linear exhaustive algorithm performs compared to our incremental algorithm. We are currently working on such experiments and will report the results in the future. 5.2 Correctness and Complexity In order to find the new immediate dominators for all the possibly affected nodes, we use the algorithm given in Figure 5 to find their new dominators instead. Consequently, the correctness of our approach to handling an edge deletion relies on the correctness of finding the dominators for every!! & node. The following lemma claims that when the algorithm given in Figure 5 terminates, the dominators for every & nodes are correctly found.!! Lemma 5. Let T T be the deleted flowgraph edge. Assume "$#&%('. Then that we are only interested in nodes in +,/. when the algorithm given in Figure 5 terminates, 58%(' contains exactly all the dominators for any PossiblyAffected node. Proof: Even though we do not initialize the 58%R' set for all the nodes in the same way as the exhaustive Purdom-Moore algorithm does, we still use over-estimates (as the Purdom- Moore algorithm to initialize all the 58%R' sets as described in the text. That is, the initial value of 58%(' for any node includes all the dominators of (as well as other nodes that are not dominators of. Therefore, no dominators of will be missing from the final 57%R', regardless of being a!! &! "& or!d & node. The meet operation used in the fixed point iteration is the set intersection operation. As the Purdom-Moore algorithm will converge, our algorithm will converge too (but faster with the same solution for each!! contains exactly all the dominators of. 58%(' & node. Thus, In the worst case, the time complexity of the algorithm given in Figure 5 can be the same as the Purdom-Moore algorithm. In practice, however, we expect our algorithm to be much faster in the average case. 9

10 5.3 Other Cases Let T T be the edge to be deleted from the flowgraph. Here we will describe how to handle other cases where the reachability of T and T from STARTT is different from what we have assumed. If is not reachable, then we do nothing because we only intend to maintain the DJ-graph for the reachable subgraph REACH START. Now assume that is reachable and becomes unreachable after deletion. In this case, we remove from the DJ-graph all the and their incident edges. This is because nodes in +-,. if removing T T makes T become unreachable, then all the nodes strictly dominated by will not be reachable either. Next, we remove the D-edge. Finally, we update the reachability status for all the nodes that become unreachable due to the edge deletion. 6 Related Work In this paper we have presented an approach to the DJ-graph update problem, which subsumes that of updating dominator trees. Previous work, most relevant to our approach, for the dominator tree update problem includes the Carroll-Ryder algorithm [CR88] and the Ramalingam-Reps algorithm [RR94]. Both these algorithms are restricted to the class of reducible flowgraphs. By contrast, our algorithm can handle irreducible as well as reducible flowgraphs. The Ramalingam-Reps algorithm for updating dominator trees is different from the Carroll-Ryder algorithm. Our approach is comparable to the Ramalingam-Reps approach, while there are a number of significant differences. We will first compare ours with Ramalingam and Reps approach. 6. Ramalingam and Reps To simplify the presentation, we will refer to Ramalingam and Rep s algorithm as the RR algorithm.. nlike the RR algorithm, ours can handle both reducible and irreducible flowgraphs. 2. The RR algorithm is based on the properties of pseudocircuit value problem [AHR 9], while we use properties of DJ-graphs and IDFs to update the DJ-graphs. They use a modified algorithm of Alpern et al. to update the priorities of nodes. Priorities are equivalent to reverse topological sorting of the nodes in the forward flowgraph. 4 Priorities can be assigned to nodes only if the forward flowgraph is a directed acyclic graph. This property is only true for reducible flowgraphs. During the insertion 4 Intuitively, a forward flowgraph is nothing but a reducible flowgraph with all back edges removed. An edge in a flowgraph is a back edge if its destination node dominates its source node [AS86]. of a new edge, if a cycle is detected in the forward flowgraph, then their algorithm immediately signals that this insertion has introduced irreducibility into the flowgraph. After that they do not allow further insertions and deletions of edges, because they cannot assign priorities to nodes in the forward flowgraph containing cycles. 3. In the insertion case, our algorithm can begin with the precise set of affected nodes (e.g. & (, while the RR algorithm needs to begin with a conservative set of possibly affected nodes. When an edge T T is deleted, Ramalingam and Reps make all the sibling nodes of be affected. Our set of possibly affected nodes, although not precise, is always a subset of s sibling nodes; therefore, it is a better approximation than theirs. 4. Since the two algorithms are fundamentally different, it is difficult to make precise statements on their timing comparisons without substantial tests on real programs. In particular, it is generally very difficult to analytically compare incremental algorithms [Mar89, Ram93]. Therefore, we only make some qualitative observations. Our algorithm, for the insertion case, begins by computing precisely the set of affected nodes, at the expense of visiting arguably more nodes compared to the RR algorithm. (This is true even for the deletion case. On the other hand, the RR algorithm has a %# overhead factor (in the worst case. Also the RR algorithm has to do priorityupdating. One way to compare the performance of the two algorithms is to implement and test them on real benchmark programs. We are currently in the process of implementing our algorithm. We will report our empirical result in the near future. 6.2 Other related work The Carroll-Ryder algorithm uses two local properties: niceness and deepness. Niceness is a property for edges; deepness is a property for nodes. Non-nice edges and non-deep nodes cannot exist in the dominator tree of a reducible graph. sing these two local properties and the notion of representative edges, they maintain the dominator tree of a reducible flowgraph. However, it could be expensive to maintain such auxiliary information as representative edges. Ramalingam and Reps have presented detailed comparisons between their work and the Carroll-Ryder algorithm. Their comparisons are applicable to our work. We direct interested readers to their paper [RR94]. In a recent paper [JPP94], Johnson et al. introduced the Program Tree Structure (PST for performing fast program analysis. The PST represents a program with a hierarchy of singleentry, single-exit regions. sing the PST, Johnson in his thesis proposed an algorithm for updating dominator trees [Joh94]. His approach is to identify regions, corresponding to subflowgraphs, where the dominance relation may no longer be correct because of a flowgraph edge update. Once a region is

11 identified, he applies an exhaustive algorithm for all the nodes in this region. 7 Conclusion and Future Work We presented a new algorithm for updating DJ-graphs (and hence dominator trees for arbitrary flowgraphs, both reducible and irreducible. We are currently implementing our algorithm and intend to profile its performance on real benchmark programs. The result presented in this paper can be used for updating other data/control flow properties, such as data flow information [CR88], -nodes [SGL94b], and incremental SSA forms [CSS94]. Acknowledgements The first two authors thank the National Sciences and Engineering Research Council (NSERC and the Canadian Centers of Excellence (IRIS for their continued support of this research. We thank Tom Marlowe for his insightful comments. We thank G. Ramalingam for pointing out a small error in the insertion algorithm and also clarifying many points regarding his original algorithm. Finally, we thank the reviewers for their comments, which greatly improved the overall presentation of this paper. [CFR 9] [CLZ86] [CR88] [CSS94] efficient method for computing static single assignment form. In Conference Record of the Sixteenth Annual ACM Symposium on Principles of Programming Languages, pages 25 35, Austin, Texas, January 3, 989. ACM SIGACT and SIGPLAN. Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark N. Wegman, and F. Kenneth Zadeck. Efficiently computing static single assignment form and control dependence graph. ACM Transactions on Programming Languages and Systems, 3(4:452 49, October 99. Ron Cytron, Andy Lowry, and Kenneth Zadeck. Code motion of control structures in high-level languages. In Conference Record of the Thirteenth Annual ACM Symposium on Principles of Programming Languages, pages 7 85, St. Petersburg Beach, Florida, January 3 5, 986. ACM SIGACT and SIGPLAN. M. Carroll and B. G. Ryder. Incremental data flow update via attribute and dominator updates. In ACM SIGPLAN-SIGACT Symposium on the Principles of Programming Languages, pages , January 988. J. D. Choi, V. Sarkar, and E. Schonberg. Incremental computation of static single assignment form. npublished manuscript, 994. References [AHR 9] B. Alpern, R. Hoover, B. Rosen, B. K. Sweeney, and F. K. Zadeck. Incremental evaluation of computational circuits. In Proceedings of the First Annual ACM-SIAM Symposium on Discrete Algorithms, pages 32 42, 99. [AS86] [AWZ88] [CCF9] [CFR 89] A. V. Aho, R. Sethi, and J. D. llman. Compilers Principles, Techniques, and Tools. Addison-Wesley Publishing Co., 986. Bowen Alpern, Mark N. Wegman, and F. Kenneth Zadeck. Detecting equality of variables in programs. In Conference Record of the 5th Annual ACM Symposium on Principles of Programming Languages, pages, 988. Jong-Deok Choi, Ron Cytron, and Jeanne Ferrante. Automatic construction of sparse data flow evaluation graphs. In Conference Record of the 8th Annual ACM Symposium on Principles of Programming Languages, 99. Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark N. Wegman, and F. Kenneth Zadeck. An [Har85] Dov Harel. A linear time algorithm for finding dominators in flow graphs and related problems. In Symposium on Theory of Computing. ACM, May 985. [Joh94] [JPP94] [LT79] Richard Johnson. Dependence Based Program Analysis. PhD thesis, Cornell niversity, Ithaca, New York, August 994. R. Johnson, D. Pearson, and K. Pingali. The program tree structure: Computing control regions in linear time. In Proceedings of the SIGPLAN 94 Conference on Programming Language Design and Implementation, pages 7 85, 994. T. Lengauer and Robert Tarjan. A fast algorithm for finding dominators in a flowgraph. ACM Transactions on Programming Languages and Systems, (:2 4, July 979. [Mar89] Thomas J. Marlowe. Data Flow Analysis and Incremental Iteration. PhD thesis, Rutgers niversity, New Brunswick, New Jersey, October 989. [Ram93] G. Ramalingam. Bounded Incremental Computation. PhD thesis, niversity of Wisconsin-Madison, Madison, Wisconsin, August 993.

12 C [RMP88] B. G. Ryder, T. G. Marlowe, and M. C. Paull. Conditions for incremental iteration: Examples and counterexamples. Science of Computer Programming, (: 5, October 988. [RR94] G. Ramalingam and T. Reps. An incremental algorithm for maintaining the dominator tree of a reducible flowgraph. In ACM SIGPLAN-SIGACT Symposium on the Principles of Programming Languages, January 994. [RWZ88] [SG95] [SGL94a] [SGL94b] Barry K. Rosen, Mark N. Wegman, and F. Kenneth Zadeck. Global value numbersand redundant computations. In ACM SIGPLAN-SIGACT Symposium on the Principles of Programming Languages, pages 2 27, January 988. Vugranam C. Sreedhar and Guang R. Gao. A linear time algorithm for placing -nodes. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, January 995. A longer version accepted in Journal of Programming Languages. Vugranam C. Sreedhar, Guang R. Gao, and Yongfong Lee. DJ-graphs and their applications to flowgraph analyses. TechnicalReport ACAPS Memo 7, McGill niversity, May 994. Vugranam C. Sreedhar, Guang R. Gao, and Yongfong Lee. An efficient incremental algorithm for maintaining dominator trees and its application to -nodes update. Technical Report ACAPS Memo 77, McGill niversity, July 994. [WCES94] Daniel Weise, Roger F. Crew, Michael Ernst, and Bjarne Steensgaard. Value dependence graphs: Representation without taxation. In ACM SIGPLAN-SIGACT Symposium on the Principles of Programming Languages, January 994. [WZ85] A Mark Wegman and Ken Zadeck. Constant propagation with conditional branches. In Conference Record of the Twelfth Annual ACM Symposium on Principles of Programming Languages, pages ACM SIGACT and SIGPLAN, January 985. Purdom and Moore s Algorithm Here we give the original Purdom and Moore s exhaustive algorithm for computing the dominator set. The version of the algorithm is adapted from [AS86]. Algorithm A. (Finding Dominators. The following is an iterative algorithm for computing the dominator set. 36: 58%R' 37: foreach 9 START START START do 38: 58%(' / end initialization / 39: while ;&;# to any 58%(' occur do 4: foreach D START do 4: 57%R' =! #"%$ 57%R' B Sreedhar and Gao s Algorithm Here we briefly introduce Sreedhar and Gao s linear time algorithm [SG95] for computing the iterated dominance frontiers for a set of node. The algorithm is based on two key observations:. Let be an ancestor of on the dominator tree. If 576 has already been computed before the computation of 586, then 576 need not be recomputed when computing 586. However, the reverse may not be true; therefore, the order of the computation is crucial. We order the computation of the relevant set of nodes in a bottom-up fashion using the levels of the nodes in the dominator tree. 2. The computation of 586 itself is guided by D-edges in a top-down fashion. When computing 586 we only need to examine the J-edges, where is a node in the dominator subtree rooted at and is a node whose level is no greater than the level of. To order the relevant set of nodes, we use a data structure called the " #$# &, which is nothing but an array of pointers to nodes, with index " storing nodes at level i. A high-level description of the complete algorithm is given below (for details please see [SG95]. Let be the initial set, whose iterated dominance frontiers are of interest to us. Initially the " #"# 9& is empty. Step Deposit all nodes in into the " #$# 9&. Remember that if " is the level number of a node then it is inserted at the index " in the " #$# 9&. Step 2 Pick a node from the " #$# 9& such that 2 is the highest level of all the nodes currently in the " #$# 9&. (Remove from the " #$# &. using Lemma 2. by walking down the +,. while avoiding nodes that have been previously visited. Deposit all the nodes in 576 back into the " #$# &, if was not previously put in the " #$# 9& and is not in. All such s will be the Step 3 Compute 586 candidate nodes Step 4 Repeat Step 2 and 3 (in that order, until there are no more nodes in the " #$# &.. 2

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

Control-Flow Analysis

Control-Flow Analysis Control-Flow Analysis Dragon book [Ch. 8, Section 8.4; Ch. 9, Section 9.6] Compilers: Principles, Techniques, and Tools, 2 nd ed. by Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jerey D. Ullman on reserve

More information

Distributed minimum spanning tree problem

Distributed minimum spanning tree problem Distributed minimum spanning tree problem Juho-Kustaa Kangas 24th November 2012 Abstract Given a connected weighted undirected graph, the minimum spanning tree problem asks for a spanning subtree with

More information

Single-Pass Generation of Static Single Assignment Form for Structured Languages

Single-Pass Generation of Static Single Assignment Form for Structured Languages 1 Single-Pass Generation of Static Single Assignment Form for Structured Languages MARC M. BRANDIS and HANSPETER MÖSSENBÖCK ETH Zürich, Institute for Computer Systems Over the last few years, static single

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

Byzantine Consensus in Directed Graphs

Byzantine Consensus in Directed Graphs Byzantine Consensus in Directed Graphs Lewis Tseng 1,3, and Nitin Vaidya 2,3 1 Department of Computer Science, 2 Department of Electrical and Computer Engineering, and 3 Coordinated Science Laboratory

More information

Computing intersections in a set of line segments: the Bentley-Ottmann algorithm

Computing intersections in a set of line segments: the Bentley-Ottmann algorithm Computing intersections in a set of line segments: the Bentley-Ottmann algorithm Michiel Smid October 14, 2003 1 Introduction In these notes, we introduce a powerful technique for solving geometric problems.

More information

FOUR EDGE-INDEPENDENT SPANNING TREES 1

FOUR EDGE-INDEPENDENT SPANNING TREES 1 FOUR EDGE-INDEPENDENT SPANNING TREES 1 Alexander Hoyer and Robin Thomas School of Mathematics Georgia Institute of Technology Atlanta, Georgia 30332-0160, USA ABSTRACT We prove an ear-decomposition theorem

More information

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret Greedy Algorithms (continued) The best known application where the greedy algorithm is optimal is surely

More information

The Development of Static Single Assignment Form

The Development of Static Single Assignment Form The Development of Static Single Assignment Form Kenneth Zadeck NaturalBridge, Inc. zadeck@naturalbridge.com Ken's Graduate Optimization Seminar We learned: 1.what kinds of problems could be addressed

More information

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition. 18.433 Combinatorial Optimization Matching Algorithms September 9,14,16 Lecturer: Santosh Vempala Given a graph G = (V, E), a matching M is a set of edges with the property that no two of the edges have

More information

Joint Entity Resolution

Joint Entity Resolution Joint Entity Resolution Steven Euijong Whang, Hector Garcia-Molina Computer Science Department, Stanford University 353 Serra Mall, Stanford, CA 94305, USA {swhang, hector}@cs.stanford.edu No Institute

More information

Faster parameterized algorithms for Minimum Fill-In

Faster parameterized algorithms for Minimum Fill-In Faster parameterized algorithms for Minimum Fill-In Hans L. Bodlaender Pinar Heggernes Yngve Villanger Abstract We present two parameterized algorithms for the Minimum Fill-In problem, also known as Chordal

More information

Contents of Lecture 2

Contents of Lecture 2 Contents of Lecture Dominance relation An inefficient and simple algorithm to compute dominance Immediate dominators Dominator tree Jonas Skeppstedt (js@cs.lth.se) Lecture / Definition of Dominance Consider

More information

THE TRANSITIVE REDUCTION OF A DIRECTED GRAPH*

THE TRANSITIVE REDUCTION OF A DIRECTED GRAPH* SIAM J. COMPUT. Vol. 1, No. 2, June 1972 THE TRANSITIVE REDUCTION OF A DIRECTED GRAPH* A. V. AHO, M. R. GAREY" AND J. D. ULLMAN Abstract. We consider economical representations for the path information

More information

Faster parameterized algorithms for Minimum Fill-In

Faster parameterized algorithms for Minimum Fill-In Faster parameterized algorithms for Minimum Fill-In Hans L. Bodlaender Pinar Heggernes Yngve Villanger Technical Report UU-CS-2008-042 December 2008 Department of Information and Computing Sciences Utrecht

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

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

Reducing Directed Max Flow to Undirected Max Flow and Bipartite Matching

Reducing Directed Max Flow to Undirected Max Flow and Bipartite Matching Reducing Directed Max Flow to Undirected Max Flow and Bipartite Matching Henry Lin Division of Computer Science University of California, Berkeley Berkeley, CA 94720 Email: henrylin@eecs.berkeley.edu Abstract

More information

Maximum number of edges in claw-free graphs whose maximum degree and matching number are bounded

Maximum number of edges in claw-free graphs whose maximum degree and matching number are bounded Maximum number of edges in claw-free graphs whose maximum degree and matching number are bounded Cemil Dibek Tınaz Ekim Pinar Heggernes Abstract We determine the maximum number of edges that a claw-free

More information

6. Lecture notes on matroid intersection

6. Lecture notes on matroid intersection Massachusetts Institute of Technology 18.453: Combinatorial Optimization Michel X. Goemans May 2, 2017 6. Lecture notes on matroid intersection One nice feature about matroids is that a simple greedy algorithm

More information

An O(n 2.75 ) algorithm for online topological ordering 1

An O(n 2.75 ) algorithm for online topological ordering 1 Electronic Notes in Discrete Mathematics 25 (2006) 7 12 www.elsevier.com/locate/endm An O(n 2.75 ) algorithm for online topological ordering 1 Deepak Ajwani a,2, Tobias Friedrich a and Ulrich Meyer a a

More information

time using O( n log n ) processors on the EREW PRAM. Thus, our algorithm improves on the previous results, either in time complexity or in the model o

time using O( n log n ) processors on the EREW PRAM. Thus, our algorithm improves on the previous results, either in time complexity or in the model o Reconstructing a Binary Tree from its Traversals in Doubly-Logarithmic CREW Time Stephan Olariu Michael Overstreet Department of Computer Science, Old Dominion University, Norfolk, VA 23529 Zhaofang Wen

More information

6. Concluding Remarks

6. Concluding Remarks [8] K. J. Supowit, The relative neighborhood graph with an application to minimum spanning trees, Tech. Rept., Department of Computer Science, University of Illinois, Urbana-Champaign, August 1980, also

More information

Combining Analyses, Combining Optimizations - Summary

Combining Analyses, Combining Optimizations - Summary Combining Analyses, Combining Optimizations - Summary 1. INTRODUCTION Cliff Click s thesis Combining Analysis, Combining Optimizations [Click and Cooper 1995] uses a structurally different intermediate

More information

Provably Efficient Non-Preemptive Task Scheduling with Cilk

Provably Efficient Non-Preemptive Task Scheduling with Cilk Provably Efficient Non-Preemptive Task Scheduling with Cilk V. -Y. Vee and W.-J. Hsu School of Applied Science, Nanyang Technological University Nanyang Avenue, Singapore 639798. Abstract We consider the

More information

Leveraging Transitive Relations for Crowdsourced Joins*

Leveraging Transitive Relations for Crowdsourced Joins* Leveraging Transitive Relations for Crowdsourced Joins* Jiannan Wang #, Guoliang Li #, Tim Kraska, Michael J. Franklin, Jianhua Feng # # Department of Computer Science, Tsinghua University, Brown University,

More information

A Fast Algorithm for Optimal Alignment between Similar Ordered Trees

A Fast Algorithm for Optimal Alignment between Similar Ordered Trees Fundamenta Informaticae 56 (2003) 105 120 105 IOS Press A Fast Algorithm for Optimal Alignment between Similar Ordered Trees Jesper Jansson Department of Computer Science Lund University, Box 118 SE-221

More information

The Geometry of Carpentry and Joinery

The Geometry of Carpentry and Joinery The Geometry of Carpentry and Joinery Pat Morin and Jason Morrison School of Computer Science, Carleton University, 115 Colonel By Drive Ottawa, Ontario, CANADA K1S 5B6 Abstract In this paper we propose

More information

arxiv: v2 [cs.ds] 9 Apr 2009

arxiv: v2 [cs.ds] 9 Apr 2009 Pairing Heaps with Costless Meld arxiv:09034130v2 [csds] 9 Apr 2009 Amr Elmasry Max-Planck Institut für Informatik Saarbrücken, Germany elmasry@mpi-infmpgde Abstract Improving the structure and analysis

More information

Static Slicing in the Presence of GOTO Statements. IBM T. J. Watson Research Center. P. O. Box 704. Yorktown Heights, NY

Static Slicing in the Presence of GOTO Statements. IBM T. J. Watson Research Center. P. O. Box 704. Yorktown Heights, NY Static Slicing in the Presence of GOTO Statements Jong-Deok Choi Jeanne Ferrante* IBM T. J. Watson Research Center P. O. Box 704 Yorktown Heights, NY 10598 Abstract A static program slice is an extract

More information

PLANAR GRAPH BIPARTIZATION IN LINEAR TIME

PLANAR GRAPH BIPARTIZATION IN LINEAR TIME PLANAR GRAPH BIPARTIZATION IN LINEAR TIME SAMUEL FIORINI, NADIA HARDY, BRUCE REED, AND ADRIAN VETTA Abstract. For each constant k, we present a linear time algorithm that, given a planar graph G, either

More information

Solution for Homework set 3

Solution for Homework set 3 TTIC 300 and CMSC 37000 Algorithms Winter 07 Solution for Homework set 3 Question (0 points) We are given a directed graph G = (V, E), with two special vertices s and t, and non-negative integral capacities

More information

Parameterized graph separation problems

Parameterized graph separation problems Parameterized graph separation problems Dániel Marx Department of Computer Science and Information Theory, Budapest University of Technology and Economics Budapest, H-1521, Hungary, dmarx@cs.bme.hu Abstract.

More information

Compiler Construction 2016/2017 Loop Optimizations

Compiler Construction 2016/2017 Loop Optimizations Compiler Construction 2016/2017 Loop Optimizations Peter Thiemann January 16, 2017 Outline 1 Loops 2 Dominators 3 Loop-Invariant Computations 4 Induction Variables 5 Array-Bounds Checks 6 Loop Unrolling

More information

Bipartite Roots of Graphs

Bipartite Roots of Graphs Bipartite Roots of Graphs Lap Chi Lau Department of Computer Science University of Toronto Graph H is a root of graph G if there exists a positive integer k such that x and y are adjacent in G if and only

More information

1 Connected components in undirected graphs

1 Connected components in undirected graphs Lecture 10 Connected components of undirected and directed graphs Scribe: Luke Johnston (2016) and Mary Wootters (2017) Date: October 25, 2017 Much of the following notes were taken from Tim Roughgarden

More information

On the Computational Complexity of Dynamic Graph Problems

On the Computational Complexity of Dynamic Graph Problems On the Computational Complexity of Dynamic Graph Problems G. RAMALINGAM and THOMAS REPS University of Wisconsin Madison A common way to evaluate the time complexity of an algorithm is to use asymptotic

More information

{ 1} Definitions. 10. Extremal graph theory. Problem definition Paths and cycles Complete subgraphs

{ 1} Definitions. 10. Extremal graph theory. Problem definition Paths and cycles Complete subgraphs Problem definition Paths and cycles Complete subgraphs 10. Extremal graph theory 10.1. Definitions Let us examine the following forbidden subgraph problems: At most how many edges are in a graph of order

More information

Monotone Paths in Geometric Triangulations

Monotone Paths in Geometric Triangulations Monotone Paths in Geometric Triangulations Adrian Dumitrescu Ritankar Mandal Csaba D. Tóth November 19, 2017 Abstract (I) We prove that the (maximum) number of monotone paths in a geometric triangulation

More information

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph. Trees 1 Introduction Trees are very special kind of (undirected) graphs. Formally speaking, a tree is a connected graph that is acyclic. 1 This definition has some drawbacks: given a graph it is not trivial

More information

A more efficient algorithm for perfect sorting by reversals

A more efficient algorithm for perfect sorting by reversals A more efficient algorithm for perfect sorting by reversals Sèverine Bérard 1,2, Cedric Chauve 3,4, and Christophe Paul 5 1 Département de Mathématiques et d Informatique Appliquée, INRA, Toulouse, France.

More information

Exact Algorithms Lecture 7: FPT Hardness and the ETH

Exact Algorithms Lecture 7: FPT Hardness and the ETH Exact Algorithms Lecture 7: FPT Hardness and the ETH February 12, 2016 Lecturer: Michael Lampis 1 Reminder: FPT algorithms Definition 1. A parameterized problem is a function from (χ, k) {0, 1} N to {0,

More information

6.895 Final Project: Serial and Parallel execution of Funnel Sort

6.895 Final Project: Serial and Parallel execution of Funnel Sort 6.895 Final Project: Serial and Parallel execution of Funnel Sort Paul Youn December 17, 2003 Abstract The speed of a sorting algorithm is often measured based on the sheer number of calculations required

More information

Computing Static Single Assignment (SSA) Form. Control Flow Analysis. Overview. Last Time. Constant propagation Dominator relationships

Computing Static Single Assignment (SSA) Form. Control Flow Analysis. Overview. Last Time. Constant propagation Dominator relationships Control Flow Analysis Last Time Constant propagation Dominator relationships Today Static Single Assignment (SSA) - a sparse program representation for data flow Dominance Frontier Computing Static Single

More information

A Practical and Fast Iterative Algorithm for φ-function Computation Using DJ Graphs

A Practical and Fast Iterative Algorithm for φ-function Computation Using DJ Graphs A Practical and Fast Iterative Algorithm for φ-function Computation Using DJ Graphs Dibyendu Das U. Ramakrishna ACM Transactions on Programming Languages and Systems May 2005 Humayun Zafar Outline Introduction

More information

Throughout the chapter, we will assume that the reader is familiar with the basics of phylogenetic trees.

Throughout the chapter, we will assume that the reader is familiar with the basics of phylogenetic trees. Chapter 7 SUPERTREE ALGORITHMS FOR NESTED TAXA Philip Daniel and Charles Semple Abstract: Keywords: Most supertree algorithms combine collections of rooted phylogenetic trees with overlapping leaf sets

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

Analysis of Pointers and Structures

Analysis of Pointers and Structures RETROSPECTIVE: Analysis of Pointers and Structures David Chase, Mark Wegman, and Ken Zadeck chase@naturalbridge.com, zadeck@naturalbridge.com, wegman@us.ibm.com Historically our paper was important because

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

Progress Towards the Total Domination Game 3 4 -Conjecture

Progress Towards the Total Domination Game 3 4 -Conjecture Progress Towards the Total Domination Game 3 4 -Conjecture 1 Michael A. Henning and 2 Douglas F. Rall 1 Department of Pure and Applied Mathematics University of Johannesburg Auckland Park, 2006 South Africa

More information

3 Competitive Dynamic BSTs (January 31 and February 2)

3 Competitive Dynamic BSTs (January 31 and February 2) 3 Competitive Dynamic BSTs (January 31 and February ) In their original paper on splay trees [3], Danny Sleator and Bob Tarjan conjectured that the cost of sequence of searches in a splay tree is within

More information

Solutions for the Exam 6 January 2014

Solutions for the Exam 6 January 2014 Mastermath and LNMB Course: Discrete Optimization Solutions for the Exam 6 January 2014 Utrecht University, Educatorium, 13:30 16:30 The examination lasts 3 hours. Grading will be done before January 20,

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

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

Discrete mathematics

Discrete mathematics Discrete mathematics Petr Kovář petr.kovar@vsb.cz VŠB Technical University of Ostrava DiM 470-2301/02, Winter term 2018/2019 About this file This file is meant to be a guideline for the lecturer. Many

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

Lecture Notes on Static Single Assignment Form

Lecture Notes on Static Single Assignment Form Lecture Notes on Static Single Assignment Form 15-411: Compiler Design Frank Pfenning Lecture 6 September 12, 2013 1 Introduction In abstract machine code of the kind we have discussed so far, a variable

More information

Module 11. Directed Graphs. Contents

Module 11. Directed Graphs. Contents Module 11 Directed Graphs Contents 11.1 Basic concepts......................... 256 Underlying graph of a digraph................ 257 Out-degrees and in-degrees.................. 258 Isomorphism..........................

More information

Paths, Flowers and Vertex Cover

Paths, Flowers and Vertex Cover Paths, Flowers and Vertex Cover Venkatesh Raman M. S. Ramanujan Saket Saurabh Abstract It is well known that in a bipartite (and more generally in a König) graph, the size of the minimum vertex cover is

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

Lecture 6: External Interval Tree (Part II) 3 Making the external interval tree dynamic. 3.1 Dynamizing an underflow structure

Lecture 6: External Interval Tree (Part II) 3 Making the external interval tree dynamic. 3.1 Dynamizing an underflow structure Lecture 6: External Interval Tree (Part II) Yufei Tao Division of Web Science and Technology Korea Advanced Institute of Science and Technology taoyf@cse.cuhk.edu.hk 3 Making the external interval tree

More information

Designing Views to Answer Queries under Set, Bag,and BagSet Semantics

Designing Views to Answer Queries under Set, Bag,and BagSet Semantics Designing Views to Answer Queries under Set, Bag,and BagSet Semantics Rada Chirkova Department of Computer Science, North Carolina State University Raleigh, NC 27695-7535 chirkova@csc.ncsu.edu Foto Afrati

More information

Theorem 2.9: nearest addition algorithm

Theorem 2.9: nearest addition algorithm There are severe limits on our ability to compute near-optimal tours It is NP-complete to decide whether a given undirected =(,)has a Hamiltonian cycle An approximation algorithm for the TSP can be used

More information

CSE P 501 Compilers. SSA Hal Perkins Spring UW CSE P 501 Spring 2018 V-1

CSE P 501 Compilers. SSA Hal Perkins Spring UW CSE P 501 Spring 2018 V-1 CSE P 0 Compilers SSA Hal Perkins Spring 0 UW CSE P 0 Spring 0 V- Agenda Overview of SSA IR Constructing SSA graphs Sample of SSA-based optimizations Converting back from SSA form Sources: Appel ch., also

More information

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions. THREE LECTURES ON BASIC TOPOLOGY PHILIP FOTH 1. Basic notions. Let X be a set. To make a topological space out of X, one must specify a collection T of subsets of X, which are said to be open subsets of

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

FUTURE communication networks are expected to support

FUTURE communication networks are expected to support 1146 IEEE/ACM TRANSACTIONS ON NETWORKING, VOL 13, NO 5, OCTOBER 2005 A Scalable Approach to the Partition of QoS Requirements in Unicast and Multicast Ariel Orda, Senior Member, IEEE, and Alexander Sprintson,

More information

Algebra of Sets (Mathematics & Logic A)

Algebra of Sets (Mathematics & Logic A) Algebra of Sets (Mathematics & Logic A) RWK/MRQ October 28, 2002 Note. These notes are adapted (with thanks) from notes given last year by my colleague Dr Martyn Quick. Please feel free to ask me (not

More information

7.3 Spanning trees Spanning trees [ ] 61

7.3 Spanning trees Spanning trees [ ] 61 7.3. Spanning trees [161211-1348 ] 61 7.3 Spanning trees We know that trees are connected graphs with the minimal number of edges. Hence trees become very useful in applications where our goal is to connect

More information

A Distribution-Sensitive Dictionary with Low Space Overhead

A Distribution-Sensitive Dictionary with Low Space Overhead A Distribution-Sensitive Dictionary with Low Space Overhead Prosenjit Bose, John Howat, and Pat Morin School of Computer Science, Carleton University 1125 Colonel By Dr., Ottawa, Ontario, CANADA, K1S 5B6

More information

Characterizations of graph classes by forbidden configurations

Characterizations of graph classes by forbidden configurations Characterizations of graph classes by forbidden configurations Zdeněk Dvořák September 14, 2015 We consider graph classes that can be described by excluding some fixed configurations. Let us give some

More information

ARELAY network consists of a pair of source and destination

ARELAY network consists of a pair of source and destination 158 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL 55, NO 1, JANUARY 2009 Parity Forwarding for Multiple-Relay Networks Peyman Razaghi, Student Member, IEEE, Wei Yu, Senior Member, IEEE Abstract This paper

More information

A Mechanism for Sequential Consistency in a Distributed Objects System

A Mechanism for Sequential Consistency in a Distributed Objects System A Mechanism for Sequential Consistency in a Distributed Objects System Cristian Ţăpuş, Aleksey Nogin, Jason Hickey, and Jerome White California Institute of Technology Computer Science Department MC 256-80,

More information

Data structures for optimizing programs with explicit parallelism

Data structures for optimizing programs with explicit parallelism Oregon Health & Science University OHSU Digital Commons CSETech March 1991 Data structures for optimizing programs with explicit parallelism Michael Wolfe Harini Srinivasan Follow this and additional works

More information

Approximability Results for the p-center Problem

Approximability Results for the p-center Problem Approximability Results for the p-center Problem Stefan Buettcher Course Project Algorithm Design and Analysis Prof. Timothy Chan University of Waterloo, Spring 2004 The p-center

More information

Lecture 3: Graphs and flows

Lecture 3: Graphs and flows Chapter 3 Lecture 3: Graphs and flows Graphs: a useful combinatorial structure. Definitions: graph, directed and undirected graph, edge as ordered pair, path, cycle, connected graph, strongly connected

More information

Compiler Construction 2009/2010 SSA Static Single Assignment Form

Compiler Construction 2009/2010 SSA Static Single Assignment Form Compiler Construction 2009/2010 SSA Static Single Assignment Form Peter Thiemann March 15, 2010 Outline 1 Static Single-Assignment Form 2 Converting to SSA Form 3 Optimization Algorithms Using SSA 4 Dependencies

More information

Algorithms: Lecture 10. Chalmers University of Technology

Algorithms: Lecture 10. Chalmers University of Technology Algorithms: Lecture 10 Chalmers University of Technology Today s Topics Basic Definitions Path, Cycle, Tree, Connectivity, etc. Graph Traversal Depth First Search Breadth First Search Testing Bipartatiness

More information

Lecture Notes on Common Subexpression Elimination

Lecture Notes on Common Subexpression Elimination Lecture Notes on Common Subexpression Elimination 15-411: Compiler Design Frank Pfenning Lecture 18 October 29, 2015 1 Introduction Copy propagation allows us to have optimizations with this form: l :

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

5. Lecture notes on matroid intersection

5. Lecture notes on matroid intersection Massachusetts Institute of Technology Handout 14 18.433: Combinatorial Optimization April 1st, 2009 Michel X. Goemans 5. Lecture notes on matroid intersection One nice feature about matroids is that a

More information

Optimization I : Brute force and Greedy strategy

Optimization I : Brute force and Greedy strategy Chapter 3 Optimization I : Brute force and Greedy strategy A generic definition of an optimization problem involves a set of constraints that defines a subset in some underlying space (like the Euclidean

More information

Online Graph Exploration

Online Graph Exploration Distributed Computing Online Graph Exploration Semester thesis Simon Hungerbühler simonhu@ethz.ch Distributed Computing Group Computer Engineering and Networks Laboratory ETH Zürich Supervisors: Sebastian

More information

AXIOMS FOR THE INTEGERS

AXIOMS FOR THE INTEGERS AXIOMS FOR THE INTEGERS BRIAN OSSERMAN We describe the set of axioms for the integers which we will use in the class. The axioms are almost the same as what is presented in Appendix A of the textbook,

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

arxiv:cs/ v1 [cs.ds] 20 Feb 2003

arxiv:cs/ v1 [cs.ds] 20 Feb 2003 The Traveling Salesman Problem for Cubic Graphs David Eppstein School of Information & Computer Science University of California, Irvine Irvine, CA 92697-3425, USA eppstein@ics.uci.edu arxiv:cs/0302030v1

More information

Discharging and reducible configurations

Discharging and reducible configurations Discharging and reducible configurations Zdeněk Dvořák March 24, 2018 Suppose we want to show that graphs from some hereditary class G are k- colorable. Clearly, we can restrict our attention to graphs

More information

ADAPTIVE SORTING WITH AVL TREES

ADAPTIVE SORTING WITH AVL TREES ADAPTIVE SORTING WITH AVL TREES Amr Elmasry Computer Science Department Alexandria University Alexandria, Egypt elmasry@alexeng.edu.eg Abstract A new adaptive sorting algorithm is introduced. The new implementation

More information

Identifying Parallelism in Construction Operations of Cyclic Pointer-Linked Data Structures 1

Identifying Parallelism in Construction Operations of Cyclic Pointer-Linked Data Structures 1 Identifying Parallelism in Construction Operations of Cyclic Pointer-Linked Data Structures 1 Yuan-Shin Hwang Department of Computer Science National Taiwan Ocean University Keelung 20224 Taiwan shin@cs.ntou.edu.tw

More information

A Connection between Network Coding and. Convolutional Codes

A Connection between Network Coding and. Convolutional Codes A Connection between Network Coding and 1 Convolutional Codes Christina Fragouli, Emina Soljanin christina.fragouli@epfl.ch, emina@lucent.com Abstract The min-cut, max-flow theorem states that a source

More information

IBM Research Report. Business Process Modeling in Abstract Logic Tree. Ying Liu, Jian Wang, Jun Zhu, Haiqi Liang, Zhong Tian, Wei Sun 2

IBM Research Report. Business Process Modeling in Abstract Logic Tree. Ying Liu, Jian Wang, Jun Zhu, Haiqi Liang, Zhong Tian, Wei Sun 2 RC23444 (C0411-006) November 19, 2004 Computer Science IBM Research Report Business Process Modeling in Abstract Logic Tree Ying Liu, Jian Wang, Jun Zhu, Haiqi Liang, Zhong Tian, Wei Sun 2 IBM Research

More information

Goals of Program Optimization (1 of 2)

Goals of Program Optimization (1 of 2) Goals of Program Optimization (1 of 2) Goal: Improve program performance within some constraints Ask Three Key Questions for Every Optimization 1. Is it legal? 2. Is it profitable? 3. Is it compile-time

More information

by conservation of flow, hence the cancelation. Similarly, we have

by conservation of flow, hence the cancelation. Similarly, we have Chapter 13: Network Flows and Applications Network: directed graph with source S and target T. Non-negative edge weights represent capacities. Assume no edges into S or out of T. (If necessary, we can

More information

A Reduction of Conway s Thrackle Conjecture

A Reduction of Conway s Thrackle Conjecture A Reduction of Conway s Thrackle Conjecture Wei Li, Karen Daniels, and Konstantin Rybnikov Department of Computer Science and Department of Mathematical Sciences University of Massachusetts, Lowell 01854

More information

Network Working Group. Redback H. Smit. Procket Networks. October Domain-wide Prefix Distribution with Two-Level IS-IS

Network Working Group. Redback H. Smit. Procket Networks. October Domain-wide Prefix Distribution with Two-Level IS-IS Network Working Group Request for Comments: 2966 Category: Informational T. Li Procket Networks T. Przygienda Redback H. Smit Procket Networks October 2000 Status of this Memo Domain-wide Prefix Distribution

More information

Compiler Construction 2010/2011 Loop Optimizations

Compiler Construction 2010/2011 Loop Optimizations Compiler Construction 2010/2011 Loop Optimizations Peter Thiemann January 25, 2011 Outline 1 Loop Optimizations 2 Dominators 3 Loop-Invariant Computations 4 Induction Variables 5 Array-Bounds Checks 6

More information

Vertex Deletion games with Parity rules

Vertex Deletion games with Parity rules Vertex Deletion games with Parity rules Richard J. Nowakowski 1 Department of Mathematics, Dalhousie University, Halifax, Nova Scotia, Canada rjn@mathstat.dal.ca Paul Ottaway Department of Mathematics,

More information

Graph Representations and Traversal

Graph Representations and Traversal COMPSCI 330: Design and Analysis of Algorithms 02/08/2017-02/20/2017 Graph Representations and Traversal Lecturer: Debmalya Panigrahi Scribe: Tianqi Song, Fred Zhang, Tianyu Wang 1 Overview This lecture

More information

HEAPS ON HEAPS* Downloaded 02/04/13 to Redistribution subject to SIAM license or copyright; see

HEAPS ON HEAPS* Downloaded 02/04/13 to Redistribution subject to SIAM license or copyright; see SIAM J. COMPUT. Vol. 15, No. 4, November 1986 (C) 1986 Society for Industrial and Applied Mathematics OO6 HEAPS ON HEAPS* GASTON H. GONNET" AND J. IAN MUNRO," Abstract. As part of a study of the general

More information