We give a parameterized form for the standard implementation of the pairing heaps, skew heaps and... more We give a parameterized form for the standard implementation of the pairing heaps, skew heaps and skew-pairing heaps. When the node with the minimum value is to be deleted from the heap (deletemin operation), the procedure used to combine the resulting sub-trees into one tree depend on the value of a parameter k. When the value of k is equal to 2, the implementations are equivalent to the standard implementations. Using more complicated arguments, we show that for some predefined ranges of k this general form achieves the same bounds as the standard implementations. Finally, experimental results are conducted showing that for the pairing heaps, by tuning the value of k, the cost of the deletemin operation is reduced.
The 3rd ACS/IEEE International Conference onComputer Systems and Applications, 2005., 2005
Consider the scenario in which a start-up communication company charges its network users by the ... more Consider the scenario in which a start-up communication company charges its network users by the cost of the minimum spanning tree (MST) they use in their protocols. Wanting to increase their profits, they aim at maximizing the cost of the MST of their network. We consider two different cases. In the first case, the company has a set of links with fixed cost vector W and wants to configure the network so that the MST of the network will have the maximum possible cost. In the second case, the network topology is fixed, but the costs on the links assume d different values W 1 , W 2 , . . . , W d over the day. The company wants to fix the link costs to a value W = i p i W i , for some weights p 1 , p 2 , . . . , p d , where 0 ≤ p i ≤ 1 and i p i = 1, so that the resulting network has a maximum-cost MST.
We give a priority queue that achieves the same amortized bounds as Fibonacci heaps. Namely, find... more We give a priority queue that achieves the same amortized bounds as Fibonacci heaps. Namely, find-min requires O(1) worst-case time, insert, meld and decrease-key require O(1) amortized time, and delete-min requires $O(\log n)$ amortized time. Our structure is simple and promises an efficient practical behavior when compared to other known Fibonacci-like heaps. The main idea behind our construction is to propagate rank updates instead of performing cascaded cuts following a decrease-key operation, allowing for a relaxed structure.
We give a variation of the pairing heaps for which the time bounds for all the operations match t... more We give a variation of the pairing heaps for which the time bounds for all the operations match the lower bound proved by Fredman for a family of similar self-adjusting heaps. Namely, our heap structure requires O(1) for insert and findmin, O(log n) for delete-min, and O(log log n) for decreasekey and meld (all the bounds are in the amortized sense except for find-min).
We introduce space-efficient plane-sweep algorithms for basic planar geometric problems. It is as... more We introduce space-efficient plane-sweep algorithms for basic planar geometric problems. It is assumed that the input is in a read-only array of n items and that the available workspace is $\Theta(s)$ bits, where $\lg n \leq s \leq n \cdot \lg n$. In particular, we give an almost-optimal algorithm for finding the closest pair among a set of $n$ points that runs in $O(n^2/s + n \cdot \lg s)$ time. We give a simple algorithm to enumerate the intersections of $n$ line segments whose running time is $O((n^2/s) \cdot \lg^2 s + k)$, where $k$ is the number of reported intersections. When the segments are axis-parallel, we give an $O(n^2/s + n \cdot \lg s)$-time algorithm for counting the intersections, and an algorithm for enumerating the intersections whose running time is $O((n^2/s) \cdot \lg s \cdot \lg \lg s + n \cdot \lg s + k)$. We also present space-efficient algorithms to calculate the measure of $n$ axis-parallel rectangles.
An in-place priority queue is a data structure that is stored in an array, uses constant extra sp... more An in-place priority queue is a data structure that is stored in an array, uses constant extra space in addition to the array elements, and supports the operations top (find -min), push (insert), and pop (delete-min). In this paper we introduce an in-place priority queue, for which top and push take O(1) worst-case time, and pop takes O(lg n) worst-case time and involves at most lg n + O(1) element comparisons, where n denotes the number of elements currently in the data structure. The achieved bounds are optimal to within additive constant terms for the number of element comparisons, hereby solving a long-standing open problem. Compared to binary heaps, we surpass the comparison bound for pop and the time bound for push. Our data structure is similar to a binary heap with two crucial differences:
International Journal of Foundations of Computer Science, 2014
We present algorithms that construct a sparse spanning subgraph of a 3-edge-connected graph that ... more We present algorithms that construct a sparse spanning subgraph of a 3-edge-connected graph that preserves 3-edge connectivity or of a 3-vertex-connected graph that preserves 3-vertex connectivity. Our algorithms are conceptually simple and run in O(|E|) time. These simple algorithms can be used to improve the efficiency of the best-known algorithms for 3-edge and 3-vertex connectivity and their related problems, by preprocessing the input graph so as to trim it down to a sparse graph. Afterwards, the original algorithms run in O(|V |) instead of O(|E|) time. Our algorithms generate an adjacency-lists structure to represent the sparse spanning subgraph, so that when a depth-first search is performed over the subgraph based on this adjacency-lists structure it actually traverses the paths in an ear-decomposition of the subgraph. This is useful because many of the existing algorithms for 3-edge-or 3-vertex connectivity and their related problems are based on an ear-decomposition of the given graph. Using such an adjacency-lists structure to represent the input graph would greatly improve the run-time efficiency of these algorithms.
Given an undirected 3-connected graph G with n vertices and m edges, we modify depth-first search... more Given an undirected 3-connected graph G with n vertices and m edges, we modify depth-first search to produce a sparse spanning subgraph with at most 4n − 10 edges that is still 3-connected. If G is 2-connected, to maintain 2-connectivity, the resulting graph will have at most 2n − 3 edges. The way depth-first search discards irrelevant edges illustrates the reason behind its ability to verify and certify biconnectivity [1-3] and triconnectivity in linear time. Dealing with a sparser graph, after the first depth-first-search calls, makes the algorithms in [2, 5] more efficient. We also give a characterization of separation pairs of a 2-connected graph in terms of the resulting sparse graph. *
Consider a sequence X of n elements, where the number of inversions in X is Inv. We give a simple... more Consider a sequence X of n elements, where the number of inversions in X is Inv. We give a simple linear-time transformation that reduces the problem of counting the inversions in X to that of counting inversions within disjoint subsequences of X of O(1 + (Inv/n) 2 ) elements each. In accordance, we can apply our transformation for counting inversions adaptively in O(n lg (Inv/n)) 1 time. Alternatively, if the elements are integers, we achieve a running time of O(n lg (Inv/n)) in the Word-RAM model of computation. (Amr Elmasry) We assume that lg x = max{1, log 2 x}
Proceedings of the Twentieth Annual ACM-SIAM Symposium on Discrete Algorithms, 2009
We give a variation of the pairing heaps for which the time bounds for all the operations match t... more We give a variation of the pairing heaps for which the time bounds for all the operations match the lower bound proved by Fredman for a family of similar self-adjusting heaps. Namely, our heap structure requires O(1) for insert and findmin, O(log n) for delete-min, and O(log log n) for decreasekey and meld (all the bounds are in the amortized sense except for find-min).
We give a new, simple proof for the sequential access theorem for splay trees. For an n-node spla... more We give a new, simple proof for the sequential access theorem for splay trees. For an n-node splay tree, our bound on the number of rotations is 4:5n, with a smaller constant than the bound of 10:8n concluded by Tarjan. We extend our proof to prove the deque conjecture for output-restricted deques. Our proofs provide additional insights into the workings of splay trees.
An n-node forest of trees is called a square-root forest, if it has the following structure. For ... more An n-node forest of trees is called a square-root forest, if it has the following structure. For a given positive integer k the forest has 2k trees. The first k + 1 are single nodes. For the other k − 1 trees, the root of tree l has l single-node children, for all l from 1 to k − 1. If n = k + k (k+1) 2 the definition is slightly different.
Google, Inc. (search). SIGN IN SIGN UP. Adaptive algorithms and structures. Authors: Amr Ahmed El... more Google, Inc. (search). SIGN IN SIGN UP. Adaptive algorithms and structures. Authors: Amr Ahmed Elmasry, Directors: Michael Fredman, Publication: · Doctoral Dissertation, ... top of page ABSTRACT. An abstract is not available. top of page AUTHORS. Amr Ahmed Elmasry No contac
We give a parameterized form for the standard implementation of the pairing heaps, skew heaps and... more We give a parameterized form for the standard implementation of the pairing heaps, skew heaps and skew-pairing heaps. When the node with the minimum value is to be deleted from the heap (deletemin operation), the procedure used to combine the resulting sub-trees into one tree depend on the value of a parameter k. When the value of k is equal to 2, the implementations are equivalent to the standard implementations. Using more complicated arguments, we show that for some predefined ranges of k this general form achieves the same bounds as the standard implementations. Finally, experimental results are conducted showing that for the pairing heaps, by tuning the value of k, the cost of the deletemin operation is reduced.
The 3rd ACS/IEEE International Conference onComputer Systems and Applications, 2005., 2005
Consider the scenario in which a start-up communication company charges its network users by the ... more Consider the scenario in which a start-up communication company charges its network users by the cost of the minimum spanning tree (MST) they use in their protocols. Wanting to increase their profits, they aim at maximizing the cost of the MST of their network. We consider two different cases. In the first case, the company has a set of links with fixed cost vector W and wants to configure the network so that the MST of the network will have the maximum possible cost. In the second case, the network topology is fixed, but the costs on the links assume d different values W 1 , W 2 , . . . , W d over the day. The company wants to fix the link costs to a value W = i p i W i , for some weights p 1 , p 2 , . . . , p d , where 0 ≤ p i ≤ 1 and i p i = 1, so that the resulting network has a maximum-cost MST.
We give a priority queue that achieves the same amortized bounds as Fibonacci heaps. Namely, find... more We give a priority queue that achieves the same amortized bounds as Fibonacci heaps. Namely, find-min requires O(1) worst-case time, insert, meld and decrease-key require O(1) amortized time, and delete-min requires $O(\log n)$ amortized time. Our structure is simple and promises an efficient practical behavior when compared to other known Fibonacci-like heaps. The main idea behind our construction is to propagate rank updates instead of performing cascaded cuts following a decrease-key operation, allowing for a relaxed structure.
We give a variation of the pairing heaps for which the time bounds for all the operations match t... more We give a variation of the pairing heaps for which the time bounds for all the operations match the lower bound proved by Fredman for a family of similar self-adjusting heaps. Namely, our heap structure requires O(1) for insert and findmin, O(log n) for delete-min, and O(log log n) for decreasekey and meld (all the bounds are in the amortized sense except for find-min).
We introduce space-efficient plane-sweep algorithms for basic planar geometric problems. It is as... more We introduce space-efficient plane-sweep algorithms for basic planar geometric problems. It is assumed that the input is in a read-only array of n items and that the available workspace is $\Theta(s)$ bits, where $\lg n \leq s \leq n \cdot \lg n$. In particular, we give an almost-optimal algorithm for finding the closest pair among a set of $n$ points that runs in $O(n^2/s + n \cdot \lg s)$ time. We give a simple algorithm to enumerate the intersections of $n$ line segments whose running time is $O((n^2/s) \cdot \lg^2 s + k)$, where $k$ is the number of reported intersections. When the segments are axis-parallel, we give an $O(n^2/s + n \cdot \lg s)$-time algorithm for counting the intersections, and an algorithm for enumerating the intersections whose running time is $O((n^2/s) \cdot \lg s \cdot \lg \lg s + n \cdot \lg s + k)$. We also present space-efficient algorithms to calculate the measure of $n$ axis-parallel rectangles.
An in-place priority queue is a data structure that is stored in an array, uses constant extra sp... more An in-place priority queue is a data structure that is stored in an array, uses constant extra space in addition to the array elements, and supports the operations top (find -min), push (insert), and pop (delete-min). In this paper we introduce an in-place priority queue, for which top and push take O(1) worst-case time, and pop takes O(lg n) worst-case time and involves at most lg n + O(1) element comparisons, where n denotes the number of elements currently in the data structure. The achieved bounds are optimal to within additive constant terms for the number of element comparisons, hereby solving a long-standing open problem. Compared to binary heaps, we surpass the comparison bound for pop and the time bound for push. Our data structure is similar to a binary heap with two crucial differences:
International Journal of Foundations of Computer Science, 2014
We present algorithms that construct a sparse spanning subgraph of a 3-edge-connected graph that ... more We present algorithms that construct a sparse spanning subgraph of a 3-edge-connected graph that preserves 3-edge connectivity or of a 3-vertex-connected graph that preserves 3-vertex connectivity. Our algorithms are conceptually simple and run in O(|E|) time. These simple algorithms can be used to improve the efficiency of the best-known algorithms for 3-edge and 3-vertex connectivity and their related problems, by preprocessing the input graph so as to trim it down to a sparse graph. Afterwards, the original algorithms run in O(|V |) instead of O(|E|) time. Our algorithms generate an adjacency-lists structure to represent the sparse spanning subgraph, so that when a depth-first search is performed over the subgraph based on this adjacency-lists structure it actually traverses the paths in an ear-decomposition of the subgraph. This is useful because many of the existing algorithms for 3-edge-or 3-vertex connectivity and their related problems are based on an ear-decomposition of the given graph. Using such an adjacency-lists structure to represent the input graph would greatly improve the run-time efficiency of these algorithms.
Given an undirected 3-connected graph G with n vertices and m edges, we modify depth-first search... more Given an undirected 3-connected graph G with n vertices and m edges, we modify depth-first search to produce a sparse spanning subgraph with at most 4n − 10 edges that is still 3-connected. If G is 2-connected, to maintain 2-connectivity, the resulting graph will have at most 2n − 3 edges. The way depth-first search discards irrelevant edges illustrates the reason behind its ability to verify and certify biconnectivity [1-3] and triconnectivity in linear time. Dealing with a sparser graph, after the first depth-first-search calls, makes the algorithms in [2, 5] more efficient. We also give a characterization of separation pairs of a 2-connected graph in terms of the resulting sparse graph. *
Consider a sequence X of n elements, where the number of inversions in X is Inv. We give a simple... more Consider a sequence X of n elements, where the number of inversions in X is Inv. We give a simple linear-time transformation that reduces the problem of counting the inversions in X to that of counting inversions within disjoint subsequences of X of O(1 + (Inv/n) 2 ) elements each. In accordance, we can apply our transformation for counting inversions adaptively in O(n lg (Inv/n)) 1 time. Alternatively, if the elements are integers, we achieve a running time of O(n lg (Inv/n)) in the Word-RAM model of computation. (Amr Elmasry) We assume that lg x = max{1, log 2 x}
Proceedings of the Twentieth Annual ACM-SIAM Symposium on Discrete Algorithms, 2009
We give a variation of the pairing heaps for which the time bounds for all the operations match t... more We give a variation of the pairing heaps for which the time bounds for all the operations match the lower bound proved by Fredman for a family of similar self-adjusting heaps. Namely, our heap structure requires O(1) for insert and findmin, O(log n) for delete-min, and O(log log n) for decreasekey and meld (all the bounds are in the amortized sense except for find-min).
We give a new, simple proof for the sequential access theorem for splay trees. For an n-node spla... more We give a new, simple proof for the sequential access theorem for splay trees. For an n-node splay tree, our bound on the number of rotations is 4:5n, with a smaller constant than the bound of 10:8n concluded by Tarjan. We extend our proof to prove the deque conjecture for output-restricted deques. Our proofs provide additional insights into the workings of splay trees.
An n-node forest of trees is called a square-root forest, if it has the following structure. For ... more An n-node forest of trees is called a square-root forest, if it has the following structure. For a given positive integer k the forest has 2k trees. The first k + 1 are single nodes. For the other k − 1 trees, the root of tree l has l single-node children, for all l from 1 to k − 1. If n = k + k (k+1) 2 the definition is slightly different.
Google, Inc. (search). SIGN IN SIGN UP. Adaptive algorithms and structures. Authors: Amr Ahmed El... more Google, Inc. (search). SIGN IN SIGN UP. Adaptive algorithms and structures. Authors: Amr Ahmed Elmasry, Directors: Michael Fredman, Publication: · Doctoral Dissertation, ... top of page ABSTRACT. An abstract is not available. top of page AUTHORS. Amr Ahmed Elmasry No contac
Uploads
Papers by Amr Elmasry