In this paper we present three algorithms that solve three combinatorial optimization problems related to each other. One of them is the patience sorting game, invented as a practical method of sorting real decks of cards. The second problem is computing the longest monotone increasing subsequence of the given sequence of n positive integers in the range 1,...,n. The third problem is to enumerate all the longest monotone increasing subsequences of the given permutation.