Increasing subsequence
ID: increasing-subsequence
An increasing subsequence of a finite sequence in a totally ordered set selects indices such thatHere “increasing” means weakly increasing, also called nondecreasing: equal values are allowed, but indices must increase strictly. This is the convention of [ref]
https://cs.carleton.edu/faculty/dlibenno/papers/lis-lcs/lislcs.pdf. Liben-Nowell, Vee and Zhu, Finding Longest Increasing and Common Subsequences in Streaming Data, section 1
. A strictly increasing subsequence instead requires . Always check which convention an algorithm uses, especially when values repeat.An increasing subsequence may skip positions; it neither rearranges values nor requires consecutive positions. Consider the deliberately constructed exampleThe indices select , an increasing subsequence of length four. The indices select , a strictly increasing subsequence of length three. In contrast, rearranges the input and is not a subsequence. The longest consecutive nondecreasing block is , of length three; requiring consecutive positions would therefore solve a different problem.
Think of an increasing subsequence as preserving ordered observations while skipping interruptions. For the example, discarding leaves four observations with no downward step. The longest increasing subsequence asks how much of the original order can be kept. This is an order comparison, rather than a claim about the size of upward or downward changes: replacing all values by their squares when the values are nonnegative leaves every allowed selection unchanged. More generally, any strictly order-preserving relabeling has this property.
New to topics? Read the docs here!