Structuring depth-first search algorithms in Haskell
- 1 January 1995
- proceedings article
- Published by Association for Computing Machinery (ACM)
- p. 344-354
- https://doi.org/10.1145/199448.199530
Abstract
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 calculational-style proof of a far from obvious strongly-connected components algorithm.Keywords
This publication has 0 references indexed in Scilit: