Friday, July 17, 2026
SAVED POSTS
  • Login
  • Register
RathBiotaClan
No Result
View All Result
  • HOME
  • HEALTH SCIENCE

    TRENDING ON HEALTH (TOP)

    Fick Method Underestimates Heart Problems in Children After Heart Transplant, Study Finds

    For Women on Antidepressants, Creatine Showed a Possible Extra Boost

    Did the iPhone Quietly Reshape When and Whether Americans Have Children?

    For People Antidepressants Never Helped, a 30-Minute Home Session Is Now FDA-Approved

    NOW ON AIR (RBC)

    The parsimony criterion
    BIOINFORMATICS

    The Parsimony Criterion in Phylogenetics: Morphological & Molecular Methods

    July 15, 2026
    maximum-likelihood-criterion
    BIOINFORMATICS

    Maximum Likelihood Criterion in Phylogenetic Tree Reconstruction

    July 15, 2026
    Tree Optimization Criteria and Search Methods in Phylogenetics – NNI, SPR, TBR Explained
    BIOINFORMATICS

    Tree Optimization Criteria and Tree Search Methods in Phylogenetics

    July 15, 2026
    Bootstrapping in Phylogenetics
    BIOINFORMATICS

    Bootstrapping in Phylogenetics – Tree Reliability, Resampling & Bootstrap Values

    July 15, 2026
  • NEUROSCIENCE
    • PHYSIOLOGY
    • IMMUNOLOGY
    • CANCER
  • DISCOVERIES
    • SPOTLIGHTS
    • STUDENT PORTAL
    • SCIENCE FEATURED
  • MOLECULAR BIOLOGY
    • GENETICS
    • BIOTECHNOLOGY
    • BIOINFORMATICS
    • BIOCHEMISTRY
    • BIOPHYSICS
  • ZOOLOGY & ECOLOGY
    • ENVIRONMENTAL SCIENCE
    • ECOLOGY
    • EVOLUTION
  • MICRO & PLANT SCIENCE
    • MICROBIOLOGY
    • CELL BIOLOGY
    • DEVELOPMENTAL BIOLOGY
  • PSYCHOLOGY
RathBiotaClan
RathBiotaClan
No Result
View All Result
Home BIOINFORMATICS

The Edit Distance Between Two Strings Alignment

Shibasis Rath by Shibasis Rath
July 2, 2026
in BIOINFORMATICS, STUDENT PORTAL
Reading Time: 7 mins read
0
A A
0

Comparing two strings and measuring how different or similar they are is a fundamental problem in computer science, with applications in evolutionary and structural biology, textual database retrieval, and spelling correction. Among the various ways of formalizing the notion of distance between two strings, the most common and simplest formalization is known as edit distance.

Edit distance measures the difference between two strings in terms of the minimum number of elementary operations required to transform one string into the other. Closely related to edit distance is the concept of string alignment, which provides an alternative, more visual way of representing the same relationship between two strings. Both concepts are widely used together and are foundational to the study of dynamic programming applied to string comparison.

Edit Operations

The transformation of one string into another is carried out using a set of permitted operations performed on individual characters. These operations are:

  1. Insertion (I) – inserting a character into the first string.
  2. Deletion (D) – deleting a character from the first string.
  3. Substitution or Replacement (R) – replacing a character in the first string with a character from the second string.
  4. Match (M) – a non-operation, indicating that a character is common to both strings and requires no change.

These four symbols—I, D, R, and M—are used to construct what is known as an edit transcript.

ADVERTISEMENT

Edit Transcript

Definition: A string composed of the symbols I, D, R, and M that describes how one string can be transformed into another is called an edit transcript.

READ ALSO

The Parsimony Criterion in Phylogenetics: Morphological & Molecular Methods

Maximum Likelihood Criterion in Phylogenetic Tree Reconstruction

To understand how an edit transcript works, two pointers, next1 and next2, are maintained over the first string (S1) and the second string (S2) respectively. Both pointers initially point to the first character of their respective strings. The transcript is read from left to right, and operations are applied as follows:

ADVERTISEMENT
  • When the symbol I is encountered, the character pointed to by next2 is inserted into S1, and next2 is incremented.
  • When the symbol D is encountered, the character pointed to by next1 is deleted from S1, and next1 is incremented.
  • When the symbol R or M is encountered, the character at next1 is either replaced or matched with the character at next2, and both pointers are incremented.

Example: Consider transforming the string “vintner” into “writers.” The edit transcript for this transformation is:

ADVERTISEMENT
R I M D M D M M I
v _ i n t n e r _
w r i _ t _ e r s

Here, v is replaced by w (R), r is inserted (I), i is matched (M), n is deleted (D), t is matched (M), n is deleted (D), e and r are matched (M, M), and finally s is inserted (I).

Edit Distance

Definition: The edit distance between two strings is defined as the minimum number of edit operations—insertions, deletions, and substitutions—required to transform the first string into the second string. It is important to note that matches are not counted while calculating edit distance, since a match does not represent a change.

Edit distance is also known as Levenshtein distance, named after V. Levenshtein, who is credited with first introducing this concept.

An edit transcript that achieves the transformation using the minimum possible number of operations is referred to as an optimal transcript. Since more than one transcript may achieve this same minimum number of operations, such transcripts are collectively called cooptimal transcripts.

The edit distance problem therefore involves two tasks:

  • Computing the numerical edit distance between two given strings.
  • Determining an optimal edit transcript that describes the actual transformation.

Alternative Interpretation of Edit Distance

Although edit distance is defined as the minimum number of operations needed to convert the first string into the second, it can equivalently be viewed as the minimum number of operations performed on either of the two strings so that both strings are transformed into a common third string. This interpretation is mathematically equivalent to the original definition, because an insertion performed on one string can always be viewed as a deletion performed on the other string, and vice versa.

String Alignment

Definition: A global alignment of two strings S1 and S2 is obtained by inserting chosen spaces (or dashes) into or at the ends of S1 and S2, and then placing the two resulting strings one above the other, such that every character or space in either string corresponds to a unique character or space in the other string.

The term “global” is used to emphasize that the entire length of both strings participates in the alignment. This is in contrast to local alignment, where only selected portions of the strings are aligned (a concept studied separately).

Example: Consider the alignment of the strings “qacdbd” and “qawxb”:

q a c _ d b d
q a w x _ b _

In this alignment, the character c is mismatched with w, and the remaining positions involve either matches or spaces opposite characters.

Relationship Between Alignment and Edit Transcript

From a mathematical point of view, an alignment and an edit transcript are equivalent ways of describing the relationship between two strings, and one can be converted into the other. The correspondence between the two is as follows:

  • Two opposing characters that mismatch in an alignment correspond to a substitution (R) in the edit transcript.
  • A space in the first string of the alignment corresponds to an insertion (I) of the opposing character into the first string.
  • A space in the second string of the alignment corresponds to a deletion (D) of the opposing character from the first string.

Therefore, the edit distance between two strings can also be defined as the alignment that minimizes the total number of mismatched opposing characters plus the number of characters opposite spaces.

Conceptual Difference Between Alignment and Edit Transcript

Although alignment and edit transcript are mathematically equivalent, they differ conceptually:

  • An edit transcript emphasizes the actual mutational events (such as point mutations) that transform one string into another. It represents the process of transformation.
  • An alignment, on the other hand, only displays the final relationship or correspondence between the two strings. It represents the product of the transformation, without specifying the process.

This distinction is significant in evolutionary modeling, because different evolutionary models may permit different sets of string operations, and yet these different models can still result in the same final alignment. In other words, an alignment alone does not reveal which underlying mutational model produced it. For this reason, the language of “alignment” is often preferred over “edit transcript” in comparative and evolutionary studies, since it is more neutral and does not commit to any particular process. Alignment terminology is also more natural and convenient when extending the discussion to multiple sequence comparison, where more than two strings are compared simultaneously.

Significance of Edit Distance and Alignment

  • They provide a precise, quantitative measure of similarity or dissimilarity between two strings.
  • They form the mathematical basis for dynamic programming algorithms used in sequence comparison.
  • They are extensively applied in bioinformatics for comparing DNA, RNA, and protein sequences.
  • They are used in spelling correction systems to suggest the closest matching word.
  • They are applied in textual database retrieval to identify approximate matches.

Conclusion

Edit distance and string alignment together form the conceptual foundation for comparing two strings. While edit distance provides a numerical measure of dissimilarity based on the minimum number of insertion, deletion, and substitution operations, alignment offers a visual and structural representation of the same relationship. Both concepts are interconvertible, yet alignment is generally preferred in comparative and evolutionary biology due to its neutrality regarding the underlying process of transformation. These ideas serve as the starting point for more advanced techniques in dynamic programming, including local alignment and multiple sequence alignment.

  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Facebook (Opens in new window) Facebook
  • Share on Reddit (Opens in new window) Reddit
  • Share on X (Opens in new window) X
  • Print (Opens in new window) Print
Shibasis Rath

Shibasis Rath

"𝓒𝓸𝓷𝓷𝓮𝓬𝓽𝓲𝓷𝓰 𝓡𝓮𝓼𝓮𝓪𝓻𝓬𝓱 𝓣𝓸 𝓡𝓮𝓪𝓵𝓲𝓽𝔂" 𝓲𝓼𝓷'𝓽 𝓙𝓾𝓼𝓽 𝓪 𝓜𝓸𝓽𝓽𝓸 - 𝓘𝓽'𝓼 𝓜𝔂 𝓜𝓲𝓼𝓼𝓲𝓸𝓷

Related Posts

The parsimony criterion
BIOINFORMATICS

The Parsimony Criterion in Phylogenetics: Morphological & Molecular Methods

July 15, 2026
maximum-likelihood-criterion
BIOINFORMATICS

Maximum Likelihood Criterion in Phylogenetic Tree Reconstruction

July 15, 2026
Tree Optimization Criteria and Search Methods in Phylogenetics – NNI, SPR, TBR Explained
BIOINFORMATICS

Tree Optimization Criteria and Tree Search Methods in Phylogenetics

July 15, 2026

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

I agree to the Terms & Conditions and Privacy Policy.

POPULAR NEWS

Chewing gum releases thousands of microplastic particles directly into your mouth with every piece you chew

Chewing gum releases thousands of microplastic particles directly into your mouth with every piece you chew

by Shibasis Rath
May 8, 2026
0

Microplastics are turning up in places researchers never expected: deep-sea sediments, Arctic ice, and human blood. Now, a UCLA pilot...

grayscale photo of girl in polka dot long sleeve shirt

Yelling Isn’t Just Yelling: How a Hostile Home Rewires a Child’s Brain for Constant Alert

by Shibasis Rath
March 8, 2026
0

To a parent in the heat of the moment, a raised voice may feel like simple frustration. To a child...

72-Hour Fasting Can Reset Your Entire Immune System, USC Study Shows

72-Hour Fasting Can Reset Your Entire Immune System, USC Study Shows

by Shibasis Rath
February 28, 2026
0

A 72-hour fast can trigger a powerful immune system reset. Scientists call this stem cell regeneration. The process clears old...

woman in white tank top lying on bed

New Studys Says Gen Z is the least sexually active young cohort in modern recorded history

by Shibasis Rath
January 24, 2026
0

A generation that grew up with dating apps in their pockets, pornography a tap away, and sex discussed more openly...

a group of gen Z kids walking down a street

Is Gen Z the First Generation Less Intelligent Than Their Parents?

by Shibasis Rath
February 5, 2026
0

Gen Z intelligence decline is emerging as a serious concern among neuroscientists and education researchers. For over a century, each...

EDITOR CHOICE‘S

  • All
  • NEWS
  • SPOTLIGHTS
The parsimony criterion

The Parsimony Criterion in Phylogenetics: Morphological & Molecular Methods

by Shibasis Rath
July 15, 2026
0

The parsimony criterion is one of the oldest and most widely used methods of constructing phylogenetic trees, having its roots...

maximum-likelihood-criterion

Maximum Likelihood Criterion in Phylogenetic Tree Reconstruction

by Shibasis Rath
July 15, 2026
0

The maximum-likelihood (ML) criterion is one of the most important and statistically rigorous approaches used for phylogenetic tree reconstruction, first...

Tree Optimization Criteria and Search Methods in Phylogenetics – NNI, SPR, TBR Explained

Tree Optimization Criteria and Tree Search Methods in Phylogenetics

by Shibasis Rath
July 15, 2026
0

Distance-matrix clustering methods such as UPGMA and Neighbor-Joining construct a phylogenetic tree directly through a fixed, well-defined algorithm, without explicitly...

Bootstrapping in Phylogenetics

Bootstrapping in Phylogenetics – Tree Reliability, Resampling & Bootstrap Values

by Shibasis Rath
July 15, 2026
0

Bootstrapping is a statistical method used to assess the reliability of a phylogenetic tree, introduced by Felsenstein in 1985. Since...

ADVERTISEMENT

RathBiotaClan – RBC

RathBiotaClan – Connecting Research To Reality

Your trusted source for life science news, biology research & discoveries. Covering neuroscience, genetics, ecology, and more — connecting research to reality.

About Us

Privacy Policies

Contact Us

Editorial Standard

Latest Posts

  • The Parsimony Criterion in Phylogenetics: Morphological & Molecular Methods
  • Maximum Likelihood Criterion in Phylogenetic Tree Reconstruction
  • Tree Optimization Criteria and Tree Search Methods in Phylogenetics
  • Bootstrapping in Phylogenetics – Tree Reliability, Resampling & Bootstrap Values

SHIBASIS RATH

Contact Mail

rathbiotaclan@gmail.com

No Result
View All Result
MSME (Udyam) Certified Science Platform
Govt. of India

Get Us On PlayStore

playstore app for rathbiotaclan
  • About Us
  • Advertise With Us
  • Cancellation and Refund Policy
  • Contact Us
  • Contribute
  • Editorial Standards
  • Home
  • Pricing Details
  • Privacy Policies
  • Shipping Policy
  • Terms & Conditions

© 2026 RathBiotaClan. All rights reserved.

Welcome Back!

Sign In with Google
OR

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Sign Up with Google
OR

Fill the forms below to register

*By registering into our website, you agree to the Terms & Conditions and Privacy Policy.
All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In

Add New Playlist

No Result
View All Result
  • HOME
  • HEALTH SCIENCE
  • NEUROSCIENCE
    • PHYSIOLOGY
    • IMMUNOLOGY
    • CANCER
  • DISCOVERIES
    • SPOTLIGHTS
    • STUDENT PORTAL
    • SCIENCE FEATURED
  • MOLECULAR BIOLOGY
    • GENETICS
    • BIOTECHNOLOGY
    • BIOINFORMATICS
    • BIOCHEMISTRY
    • BIOPHYSICS
  • ZOOLOGY & ECOLOGY
    • ENVIRONMENTAL SCIENCE
    • ECOLOGY
    • EVOLUTION
  • MICRO & PLANT SCIENCE
    • MICROBIOLOGY
    • CELL BIOLOGY
    • DEVELOPMENTAL BIOLOGY
  • PSYCHOLOGY
  • Login
  • Sign Up
SAVED POSTS

© 2026 RathBiotaClan. All rights reserved.

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.