Traceback turns the filled global alignment matrix into one optimal end-to-end alignment.
highlighted = computed this step
Traceback walks from corner to origin
After the matrix is filled, traceback starts at the bottom-right cell and walks back to the origin, choosing the neighbour that each cell came from.
corner⟶origin
The path is the alignment
A diagonal step aligns two bases. A step along an edge puts a gap in one row. Reading those choices forward gives GCATGC aligned with GCA-GC.
GCATGC↔GCA-GC
Traceback can choose among ties
Many co-optimal alignments can share the same score. This lesson shows one deterministic traceback: it tries the diagonal move first, then the upper move, then the left move.