Skip to main content

Algorithm Design with the Selection Monad

Johannes Hartmann and Jeremy Gibbons

Abstract

The selection monad has proven useful for modelling exhaustive search algorithms. It is well studied in the area of game theory as an elegant way of expressing algorithms that calculate optimal plays for sequential games with perfect information; composition of moves is modeled as a ‘product’ of selection functions. This paper aims to expand the application of the selection monad to other classes of algorithms. The structure used to describe exhaustive search problems can easily be applied to greedy algorithms; with some changes to the product function, the behaviour of the selection monad can be changed from an exhaustive search behaviour to a greedy one. This enables an algorithm design framework in which the behaviour of the algorithm can be exchanged modularly by using different product functions.

Book Title
Trends in Functional Programming
ISBN
978−3−031−21314−4
Journal
Trends in Functional Programming: 23rd International Symposium‚ TFP 2022‚ Virtual Event‚ March 17–18‚ 2022‚ Revised Selected Papers
Month
January
Pages
126−143
Publisher
Springer International Publishing
Year
2023