Abstract
The queueing-glueing algorithm is the nickname we give to an algorithmic pattern that provides amortised linear time solutions to a number of optimal list partition problems that have a peculiar property: at various moments we know that two of three candidate solutions could be optimal. The algorithm works by keeping a queue of lists, glueing them from one end, while chopping from the other end, hence the name. We give a formal derivation of the algorithm, and demonstrate it with several non-trivial examples.
- R. C. Backhouse. Galois connections and fixed point calculus. In R. C. Backhouse, R. Crole, and J. Gibbons, editors, Algebraic and Coalgebraic Methods in the Mathematics of Program Construction, pages 89– 148. Springer-Verlag, 2002. Google Scholar
Digital Library
- R. S. Bird. Transformational programming and the paragraph problem. Science of Computer Programming, 6(2):159–189, 1986. Google Scholar
Digital Library
- R. S. Bird. Algebraic identities for program calculation. Computer Journal, 32(2):122–126, April 1989. Google Scholar
Digital Library
- P. Brucker. Efficient algorithms for some path partitioning problems. Discrete Applied Mathematics, 62(1-3):77–85, 1995. Google Scholar
Digital Library
- K.-M. Chung and H.-I. Lu. An optimal algorithm for the maximum-density segment problem. SIAM Journal on Computing, 34(2):373–387, 2004. Google Scholar
Digital Library
- S. Curtis and S.-C. Mu. Calculating a linear-time solution to the densestsegment problem. Journal of Functional Programming, 25, 2015.Google Scholar
- O. de Moor and J. Gibbons. Bridging the algorithm gap: A linear-time functional program for paragraph formatting. Science of Computer Programming, 35(1):3–27, 1999. Google Scholar
Digital Library
- Z. Galil and K. Park. Dynamic programming with convexity, concavity and sparsity. Theoretical Computer Science, 92(1):49–76, January 1992. Google Scholar
Digital Library
- M. H. Goldwasser, M.-Y. Kao, and H.-I. Lu. Linear-time algorithms for computing maximum-density sequence segments with bioinformatics applications. Journal of Computer and System Sciences, 70(2):128–144, 2005. Google Scholar
Digital Library
- R. Hinze and R. Paterson. Finger trees: a simple general-purpose data structure. Journal of Functional Programming, 16(2):197–217, 2006. Google Scholar
Digital Library
- D. S. Hirschberg and L. L. Larmore. The least weight subsequence problem. SIAM Journal on Computing, 16(4):628–638, 1987. Google Scholar
Digital Library
- R. J. M. Hughes. A novel representation of lists and its application to the function “reverse”. Information Processing Letters, 22:141–144, 1986. Google Scholar
Digital Library
- D. E. Knuth and M. F. Plass. Breaking paragraphs into lines. Software – Practice and Experience, 11(11):1119–1184, 1981.Google Scholar
- C. Okasaki. Purely Functional Data Structures. Cambridge University Press, 1999. Google Scholar
Digital Library
- S. van Hoesel, A. Wagelmans, and B. Moerman. Using geometric techniques to improve dynamic programming algorithms for the economic lot-sizing problem and extensions. European Journal of Operational Research, 75(2):312–331, 1994.Google Scholar
Cross Ref
Index Terms
Queueing and glueing for optimal partitioning (functional pearl)
Recommendations
Queueing and glueing for optimal partitioning (functional pearl)
ICFP 2016: Proceedings of the 21st ACM SIGPLAN International Conference on Functional ProgrammingThe queueing-glueing algorithm is the nickname we give to an algorithmic pattern that provides amortised linear time solutions to a number of optimal list partition problems that have a peculiar property: at various moments we know that two of three ...
Solution of continuous problems of optimal covering with spheres using optimal set-partition theory
The paper considers a continuous problem of optimal c-sphere covering of a compact set from from E n with a given number of spheres of minimum radius and a problem of covering a set with the minimum number of spheres of given radius. Algorithms ...
Optimum Bribing for Queue Position
In this paper we consider that relative position in queue is determined according to the size of a customer's bribe which is paid before the customer sees the queue length. Such a policy allows the customer himself to affect his own queue position, ...







Comments