Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 426 lines (312 sloc) 12.116 kb
78824d05 »
2012-06-09 README updates.
1 CL-HEAP
2 =======
87f8f973 » rneeser
2009-03-24 Initial import.
3
4 CL-HEAP is a Common Lisp library that provides efficient priority
5 queue and heap implementations. Heaps are tree data structure in which
6 any child, c, of a parent, p, obeys the relation p R c, for some
7 relation R (often less-than or greater-than). Heaps can be used
8 directly as priority queues, and are important components of many
9 algorithms, like those for finding shortest paths and calculating
10 minimum spanning trees.
11
12 The library is simple to use. Here's an example covering most of the
13 priority queue functionality:
14
e7ee13c6 »
2012-06-09 README tests.
15 ```lisp
1507ad02 »
2012-06-09 More readme updates.
16 (defparameter *queue* (make-instance 'cl-heap:priority-queue))
17
87f8f973 » rneeser
2009-03-24 Initial import.
18 (cl-heap:enqueue *queue* 'test 15) ; Enqueue the item with the priority of 15.
19 (cl-heap:enqueue *queue* 'this -5)
20 (cl-heap:enqueue *queue* 'a 10)
21 (cl-heap:enqueue *queue* 'is 5)
22
23 (cl-heap:peep-at-queue *queue*) => 'this
24
25 (cl-heap:dequeue *queue*) => 'this
26 (cl-heap:dequeue *queue*) => 'is
27 (cl-heap:dequeue *queue*) => 'a
28 (cl-heap:dequeue *queue*) => 'test
1507ad02 »
2012-06-09 More readme updates.
29 ```
87f8f973 » rneeser
2009-03-24 Initial import.
30
31 The library provides an implementation of an array-based binary heap -
32 offering O(log(n)) times for most operations - and the Fibonacci
33 heap. While any sequence of arbitrary operations on a Fibonacci heap
34 occur in amortised logarithmic time, many common operations occur in
35 constant and amortised constant time. See below for further
36 details. The Fibonacci heap should generally be your heap of choice
37 from this library.
38
39
78824d05 »
2012-06-09 README updates.
40 Installation and Usage
41 ----------------------
87f8f973 » rneeser
2009-03-24 Initial import.
42
43 CL-HEAP depends on XLUNIT, which is used to perform unit
44 testing. CL-HEAP has been tested and is known to run on SBCL. If
45 you've tried this on other compilers and it runs successfully, please
46 let me know. The library can be installed using ASDF-INSTALL:
47
1507ad02 »
2012-06-09 More readme updates.
48 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
49 (require 'asdf-install)
50 (asdf-install:install 'cl-heap)
1507ad02 »
2012-06-09 More readme updates.
51 ```
87f8f973 » rneeser
2009-03-24 Initial import.
52
53 And the library can then be loaded with ASDF:
54
1507ad02 »
2012-06-09 More readme updates.
55 ```lisp
9bb52adb »
2012-06-09 README tests.
56 (asdf:load-system 'cl-heap)
1507ad02 »
2012-06-09 More readme updates.
57 ```
87f8f973 » rneeser
2009-03-24 Initial import.
58
78824d05 »
2012-06-09 README updates.
59 Test Suite
60 ----------
87f8f973 » rneeser
2009-03-24 Initial import.
61
62 CL-HEAP comes with a test suite. The tests for the various classes can
63 be performed as follows:
64
1507ad02 »
2012-06-09 More readme updates.
65 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
66 (xlunit:textui-test-run (xlunit:get-suite cl-heap:fibonacci-test))
67 (xlunit:textui-test-run (xlunit:get-suite cl-heap:binary-test))
68 (xlunit:textui-test-run (xlunit:get-suite cl-heap:priority-queue-test))
1507ad02 »
2012-06-09 More readme updates.
69 ```
87f8f973 » rneeser
2009-03-24 Initial import.
70
78824d05 »
2012-06-09 README updates.
71 The PRIORITY-QUEUE Class
72 ------------------------
87f8f973 » rneeser
2009-03-24 Initial import.
73
74 This priority queue is a container for items in which all the items
75 are sorted by some given priority. We implement the priority queue
76 using a Fibonacci heap.
fb03e807 »
2012-06-09 README test
77
87f8f973 » rneeser
2009-03-24 Initial import.
78
c58cedf5 »
2012-06-09 README test
79 *MAKE-INSTANCE* accepts the argument :sort-fun to provide the function
87f8f973 » rneeser
2009-03-24 Initial import.
80 which the items' priorities are sorted by. This defaults to #'<, which
81 will cause the queue to always return the item of lowest priority.
82
c58cedf5 »
2012-06-09 README test
83 ```lisp
84 (ENQUEUE queue item priority)
85 ```
fb03e807 »
2012-06-09 README test
86 Adds the item to the queue at the given priority. Returns a
87 list containing first the item's priority, then the item
88 itself. Running time: O(1)
87f8f973 » rneeser
2009-03-24 Initial import.
89
90
c58cedf5 »
2012-06-09 README test
91 ```lisp
92 (DEQUEUE queue)
93 ```
fb03e807 »
2012-06-09 README test
94 Removes the item of lowest priority from the queue. Running
95 time: amortised O(log(n))
87f8f973 » rneeser
2009-03-24 Initial import.
96
fb03e807 »
2012-06-09 README test
97
c58cedf5 »
2012-06-09 README test
98 ```lisp
99 (PEEP-AT-QUEUE queue)
100 ```
fb03e807 »
2012-06-09 README test
101 Returns the item of lowest priority from the queue, without
102 modifying the queue. Running time: O(1)
103
104
c58cedf5 »
2012-06-09 README test
105 ```lisp
106 (EMPTY-QUEUE queue)
107 ```
fb03e807 »
2012-06-09 README test
108 Removes all items from the queue. Returns the heap. Running
109 time: O(1)
87f8f973 » rneeser
2009-03-24 Initial import.
110
c58cedf5 »
2012-06-09 README test
111
112 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
113 (QUEUE-SIZE queue)
c58cedf5 »
2012-06-09 README test
114 ```
115 Returns the number of items in the queue. Running time: O(1)
87f8f973 » rneeser
2009-03-24 Initial import.
116
117
78824d05 »
2012-06-09 README updates.
118 The HEAP Class
119 --------------
87f8f973 » rneeser
2009-03-24 Initial import.
120
121 HEAP provides functionality common to the two heap classes implement
122 by CL-HEAP. Each heap implementation accepts at least two arguments to
123 MAKE-INSTANCE: :key and :sort-fun. :sort-fun supplies the function to
e7ee13c6 »
2012-06-09 README tests.
124 be used when comparing two objects to each other, and defaults to #'<.
125 :key gives a function which should be first applied to the
87f8f973 » rneeser
2009-03-24 Initial import.
126 elements in the HEAP before comparing them using the sorting
127 function. :key defaults to #'identity. These functions can be accessed
128 using HEAP-KEY and HEAP-SORTING-FUNCTION.
129
130 Both of the heap implementations obey the same interface:
131
73ec41f0 »
2012-06-09 README test
132 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
133 (HEAP-KEY heap)
73ec41f0 »
2012-06-09 README test
134 ```
135 Returns the function passed as the :key argument to the heap.
87f8f973 » rneeser
2009-03-24 Initial import.
136
73ec41f0 »
2012-06-09 README test
137 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
138 (HEAP-SORTING-FUNCTION heap)
73ec41f0 »
2012-06-09 README test
139 ```
140 Returns the function used to sort the elements in the heap.
87f8f973 » rneeser
2009-03-24 Initial import.
141
73ec41f0 »
2012-06-09 README test
142 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
143 (HEAP-SIZE heap)
73ec41f0 »
2012-06-09 README test
144 ```
145 Returns the number of elements in the heap.
87f8f973 » rneeser
2009-03-24 Initial import.
146
73ec41f0 »
2012-06-09 README test
147 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
148 (EMPTY-HEAP heap)
73ec41f0 »
2012-06-09 README test
149 ```
150 Removes all items from the heap, and returns the heap.
87f8f973 » rneeser
2009-03-24 Initial import.
151
73ec41f0 »
2012-06-09 README test
152 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
153 (IS-EMPTY-HEAP-P heap)
73ec41f0 »
2012-06-09 README test
154 ```
155 Returns true iff the heap contains no elements.
87f8f973 » rneeser
2009-03-24 Initial import.
156
73ec41f0 »
2012-06-09 README test
157 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
158 (ADD-TO-HEAP heap item)
73ec41f0 »
2012-06-09 README test
159 ```
160 Adds the given item to the heap. Returns two values: first the item
161 itself, and then some index-key which can be used by DECREASE-KEY and
162 DELETE-KEY to identify which values should be affected by these
163 operations. See below for an example.
87f8f973 » rneeser
2009-03-24 Initial import.
164
73ec41f0 »
2012-06-09 README test
165 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
166 (ADD-ALL-TO-HEAP heap items)
73ec41f0 »
2012-06-09 README test
167 ```
168 Adds all items in the list to the heap, as if by repeated calls to
169 ADD-TO-HEAP. ADD-ALL-TO-HEAP can often be implemented more
170 efficiently, though, than by merely executing consecutive calls to
171 ADD-TO-HEAP directly. Returns the heap object.
87f8f973 » rneeser
2009-03-24 Initial import.
172
73ec41f0 »
2012-06-09 README test
173 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
174 (PEEP-AT-HEAP heap)
73ec41f0 »
2012-06-09 README test
175 ```
176 Returns the minimum item in the heap, without modifying the heap.
87f8f973 » rneeser
2009-03-24 Initial import.
177
73ec41f0 »
2012-06-09 README test
178 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
179 (POP-HEAP heap)
73ec41f0 »
2012-06-09 README test
180 ```
181 Removes the smallest item in the heap, and returns it.
87f8f973 » rneeser
2009-03-24 Initial import.
182
73ec41f0 »
2012-06-09 README test
183 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
184 (MERGE-HEAPS first second)
73ec41f0 »
2012-06-09 README test
185 ```
186 Returns a new heap which contains all the items in both heaps. Only
187 heaps which use the same HEAP-KEY and HEAP-SORTING-FUNCTION can be
188 merged, otherwise a HEAP-ERROR is signalled.
87f8f973 » rneeser
2009-03-24 Initial import.
189
73ec41f0 »
2012-06-09 README test
190 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
191 (NMERGE-HEAPS first second)
73ec41f0 »
2012-06-09 README test
192 ```
193 Destructively creates a new heap which contains the items in both
194 heaps. Only heaps which use the same HEAP-KEY and
195 HEAP-SORTING-FUNCTION can be merged, otherwise a HEAP-ERROR is
196 signalled.
87f8f973 » rneeser
2009-03-24 Initial import.
197
73ec41f0 »
2012-06-09 README test
198 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
199 (DECREASE-KEY heap item-index value)
73ec41f0 »
2012-06-09 README test
200 ```
201 Allows you to specify an item in the heap whose value should be
202 decreased. ITEM-INDEX is the second value returned by ADD-TO-HEAP, and
203 VALUE should be smaller than the items current value, or a KEY-ERROR
204 will be signalled. Returns the heap. See below for an example.
87f8f973 » rneeser
2009-03-24 Initial import.
205
73ec41f0 »
2012-06-09 README test
206 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
207 (DELETE-FROM-HEAP heap item-index)
73ec41f0 »
2012-06-09 README test
208 ```
209 Allows you to specify an arbitrary item to remove from the
210 heap. ITEM-INDEX is the second value returned by ADD-TO-HEAP.
87f8f973 » rneeser
2009-03-24 Initial import.
211
212 DECREASE-KEY requires that HEAP-KEY is either the function IDENTITY,
213 or a function that accepts an optional second argument, which will be
214 the value of the new key. For instance, if the elements in the heap
215 are lists, and they are to be sorted by the first element in the list,
216 an appropriate HEAP-KEY could be:
217
73ec41f0 »
2012-06-09 README test
218 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
219 (lambda (item &optional new-value)
220 (if new-value
221 (setf (first item) new-value)
222 (first item)))
73ec41f0 »
2012-06-09 README test
223 ```
224
87f8f973 » rneeser
2009-03-24 Initial import.
225 Of course, if DECREASE-KEY is not going to be used, then #'first
226 itself could simply be used as the HEAP-KEY.
227
228
78824d05 »
2012-06-09 README updates.
229 The BINARY-HEAP Class
230 ---------------------
87f8f973 » rneeser
2009-03-24 Initial import.
231
232 BINARY-HEAP is constructed in the typical fashion, using an array. The
233 BINARY-HEAP MAKE-INSTANCE call accepts an extra argument, :size, which
234 sets the data array's initial size.
235
236 Note that DECREASE-KEY and DELETE-FROM-HEAP are not very useful
237 operations on this heap: while they work, the required index-keys may
238 be invalidated as soon as any heap operation is performed. If you do
239 want to make use of DELETE-FROM-HEAP or DECREASE-KEY, consider using
240 FIBONACCI-HEAP instead.
241
242 BINARY-HEAP provides an extra function to the above API:
243
73ec41f0 »
2012-06-09 README test
244 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
245 (BINARY-HEAP-EXTENSION-FACTOR heap)
73ec41f0 »
2012-06-09 README test
246 ```
247 The percentage at which the space allocated for data in the heap
248 should grow at once that space has been exceeded. This defaults to 50.
87f8f973 » rneeser
2009-03-24 Initial import.
249
250 Here are the Big-Oh running times for the heap API, where n and m are
251 the sizes of various heaps.
252
73ec41f0 »
2012-06-09 README test
253 ```lisp
52d13149 »
2012-06-09 README.md complete.
254 (HEAP-SIZE heap) => O(1)
87f8f973 » rneeser
2009-03-24 Initial import.
255
52d13149 »
2012-06-09 README.md complete.
256 (EMPTY-HEAP heap) => O(1)
87f8f973 » rneeser
2009-03-24 Initial import.
257
52d13149 »
2012-06-09 README.md complete.
258 (IS-EMPTY-HEAP-P heap) => O(1)
87f8f973 » rneeser
2009-03-24 Initial import.
259
52d13149 »
2012-06-09 README.md complete.
260 (ADD-TO-HEAP heap item) => O(log(n))
87f8f973 » rneeser
2009-03-24 Initial import.
261
52d13149 »
2012-06-09 README.md complete.
262 (ADD-ALL-TO-HEAP heap items) => O(n)
87f8f973 » rneeser
2009-03-24 Initial import.
263
52d13149 »
2012-06-09 README.md complete.
264 (PEEP-AT-HEAP heap) => O(1)
87f8f973 » rneeser
2009-03-24 Initial import.
265
52d13149 »
2012-06-09 README.md complete.
266 (POP-HEAP heap) => O(log(n))
87f8f973 » rneeser
2009-03-24 Initial import.
267
52d13149 »
2012-06-09 README.md complete.
268 (MERGE-HEAPS first second) => O(n + m + log(n + m))
87f8f973 » rneeser
2009-03-24 Initial import.
269
52d13149 »
2012-06-09 README.md complete.
270 (NMERGE-HEAPS first second) => O(m + log(n + m))
87f8f973 » rneeser
2009-03-24 Initial import.
271
52d13149 »
2012-06-09 README.md complete.
272 (DECREASE-KEY heap item-index value) => O(log(n))
87f8f973 » rneeser
2009-03-24 Initial import.
273
52d13149 »
2012-06-09 README.md complete.
274 (DELETE-FROM-HEAP heap item-index) => O(log(n))
73ec41f0 »
2012-06-09 README test
275 ```
87f8f973 » rneeser
2009-03-24 Initial import.
276
277
78824d05 »
2012-06-09 README updates.
278 The FIBONACCI-HEAP Class
279 ------------------------
87f8f973 » rneeser
2009-03-24 Initial import.
280
281 The details of the Fibonacci heap are given in "Fibonacci Heaps and
282 Their Uses in Improved Network Optimization Algorithms", by Fredman
283 and Tarjan (see references below).
284
285 The Fibonacci heap has some interesting time constraints, and should
286 generally be used instead of BINARY-HEAP.
287
288 Here are the Big-Oh running times for the heap API, where n and m are
289 the sizes of various heaps.
290
73ec41f0 »
2012-06-09 README test
291 ```lisp
52d13149 »
2012-06-09 README.md complete.
292 (HEAP-SIZE heap) => O(1)
87f8f973 » rneeser
2009-03-24 Initial import.
293
52d13149 »
2012-06-09 README.md complete.
294 (EMPTY-HEAP heap) => O(1)
87f8f973 » rneeser
2009-03-24 Initial import.
295
52d13149 »
2012-06-09 README.md complete.
296 (IS-EMPTY-HEAP-P heap) => O(1)
87f8f973 » rneeser
2009-03-24 Initial import.
297
52d13149 »
2012-06-09 README.md complete.
298 (ADD-TO-HEAP heap item) => O(1)
87f8f973 » rneeser
2009-03-24 Initial import.
299
52d13149 »
2012-06-09 README.md complete.
300 (ADD-ALL-TO-HEAP heap items) => O(n)
87f8f973 » rneeser
2009-03-24 Initial import.
301
52d13149 »
2012-06-09 README.md complete.
302 (PEEP-AT-HEAP heap) => O(1)
87f8f973 » rneeser
2009-03-24 Initial import.
303
52d13149 »
2012-06-09 README.md complete.
304 (POP-HEAP heap) => amortised O(log(n))
87f8f973 » rneeser
2009-03-24 Initial import.
305
52d13149 »
2012-06-09 README.md complete.
306 (MERGE-HEAPS first second) => O(m + n)
87f8f973 » rneeser
2009-03-24 Initial import.
307
52d13149 »
2012-06-09 README.md complete.
308 (NMERGE-HEAPS first second) => O(1)
87f8f973 » rneeser
2009-03-24 Initial import.
309
52d13149 »
2012-06-09 README.md complete.
310 (DECREASE-KEY heap item-index value) => amortised O(1)
87f8f973 » rneeser
2009-03-24 Initial import.
311
52d13149 »
2012-06-09 README.md complete.
312 (DELETE-FROM-HEAP heap item-index) => amortised O(1), except where
313 the deleted item was the minimum
314 item, in which case it is
315 amortised O(log(n))
73ec41f0 »
2012-06-09 README test
316 ```
87f8f973 » rneeser
2009-03-24 Initial import.
317
78824d05 »
2012-06-09 README updates.
318 Examples of Use
319 ---------------
87f8f973 » rneeser
2009-03-24 Initial import.
320
321 A heap can be created quite simply:
322
73ec41f0 »
2012-06-09 README test
323 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
324 (defparameter *heap* (make-instance 'cl-heap:fibonacci-heap))
73ec41f0 »
2012-06-09 README test
325 ```
87f8f973 » rneeser
2009-03-24 Initial import.
326
fb03e807 »
2012-06-09 README test
327 This will create a heap where the elements are ordered using #'<.
328 Elements can be added one at a time using ADD-TO-HEAP:
87f8f973 » rneeser
2009-03-24 Initial import.
329
73ec41f0 »
2012-06-09 README test
330 ```lisp
331 (cl-heap:add-to-heap *heap* 1)
332 ```
87f8f973 » rneeser
2009-03-24 Initial import.
333
334 or, in a batch.
335
73ec41f0 »
2012-06-09 README test
336 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
337 (cl-heap:add-all-to-heap *heap* '(6 4 7 3 2 0))
73ec41f0 »
2012-06-09 README test
338 ```
87f8f973 » rneeser
2009-03-24 Initial import.
339
340 The minimum item in this heap can easily by seen using PEEP-AT-HEEP,
341 which will not modify the heap in any way:
342
73ec41f0 »
2012-06-09 README test
343 ```lisp
52d13149 »
2012-06-09 README.md complete.
344 (cl-heap:peep-at-heap *heap*) => 0
73ec41f0 »
2012-06-09 README test
345 ```
87f8f973 » rneeser
2009-03-24 Initial import.
346
347 The minimum item can be removed from the heap using POP-HEAP:
348
73ec41f0 »
2012-06-09 README test
349 ```lisp
52d13149 »
2012-06-09 README.md complete.
350 (cl-heap:pop-heap *heap*) => 0
73ec41f0 »
2012-06-09 README test
351 ```
87f8f973 » rneeser
2009-03-24 Initial import.
352
353 Heaps can be used to sort items:
354
73ec41f0 »
2012-06-09 README test
355 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
356 (let ((heap (make-instance 'cl-heap:fibonacci-heap)))
357 (cl-heap:add-all-to-heap heap (loop for i from 1 upto 10 collect (random 100)))
358 (loop while (not (cl-heap:is-empty-heap-p heap)) collect (cl-heap:pop-heap heap)))
359
52d13149 »
2012-06-09 README.md complete.
360 => (14 19 30 32 38 64 74 90 96 98)
73ec41f0 »
2012-06-09 README test
361 ```
87f8f973 » rneeser
2009-03-24 Initial import.
362
363 A max-heap can be constructed as follows:
364
73ec41f0 »
2012-06-09 README test
365 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
366 (defparameter *heap* (make-instance 'cl-heap:fibonacci-heap :sort-fun #'>))
73ec41f0 »
2012-06-09 README test
367 ```
87f8f973 » rneeser
2009-03-24 Initial import.
368
369 And this will order things from most to least:
370
73ec41f0 »
2012-06-09 README test
371 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
372 (let ((heap (make-instance 'cl-heap:fibonacci-heap :sort-fun #'>)))
373 (cl-heap:add-all-to-heap heap (loop for i from 1 upto 10 collect (random 100)))
374 (loop while (not (cl-heap:is-empty-heap-p heap)) collect (cl-heap:pop-heap heap)))
375
52d13149 »
2012-06-09 README.md complete.
376 => (69 68 64 60 37 34 30 7 6 1)
73ec41f0 »
2012-06-09 README test
377 ```
87f8f973 » rneeser
2009-03-24 Initial import.
378
379 The heaps can contain arbitrary items. For instance, a heap whose
380 elements are all lists can be constructed as follows:
381
73ec41f0 »
2012-06-09 README test
382 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
383 (defparameter *heap* (make-instance 'cl-heap:fibonacci-heap :key #'first))
384 (cl-heap:add-to-heap *heap* (list 5 'some 'arbitrary 'data))
385 (cl-heap:add-to-heap *heap* (list 4 'other 'data))
386 (cl-heap:pop-heap *heap*) => (4 other data)
73ec41f0 »
2012-06-09 README test
387 ```
87f8f973 » rneeser
2009-03-24 Initial import.
388
389 DECREASE-KEY and DELETE-FROM-HEAP can be used as follows:
390
73ec41f0 »
2012-06-09 README test
391 ```lisp
87f8f973 » rneeser
2009-03-24 Initial import.
392 (defparameter *heap* (make-instance 'cl-heap:fibonacci-heap))
393 (cl-heap:add-all-to-heap *heap* '(5 3 4 2 1))
394 (let ((item-index (second (multiple-value-list (cl-heap:add-to-heap *heap* 10)))))
395 (format t "Smallest item: ~A~%" (cl-heap:peep-at-heap *heap*))
396 (cl-heap:decrease-key *heap* item-index 0)
397 (format t "Smallest item: ~A~%" (cl-heap:peep-at-heap *heap*)))
398
52d13149 »
2012-06-09 README.md complete.
399 => nil
400 Smallest item: 1
401 Smallest item: 0
73ec41f0 »
2012-06-09 README test
402 ```
87f8f973 » rneeser
2009-03-24 Initial import.
403
78824d05 »
2012-06-09 README updates.
404 License
405 -------
87f8f973 » rneeser
2009-03-24 Initial import.
406
407 CL-HEAP is free software: you can redistribute it and/or modify it
408 under the terms of the GNU General Public License as published by the
409 Free Software Foundation, either version 3 of the License, or (at your
410 option) any later version.
411
412 This program is distributed in the hope that it will be useful,
413 but WITHOUT ANY WARRANTY; without even the implied warranty of
414 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
415 GNU General Public License for more details.
416
417 You should have received a copy of the GNU General Public License
418 along with this program. If not, see <http://www.gnu.org/licenses/>.
419
420
78824d05 »
2012-06-09 README updates.
421 References
422 ----------
87f8f973 » rneeser
2009-03-24 Initial import.
423
424 M. L. Fredman and R. E. Tarjan. 1987. "Fibonacci Heaps and Their Uses
425 in Improved Network Optimizxation Algorithms". Journal of the
426 Association for Computing Machinery, Vol 34, No 3. pp 596 - 615
Something went wrong with that request. Please try again.