## Between Dynamic Programming and Greedy: Data Compression (1995)

Venue: | Programming Research Group, 11 Keble Road, Oxford OX1 3QD |

Citations: | 5 - 0 self |

### BibTeX

@INPROCEEDINGS{Bird95betweendynamic,

author = {Richard S. Bird and Oege De Moor},

title = {Between Dynamic Programming and Greedy: Data Compression},

booktitle = {Programming Research Group, 11 Keble Road, Oxford OX1 3QD},

year = {1995}

}

### OpenURL

### Abstract

The derivation of certain algorithms can be seen as a hybrid form of dynamic programming and the greedy paradigm. We present a generic theorem about such algorithms, and show how it can be applied to the derivation of an algorithm for data compression. 1 Introduction Dynamic programming is a technique for solving optimisation problems. A typical dynamic programming algorithm proceeds by decomposing the input in all possible ways, recursively solving the subproblems, and combining optimal solutions to subproblems into an optimal solution for the whole problem. The greedy paradigm is also a technique for solving optimisation problems and differs from dynamic programming in that only one decomposition of the input is considered. Such a decomposition is usually chosen to maximise some objective function, and this explains the term `greedy'. In our earlier work, we have characterised the use of dynamic programming and the greedy paradigm, using the categorical calculus of relations to der...

### Citations

509 |
Programming from Specifications
- Morgan
(Show Context)
Citation Context ...an the domain of T , we cannot use G to obtain a computer program that implements T . The situation is analogous to the use of `miracles' in the refinement calculus studied by Back, Morgan and others =-=[2, 21]-=-. Before turning to the proof of this theorem, let us remark that the Dynamic Programming Theorem is a special case of the Hybrid Theorem. If we take S = 1, then S is well-supported, S \Delta Q ` Q \D... |

448 |
Introduction to higher order categorical logic, volume 7 of Camb
- Lambek, Scott
- 1986
(Show Context)
Citation Context ... concepts that are beyond the scope of this paper. It is, in fact, similar to the proof of Lawvere's recursion theorem for natural numbers in a cartesian closed category. More details can be found in =-=[16]-=-. The partial function Init takes a string and removes the last element. It is defined by Init = outl \Delta snoc ffi ; In fact, this defines two functions: one for strings and one for words. Using th... |

153 |
A calculus of refinements for program derivations
- Back
- 1988
(Show Context)
Citation Context ...nformally, aTb holds provided aRb and whenever a and b are equivalent in R, we have aSb. 18 As an example, take R to be the length order on finite sequences, and define S to be the sum order. We have =-=[1; 2; 3] (mnl-=-(R " (R ffi ) S ))) f [1; 2; 3]; [1; 1; 1; 1]; [4; 5; 6; 7]; [3; 4; 5]; [5; 6; 8] g: 4 Theorems for paradigms As explained in the introduction, our aim is to provide concise theorems that capture... |

106 |
Data Compression via Textual Substitution
- Storer, Szymanski
- 1982
(Show Context)
Citation Context ...d greedy in that they consider multiple (but not necessarily all) decompositions of the input. Our motivating example is a method for data compression that was first suggested by Storer and Szymanski =-=[23]-=-. This example is explained in Section 2. We then proceed to introduce the categorical calculus of relations in 1 Section 3. In Section 4, we review our earlier results about dynamic programming and g... |

93 | Memo functions and machine learning - Michie - 1968 |

89 | Transducers and repetitions
- Crochemore
- 1986
(Show Context)
Citation Context ...lises this data structure, and Append inserts a new symbol. We shall not go into the details of the algorithm for computing Mrt . An elegant solution may be found in Crochemore's paper on repetitions =-=[11]-=-. 6 Discussion This paper presented an experiment in the algebra of optimisation. We have applied our earlier work to a significant example, carrying out the proofs in minute detail. Although the deri... |

40 |
Logic and Computation
- Paulson
- 1987
(Show Context)
Citation Context ...ient way of communicating formal proofs, namely by means of proof tactics instead of proof steps. There is a great deal of work available on proof tactics in connection with automatic theorem proving =-=[22]-=-, and we foresee no difficulties in taking advantage of that work. Note, however, that our motivation comes from a concern with effective communication, and not from a desire to automate the derivatio... |

27 |
Bicategories of spans and relations
- Carboni, Kasangian, et al.
- 1984
(Show Context)
Citation Context ...ion if and only if there exists a relation S : B / A such that R \Delta S ` 1 and 1 ` S \Delta R. Furthermore, if S satisfies these inequations, then S = R ffi . A proof of this lemma may be found in =-=[8]-=-. Another important property is the fact that every relation can be factorised into two functions: Lemma 3 Let R : A / B in Rel . Then there exists functions f : A / C and g : B / C such that R = f \D... |

26 |
Introduction to Operations Research
- Ecker, Kupferschmid
- 1988
(Show Context)
Citation Context ...vide concise theorems that capture the use of common paradigms in algorithm design. This pursuit is not new; it is one of the driving forces in combinatorial optimisation [14] and operations research =-=[12]-=-. Our approach differs from earlier work in the style of presentation in that we seek to express and derive results in a formal calculus. The research effort is still very much in its infancy, and so ... |

25 |
der Woude. A relational theory of datatypes
- Aarts, Backhouse, et al.
- 1992
(Show Context)
Citation Context ...aw R \Delta S " T ` (R " T \Delta S ffi ) \Delta S to prove the desired inequation. There are many equivalent formulations of the modular law, and a discussion of various alternatives can be=-= found in [3]-=-. For our purposes the above form seems to be the most convenient. We shall discuss an application of the modular law below. A preorder is a relation R : A / A that is reflexive and transitive: 1 ` R ... |

23 | About charity
- Cockett, Fukushima
- 1992
(Show Context)
Citation Context ...ocP(Codes[I],Pos,Len) END; I := I + 1; Read(A); END; EmitCodes(Codes,I) END Compact. Figure 1: Modula 2 program for data compression. 30 namely the research in categorical programming languages (e.g. =-=[10]-=-). So far, however, that work has been confined to a strictly functional setting. Also, it does not incorporate pragmatic concepts like memoisation [18], which will be essential in our applications. R... |

16 | Galois connections presented calculationally
- Aarts
(Show Context)
Citation Context ... All such equivalences are instances of the more abstract concept of a Galois connection. A particularly readable introduction, which explains the applications to relations, is Aarts' Master's thesis =-=[1]-=-. Here we restrict ourselves to some more examples that will be useful in the sequel. The join of two relations is dual to the meet. It is defined by the universal property (R [ S ) ` T j (R ` T )s(S ... |

14 | From dynamic programming to greedy algorithms
- Bird, Moor
- 1993
(Show Context)
Citation Context ...plains the term `greedy'. In our earlier work, we have characterised the use of dynamic programming and the greedy paradigm, using the categorical calculus of relations to derive two general theorems =-=[4, 5, 19]-=-. Briefly, these theorems say that dynamic programming is applicable if a certain monotonicity condition is satisfied. If an additional monotonicity property holds, then the choice of decompositions c... |

13 |
A 2-categorical approach to geometric morphisms
- Carboni, Kelly, et al.
- 1991
(Show Context)
Citation Context ... Yet, it is important to know in what sense hR; S i is unique, and what algebraic identities can be used in reasoning about it. A nice solution to this problem was proposed by Carboni, Kelly and Wood =-=[9]-=-. They define constructions like products at the functional level, and then show how these can be extended to arbitrary relations in some canonical way. The key step is to show how functors Fun / Fun ... |

12 | O.: Solving optimisation problems with catamorphism
- Bird, Moor
- 1992
(Show Context)
Citation Context ...plains the term `greedy'. In our earlier work, we have characterised the use of dynamic programming and the greedy paradigm, using the categorical calculus of relations to derive two general theorems =-=[4, 5, 19]-=-. Briefly, these theorems say that dynamic programming is applicable if a certain monotonicity condition is satisfied. If an additional monotonicity property holds, then the choice of decompositions c... |

9 |
Categories, relations and dynamic programming. D.Phil. thesis
- Moor
- 1992
(Show Context)
Citation Context ...plains the term `greedy'. In our earlier work, we have characterised the use of dynamic programming and the greedy paradigm, using the categorical calculus of relations to derive two general theorems =-=[4, 5, 19]-=-. Briefly, these theorems say that dynamic programming is applicable if a certain monotonicity condition is satisfied. If an additional monotonicity property holds, then the choice of decompositions c... |

9 | Inductive data types for predicate transformers
- Moor
- 1992
(Show Context)
Citation Context ...to their defining property by the hint cata. Lemma 7 Let F : Fun / Fun be a relator with an initial algebra ff. Then ff is also an initial algebra of F : Rel / Rel . A proof of this lemma is given in =-=[20]-=-. 3.5 Sequences To illustrate functors and catamorphisms we will consider three kinds of sequences that play a crucial role in the data compression example. The data type of strings can be defined in ... |

6 |
The principle of optimality in the design of efficient algorithms
- Helman
- 1986
(Show Context)
Citation Context ...troduction, our aim is to provide concise theorems that capture the use of common paradigms in algorithm design. This pursuit is not new; it is one of the driving forces in combinatorial optimisation =-=[14]-=- and operations research [12]. Our approach differs from earlier work in the style of presentation in that we seek to express and derive results in a formal calculus. The research effort is still very... |

4 |
Local Adjunctions
- Jay
- 1988
(Show Context)
Citation Context ...y replaced by inclusion. The situation is not specific to products: it can be shown that any adjunction at the functional level extends to a so-called local adjunction between categories of relations =-=[15]-=-. The coproduct functor (+) is also a relator, and its extension is dual to that of the product functor: (R + S ) = (inl \Delta R \Delta inl ffi ) [ (inr \Delta S \Delta inr ffi ); 10 where inl and in... |

1 |
User's guide for the diagram macros
- Borceux
- 1990
(Show Context)
Citation Context ... original size. While this is already quite acceptable, it does even better on files that contain a lot of repetitions: the source of Francis Borceux's macro package for drawing diagrams in L a T E X =-=[6]-=- is reduced to 17% of its original size. By comparison, the Unix utility compress only achieves a reduction of 28% on the same file. More detailed figures on the performance of the algorithm can be fo... |

1 |
Order and Recursion in Topoi, volume 9
- Brook
- 1977
(Show Context)
Citation Context ...cates, one could write this as follows: a(min R)x = (a 2 x )s(8b : b 2 x ) aRb): The definition of min and its algebraic properties were first studied in the context of categorical relations by Brook =-=[7]-=-. 16 The above rule for min R gives an expression in terms of meet and division, both of which have been defined by means of a universal property. The following rule exploits that fact, and it gives a... |

1 |
Paramorphisms. To appear
- Meertens
- 1990
(Show Context)
Citation Context ...ique homomorphism from ff to f will be denoted by ([f ]). In formulae, we have the universal property h = ([f ]) j h \Delta ff = f \Delta Fh: Homomorphisms of the form ([f ]) are called catamorphisms =-=[17]-=-. In later calculations, we shall refer to their defining property by the hint cata. Lemma 7 Let F : Fun / Fun be a relator with an initial algebra ff. Then ff is also an initial algebra of F : Rel / ... |