A greedy algorithm for dropping digits (Functional Pearl)

01/24/2021
by   Richard Bird, et al.
0

Consider the puzzle: given a number, remove k digits such that the resulting number is as large as possible. Various techniques were employed to derive a linear-time solution to the puzzle: predicate logic was used to justify the structure of a greedy algorithm, a dependently-typed proof assistant was used to give a constructive proof of the greedy condition, and equational reasoning was used to calculate the greedy step as well as the final, linear-time optimisation.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/26/2019

A New Linear Time Correctness Condition for Multiplicative Linear Logic

In this paper, we give a new linear time correctness condition for proof...
research
09/13/2021

The inverse of Ackermann function is computable in linear time

We propose a detailed proof of the fact that the inverse of Ackermann fu...
research
02/14/2020

On the Edge Crossings of the Greedy Spanner

t-spanners are used to approximate the pairwise distances between a set ...
research
07/14/2020

Graph Sparsification by Universal Greedy Algorithms

Graph sparsification is to approximate an arbitrary graph by a sparse gr...
research
02/06/2018

How to select the best set of ads: Can we do better than Greedy Algorithm?

Selecting the best set of ads is critical for advertisers for a given se...
research
05/04/2023

Convergence to Lexicographically Optimal Base in a (Contra)Polymatroid and Applications to Densest Subgraph and Tree Packing

Boob et al. [1] described an iterative peeling algorithm called Greedy++...
research
10/15/2019

Comparing Greedy Constructive Heuristic Subtour Elimination Methods for the Traveling Salesman Problem

This paper further defines the class of fragment constructive heuristics...

Please sign up or login with your details

Forgot password? Click here to reset