## Dijkstra’s algorithm with Fibonacci heaps: An executable description (2006)

### Cached

### Download Links

Venue: | in CHR. In 20th Workshop on Logic Programming (WLP’06 |

Citations: | 18 - 11 self |

### BibTeX

@INPROCEEDINGS{Sneyers06dijkstra’salgorithm,

author = {Jon Sneyers and Tom Schrijvers and Bart Demoen},

title = {Dijkstra’s algorithm with Fibonacci heaps: An executable description},

booktitle = {in CHR. In 20th Workshop on Logic Programming (WLP’06},

year = {2006},

pages = {182--191}

}

### Years of Citing Articles

### OpenURL

### Abstract

Abstract. We construct a readable, compact and efficient implementation of Dijkstra’s shortest path algorithm and Fibonacci heaps using Constraint Handling Rules (CHR), which is increasingly used as a high-level rule-based general-purpose programming language. We measure its performance in different CHR systems, investigating both the theoretical asymptotic complexity and the constant factors realized in practice. 1

### Citations

1444 | A note on two problems in connexion with graphs
- Dijkstra
- 1959
(Show Context)
Citation Context ...(F.W.O.-Vlaanderen). ⋆⋆ Research Assistant of the Research Foundation - Flanders (F.W.O.-Vlaanderen).sThe SSSP problem with nonnegative edge weights can be solved using Dijkstra’s classical algorithm =-=[7]-=-. A naive implementation of this algorithm runs in O(n 2 ) time, which is suboptimal for non-dense graphs. Efficient implementations use a priority queue, a data structure consisting of a set of item-... |

712 | Introduction to Algorithms, Second Edition
- Cormen, Leiserson, et al.
- 2001
(Show Context)
Citation Context ...icult to implement correctly. Implementations in imperative languages (e.g. [3]) typically take at least some 300 lines of hardto-understand code. Even the pseudo-code description of F-heaps given in =-=[4]-=- is 63 lines long. In contrast, the program we have constructed is directly executable and consists of just 22 CHR rules, or about 40 lines including declarations and whitespace. 6.1 Related work As f... |

577 |
Fibonacci heaps and their uses in improved network optimization algorithms
- Fredman, Tarjan
- 1987
(Show Context)
Citation Context ...ven item. Fibonacci heaps (F-heaps) implement insert and decrease-key in O(1) amortized time, and extract-min in O(log n) amortized time, where n is the number of elements in the queue. Using F-heaps =-=[9]-=-, Dijkstra’s algorithm takes O(m + n log n) time. This combination is still the fastest known algorithm for solving this variant of the SSSP problem. 3 An executable description of the algorithms In t... |

396 | Theory and practice of constraint handling rules
- Frühwirth
- 1998
(Show Context)
Citation Context ...easure its performance in different CHR systems, investigating both the theoretical asymptotic complexity and the constant factors realized in practice. 1 Introduction Constraint Handling Rules (CHR) =-=[10]-=- is a high-level programming language extension based on multi-headed committed-choice rules. Originally designed for writing constraint solvers, it is increasingly used as a general-purpose programmi... |

228 | Purely Functional Data Structures
- Okasaki
- 1998
(Show Context)
Citation Context ...onstructed a functional implementation of the simpler and asymptotically slower binomial queues [23], using about 45 lines of Haskell code (for the operations needed in Dijkstra’s algorithm). Okasaki =-=[17]-=- and Brodal [1] constructed functional implementations of many variants of priority queues, including binomial queues (in 36 lines of Standard ML code plus 17 signature lines), leftist heaps, and pair... |

86 | A data structure for manipulating priority queues
- Vuillemin
- 1978
(Show Context)
Citation Context ...r as we know, this is the first implementation of Fibonacci heaps in a declarative language. King [15] constructed a functional implementation of the simpler and asymptotically slower binomial queues =-=[23]-=-, using about 45 lines of Haskell code (for the operations needed in Dijkstra’s algorithm). Okasaki [17] and Brodal [1] constructed functional implementations of many variants of priority queues, incl... |

65 | On the complexity analysis of static analyses
- McAllester
- 2002
(Show Context)
Citation Context ... find the children of a node. In the code generated by the CHR compiler, a hash-table (or array) index on this argument is maintained. McAllester introduced a pure logic programming algorithmic model =-=[16]-=-, which was extended with rule priorities and deletion [11]. Generalizing this model to include rules with a variable priority, Ganzinger and McAllester construct a very compact implementation of Dijk... |

56 | The K.U.Leuven CHR system: Implementation and application
- Schrijvers, Demoen
- 2004
(Show Context)
Citation Context ...yntax proposed in [22], as listed in Figures 1 and 2. Since all stored constraints are (declared) ground, allowing constant time lookups using hash-tables constraint stores, the K.U.Leuven CHR system =-=[19]-=- realizes all of the above properties. The crucial argument positions for which constant time look-ups are necessary are the first argument of edge/3, the first argument of distance/2, and the first a... |

55 | Exact and Approximate Distances in Graphs – A Survey
- Zwick
- 2001
(Show Context)
Citation Context ...type of constraint stores for indexing on ground integer arguments, improving the constant factor (for our program) by 35% or more. 2 The single-source shortest path problem The shortest path problem =-=[26]-=- is one of the most basic, and most studied, problems in algorithmic graph theory. It appears as a sub-problem in many graph related algorithms, such as network optimization algorithms. Given a weight... |

51 |
An overview of the SWI-Prolog programming environment
- Wielemaker
(Show Context)
Citation Context ...a Pentium 4 (1.7 GHz) machine with 512 Mb RAM running Debian GNU/Linux (kernel version 2.6.8) with a low load. The following CHR systems were used: the K.U.Leuven CHR system [19] in SWI-Prolog 5.5.31 =-=[25]-=- and hProlog 2.4.12-32 [6], the K.U.Leuven JCHR system 1.0.3 [24] (Java 1.5.0), and the reference CHR implementations [14, 13] in SICStus 3.12.2 [2] and YAP 5.0.0 [5]. In the SICStus and YAP versions ... |

50 | The computational power and complexity of constraint handling rules
- Sneyers, Schrijvers, et al.
- 2009
(Show Context)
Citation Context ...iting constraint solvers, it is increasingly used as a general-purpose programming language. We assume that the reader is familiar with CHR, referring to [10] for an overview. Recently, we have shown =-=[21]-=- that every algorithm can be implemented in CHR with the best-known asymptotic time and space complexity. However, it remains an open problem whether classical algorithms can be implemented in CHR in ... |

47 |
The pairing heap: A new form of self-adjusting heap
- Fredman, Sedgewick, et al.
- 1986
(Show Context)
Citation Context ...] constructed functional implementations of many variants of priority queues, including binomial queues (in 36 lines of Standard ML code plus 17 signature lines), leftist heaps [5], and pairing heaps =-=[10]-=- (but not Fibonacci heaps), but they all lack the decrease-key operation. They conclude [1] that further research is needed to implement the decrease-key operation efficiently in a (purely) functional... |

46 |
Analyses, optimizations and extensions of Constraint Handling Rules
- Schrijvers
- 2005
(Show Context)
Citation Context ...e the hProlog version, and about 3 to 4 times slower than the SICStus and YAP versions. These differences are largely explained by differences in the underlying Prolog systems (see e.g. Appendix B in =-=[18]-=-). The K.U.Leuven JCHR version (which has type and mode declarations but no array constraint store) is about 1.6 times faster than the corresponding SWI-Prolog version and about 3.5 times slower than ... |

37 |
María García de la
- Duck, Stuckey
- 2004
(Show Context)
Citation Context ...igh-level description of Dijkstra’s algorithm with Fibonacci heaps using CHR rules, which are directly executable in any CHR system. All recent CHR systems implement the refined operational semantics =-=[8]-=-, which implies that the rules are tried in textual order. Correctness, termination, and complexity of the program crucially depend on this execution strategy. This can be avoided by introducing auxil... |

34 | Optimal union-find in Constraint Handling Rules. Theory and Practice of Logic Programming
- Schrijvers, Frühwirth
- 2006
(Show Context)
Citation Context ...nt and compact way. Also, the constant factor hidden behind the notion of asymptotic time complexity could be so huge to be completely paralyzing in practice. Earlier work by Schrijvers and Frühwirth =-=[20]-=- resulted in an elegant CHR implementation of the classical union-find algorithm which has the optimal asymptotic time complexity. In this paper, we construct a readable, compact and efficient CHR pro... |

30 | A new metacomplexity theorem for bottom-up logic programs
- Ganzinger, McAllester
- 2001
(Show Context)
Citation Context ...CHR compiler, a hash-table (or array) index on this argument is maintained. McAllester introduced a pure logic programming algorithmic model [16], which was extended with rule priorities and deletion =-=[11]-=-. Generalizing this model to include rules with a variable priority, Ganzinger and McAllester construct a very compact implementation of Dijkstra’s algorithm in just three rules [12]. They theoretical... |

30 |
A Prolog Constraint Handling Rules compiler and runtime system
- Holzbaur, Frühwirth
(Show Context)
Citation Context ...ng CHR systems were used: the K.U.Leuven CHR system [19] in SWI-Prolog 5.5.31 [25] and hProlog 2.4.12-32 [6], the K.U.Leuven JCHR system 1.0.3 [24] (Java 1.5.0), and the reference CHR implementations =-=[14, 13]-=- in SICStus 3.12.2 [2] and YAP 5.0.0 [5]. In the SICStus and YAP versions we have inserted extra pragma passive directives to avoid redundant rule trials. They are detected and added automatically by ... |

27 | Logical algorithms
- Ganzinger, McAllester
- 2002
(Show Context)
Citation Context ...ties and deletion [11]. Generalizing this model to include rules with a variable priority, Ganzinger and McAllester construct a very compact implementation of Dijkstra’s algorithm in just three rules =-=[12]-=-. They theoretically construct an interpreter on a RAM machine for their logic programming model which can run their implementation of Dijkstra’s algorithm in O(m log m) time, which is worse than the ... |

23 |
Linear lists and priority queues as balanced binary trees
- Crane
- 1972
(Show Context)
Citation Context ... [19, 20] and Brodal [1] constructed functional implementations of many variants of priority queues, including binomial queues (in 36 lines of Standard ML code plus 17 signature lines), leftist heaps =-=[5]-=-, and pairing heaps [10] (but not Fibonacci heaps), but they all lack the decrease-key operation. They conclude [1] that further research is needed to implement the decrease-key operation efficiently ... |

19 | K.U.Leuven JCHR: a user-friendly, flexible and efficient CHR system for Java
- Weert, Schrijvers, et al.
- 2005
(Show Context)
Citation Context ...Linux (kernel version 2.6.8) with a low load. The following CHR systems were used: the K.U.Leuven CHR system [19] in SWI-Prolog 5.5.31 [25] and hProlog 2.4.12-32 [6], the K.U.Leuven JCHR system 1.0.3 =-=[24]-=- (Java 1.5.0), and the reference CHR implementations [14, 13] in SICStus 3.12.2 [2] and YAP 5.0.0 [5]. In the SICStus and YAP versions we have inserted extra pragma passive directives to avoid redunda... |

18 | Optimal purely functional priority queues
- Brodal, Okasaki
- 1996
(Show Context)
Citation Context ...ctional implementation of the simpler and asymptotically slower binomial queues [23], using about 45 lines of Haskell code (for the operations needed in Dijkstra’s algorithm). Okasaki [17] and Brodal =-=[1]-=- constructed functional implementations of many variants of priority queues, including binomial queues (in 36 lines of Standard ML code plus 17 signature lines), leftist heaps, and pairing heaps (but ... |

11 |
Tomasz Radzik. Shortest paths algorithms: Theory and experimental evaluation
- Cherkassky, Goldberg
- 1996
(Show Context)
Citation Context ...weight 1 from node i to node i + 1 (and node n to node 1) and 3n random weight edges, 3 from every node to some randomly chosen other node. Such graphs essentially correspond to the “Rand4” family of =-=[3]-=-. All tests were performed on a Pentium 4 (1.7 GHz) machine with 512 Mb RAM running Debian GNU/Linux (kernel version 2.6.8) with a low load. The following CHR systems were used: the K.U.Leuven CHR sys... |

11 | Functional binomial queues
- King
- 1994
(Show Context)
Citation Context ... of just 22 CHR rules, or about 40 lines including declarations and whitespace. 6.1 Related work As far as we know, this is the first implementation of Fibonacci heaps in a declarative language. King =-=[15]-=- constructed a functional implementation of the simpler and asymptotically slower binomial queues [23], using about 45 lines of Haskell code (for the operations needed in Dijkstra’s algorithm). Okasak... |

11 | Data Structures and Amortized Complexity in a Functional Setting
- Schoenmakers
- 1992
(Show Context)
Citation Context ... conclude [1] that further research is needed to implement the decrease-key operation efficiently in a (purely) functional setting without increasing the bounds for the other operations. Schoenmakers =-=[21]-=- uses a functional notation to aid in the analysis of a number of data structures, including Fibonacci heaps. He uses a formal functional notation extended with imperative features, such as pointer an... |

6 |
hProlog home
- Demoen
(Show Context)
Citation Context ...ne with 512 Mb RAM running Debian GNU/Linux (kernel version 2.6.8) with a low load. The following CHR systems were used: the K.U.Leuven CHR system [19] in SWI-Prolog 5.5.31 [25] and hProlog 2.4.12-32 =-=[6]-=-, the K.U.Leuven JCHR system 1.0.3 [24] (Java 1.5.0), and the reference CHR implementations [14, 13] in SICStus 3.12.2 [2] and YAP 5.0.0 [5]. In the SICStus and YAP versions we have inserted extra pra... |

2 |
CHR reference manual
- Holzbaur, Frühwirth
- 1998
(Show Context)
Citation Context ...ng CHR systems were used: the K.U.Leuven CHR system [19] in SWI-Prolog 5.5.31 [25] and hProlog 2.4.12-32 [6], the K.U.Leuven JCHR system 1.0.3 [24] (Java 1.5.0), and the reference CHR implementations =-=[14, 13]-=- in SICStus 3.12.2 [2] and YAP 5.0.0 [5]. In the SICStus and YAP versions we have inserted extra pragma passive directives to avoid redundant rule trials. They are detected and added automatically by ... |

2 |
and continuation optimization for occurrence representations of CHR
- Guard
- 2005
(Show Context)
Citation Context ...re efficient constraint store data structures, satisfying the above assumption. Optional mode declarations were first introduced in [20]. We use the extended constraint declaration syntax proposed in =-=[22]-=-, as listed in Figures 1 and 2. Since all stored constraints are (declared) ground, allowing constant time lookups using hash-tables constraint stores, the K.U.Leuven CHR system [19] realizes all of t... |

2 |
et al. The K.U.Leuven CHR system home
- Schrijvers
- 2005
(Show Context)
Citation Context ... All tests were performed on a Pentium 4 (1.7 GHz) machine with 512 Mb RAM running Debian GNU/Linux (kernel version 2.6.8) with a low load. They can be downloaded at the K.U.Leuven CHR system website =-=[24]-=-. The following CHR systems were used: the K.U.Leuven CHR system [23] in SWI-Prolog 5.5.31 [31] and hProlog 2.4.12-32 [7], the K.U.Leuven JCHR system 1.0.3 [30] (Java 1.5.0), and the reference CHR imp... |