Home

AGGTAB

AGGTAB is a six-character string used in computer science as a standard example input for the Longest Common Subsequence (LCS) problem. The characters are A, G, G, T, A, B. It is commonly paired with the second string GXTXAYB in teaching materials to illustrate dynamic programming solutions for LCS. In this widely cited example, the LCS of AGGTAB and GXTXAYB has length 4, with one possible longest subsequence being GTAB.

The example serves to demonstrate how to construct and fill a two-dimensional dynamic programming table and

AGGTAB is referenced in textbooks and online resources as a concise, concrete illustration of LCS computation,

to
introduce
the
recurrence
relations
used
in
LCS:
if
X[i]
==
Y[j],
LCS(i,j)
=
LCS(i-1,j-1)
+
1;
otherwise,
LCS(i,j)
=
max(LCS(i-1,j),
LCS(i,j-1)).
illustrating
concepts
such
as
overlapping
subproblems
and
optimal
substructure
that
underpin
dynamic
programming
solutions.