The principal form of representation of the similarity between nucleotide or amino acid sequences whereby nucleotides or amino acids inferred to have been derived from the same ancestral residue are superimposed. Identical or similar (in the case of amino acid sequences) residues are typically marked in an alignment. A pairwise alignment consists of two aligned sequences; pairwise alignments are typically produced as the output of a database search. A multiple alignment consists of three or more aligned sequences. In a global alignment, sequences are aligned in their entirety, whereas a local alignment consists of aligned subsequences. The optimal (global or local) alignment of two sequences is the alignment with the highest score under a given scoring system, which is least likely to be found by chance; optimal alignment algorithms for multiple sequences are currently not feasible. Structural alignment is a sequence alignment produced by superposition of the three-dimensional structures of the respective proteins; structural alignments are generally thought to be the most accurate form of alignment.