Results 1 - 10
of
22
Lazy Imperative Programming
- Yale University
, 1993
"... In this paper we argue for the importance of lazy state, that is, sequences of imperative (destructive) actions in which the actions are delayed until their results are required. This enables state-based computations to take advantage of the control power of lazy evaluation. We provide some examples ..."
Abstract
-
Cited by 30 (6 self)
- Add to MetaCart
In this paper we argue for the importance of lazy state, that is, sequences of imperative (destructive) actions in which the actions are delayed until their results are required. This enables state-based computations to take advantage of the control power of lazy evaluation. We provide some examples of its use, and describe an implementation within Glasgow Haskell. 1 Introduction There has long been a tension between functional programming languages and their more traditional imperative counterparts. On the one hand, functional languages are commonly more expressive and easier to reason about than imperative languages, but on the other hand, certain algorithms and interactions seem to rely fundamentally on state-based computation. It is clearly worth attempting to combine the strengths of each. Some languages like Scheme and ML have incorporated imperative actions as side effects. This approach only makes sense in a call-by-value language where the order of evaluation is statically de...
Structuring Depth-First Search Algorithms in Haskell
, 1995
"... Depth-first search is the key to a wide variety of graph algorithms. In this paper we express depth-first search in a lazy functional language, obtaining a linear-time implementation. Unlike traditional imperative presentations, we use the structuring methods of functional languages to construct alg ..."
Abstract
-
Cited by 24 (0 self)
- Add to MetaCart
Depth-first search is the key to a wide variety of graph algorithms. In this paper we express depth-first search in a lazy functional language, obtaining a linear-time implementation. Unlike traditional imperative presentations, we use the structuring methods of functional languages to construct algorithms from individual reusable components. This style of algorithm construction turns out to be quite amenable to formal proof, which we exemplify through a calculationalstyle proof of a far from obvious strongly-connected components algorithm. Classifications: Computing Paradigms (functional programming) ; Environments, Implementations, and Experience (programming, graph algorithms). 1 Introduction The importance of depth-first search (DFS) for graph algorithms was established twenty years ago by Tarjan (1972) and Hopcroft and Tarjan (1973) in their seminal work. They demonstrated how depth-first search could be used to construct a variety of efficient graph algorithms. In practice, this...
Improved Dynamic Reachability Algorithms for Directed Graphs
, 2002
"... We obtain several new dynamic algorithms for maintaining the transitive closure of a directed graph, and several other algorithms for answering reachability queries without explicitly maintaining a transitive closure matrix. Among our algorithms are: (i) A decremental algorithm for maintaining the ..."
Abstract
-
Cited by 23 (3 self)
- Add to MetaCart
We obtain several new dynamic algorithms for maintaining the transitive closure of a directed graph, and several other algorithms for answering reachability queries without explicitly maintaining a transitive closure matrix. Among our algorithms are: (i) A decremental algorithm for maintaining the transitive closure of a directed graph, through an arbitrary sequence of edge deletions, in O(mn) total expected time, essentially the time needed for computing the transitive closure of the initial graph. Such a result was previously known only for acyclic graphs.
Path-based depth-first search for strong and biconnected components
- Information Processing Letters
, 2000
"... Key words: Graph, depth-first search, strongly connected component, biconnected component, stack. ..."
Abstract
-
Cited by 21 (0 self)
- Add to MetaCart
Key words: Graph, depth-first search, strongly connected component, biconnected component, stack.
A fully dynamic reachability algorithm for directed graphs with an almost linear update time
- In Proc. of ACM Symposium on Theory of Computing
, 2004
"... We obtain a new fully dynamic algorithm for the reachability problem in directed graphs. Our algorithm has an amortized update time of O(m+n log n) and a worst-case query time of O(n), where m is the current number of edges in the graph, and n is the number of vertices in the graph. Each update oper ..."
Abstract
-
Cited by 17 (1 self)
- Add to MetaCart
We obtain a new fully dynamic algorithm for the reachability problem in directed graphs. Our algorithm has an amortized update time of O(m+n log n) and a worst-case query time of O(n), where m is the current number of edges in the graph, and n is the number of vertices in the graph. Each update operation either inserts a set of edges that touch the same vertex, or deletes an arbitrary set of edges. The algorithm is deterministic and uses fairly simple data structures. This is the first algorithm that breaks the O(n 2) update barrier for all graphs with o(n 2)edges. One of the ingredients used by this new algorithm may be interesting in its own right. It is a new dynamic algorithm for strong connectivity in directed graphs with an interesting persistency property. Each insert operation creates a new version of the graph. A delete operation deletes edges from all versions. Strong connectivity queries can be made on each version of the graph. The algorithm handles each update in O(mα(m, n)) amortized time, and each query in O(1) time, where α(m, n) is a functional inverse of Ackermann’s function appearing in the analysis of the union-find data structure. Note that the update time of O(mα(m, n)), in case of a delete operation, is the time needed for updating all versions of the graph. Categories and Subject Descriptors G.2.2 [Discrete Mathematics]: Graph Theory—Graph algorithms, Path and circuit problems
Algorithms for dense graphs and networks on the random access computer, Algorithmica 15
, 1996
"... Abstract. We improve upon the running time of several graph and network algorithms when applied to dense graphs. In particular, we show how to compute on a machine with word size L = f2 (log n) a maximal matching in an n-vertex bipartite graph in time O (n 2 + n2"5/~.) = O (n2"5/log n), how to comp ..."
Abstract
-
Cited by 12 (4 self)
- Add to MetaCart
Abstract. We improve upon the running time of several graph and network algorithms when applied to dense graphs. In particular, we show how to compute on a machine with word size L = f2 (log n) a maximal matching in an n-vertex bipartite graph in time O (n 2 + n2"5/~.) = O (n2"5/log n), how to compute the transitive closure of a digraph with n vertices and m edges in time O(n 2 + nm/,k), how to solve the uncapacitated transportation problem with integer costs in the range [0..C] and integer demands in the range [-U..U] in time O ((n 3 (log log / log n) 1/2 + n 2 log U) log nC), and how to solve the assignment problem with integer costs in the range [0..C] in time O(n 2"5 lognC/(logn/loglogn)l/4). Assuming a suitably compressed input, we also show how to do depth-first and breadth-first search and how to compute strongly connected components and biconnected components in time O(n~. + n2/L), and how to solve the single source shortest-path problem with integer costs in the range [0..C] in time O (n 2 (log C)/log n). For the transitive closure algorithm we also report on the experiences with an implementation. Key Words.
A note on on-the-fly verification algorithms
- In Proc. of TACAS’05, LNCS
, 2005
"... Abstract. The automata-theoretic approach to verification of LTL relies on an algorithm for finding accepting cycles in the product of the system and a B"uchi automaton for the negation of the formula. Explicit-state model checkers typically construct the product space "on the fly " a ..."
Abstract
-
Cited by 10 (0 self)
- Add to MetaCart
Abstract. The automata-theoretic approach to verification of LTL relies on an algorithm for finding accepting cycles in the product of the system and a B"uchi automaton for the negation of the formula. Explicit-state model checkers typically construct the product space "on the fly " and explore the states using depthfirst search. We survey algorithms proposed for this purpose and propose two improved algorithms, one based on nested DFS, the other on strongly connected components. We compare these algorithms both theoretically and experimentally and determine cases where both algorithms can be useful. 1 Introduction The model-checking problem for finite-state systems and linear-time temporal logic (LTL) is usually reduced to checking the emptiness of a B"uchi automaton, i.e. the product of the system and an automaton for the negated formula [23]. Various strategies exist for reducing the size of the automaton. For instance, symbolic model checking employs data structures to compactly represent large sets of states. This strategy combines well with breadth-first search, leading to solutions whose worst-case time is essentially O(n2) or O(n log n), if n is the size of the product. A survey of symbolic emptiness algorithms can be found in [8]. Explicit-state model checkers, on the other hand, construct the product automaton `on the fly', i.e. while searching the automaton. Thus, the model checker may be able to find a counterexample without ever constructing the complete state space. On-the-fly verification can be combined with partial order methods [18, 15] to reduce the effect of state explosion.
Lazy Depth-First Search and Linear Graph Algorithms in Haskell
- Glasgow Workshop on Functional Programming
, 1994
"... Depth-first search is the key to a wide variety of graph algorithms. In this paper we explore the implementation of depth first search in a lazy functional language. For the first time in such languages we obtain a linear-time implementation. But we go further. Unlike traditional imperative presenta ..."
Abstract
-
Cited by 6 (0 self)
- Add to MetaCart
Depth-first search is the key to a wide variety of graph algorithms. In this paper we explore the implementation of depth first search in a lazy functional language. For the first time in such languages we obtain a linear-time implementation. But we go further. Unlike traditional imperative presentations, algorithms are constructed from individual components, which may be reused to create new algorithms. Furthermore, the style of program is quite amenable to formal proof, which we exemplify through a calculational-style proof of a strongly-connected components algorithm. 1 Introduction Graph algorithms have long been a challenge to programmers of lazy functional languages. It has not been at all clear how to express such algorithms without using side effects to achieve efficiency. For example, many texts provide implementations of search algorithms which are quadratic in the size of the graph (see Paulson (1991), Holyer (1991), or Harrison (1993)), compared with the standard linear im...
Incremental evaluation of tabled prolog: Beyond pure logic programs
- Lecture Notes in Computer Science
, 2006
"... ..."

