Thursday, December 3, 2026
SAVED POSTS
  • Login
  • Register
RathBiotaClan
No Result
View All Result
  • HOME
  • HEALTH SCIENCE

    TRENDING ON HEALTH (TOP)

    A New Lupus Drug Is Being Tested as a Simpler Alternative to CAR-T Cell Therapy

    Targeted Radiation Therapy Slows Disease Progression in Advanced Prostate Cancer

    Laughter therapy may help people with a common form of lung disease

    Mindfulness Therapy Offers New Hope for People Stuck in Depression

    NOW ON AIR (RBC)

    fruitfully remove the head, then touch the wing
    NEUROSCIENCE

    Fruit Flies Without Heads Keep Cleaning Their Wings, Scientists Found the Cells Behind It

    November 30, 2026
    HEALTH SCIENCE

    A New Lupus Drug Is Being Tested as a Simpler Alternative to CAR-T Cell Therapy

    November 29, 2026
    prostate-cancer
    CANCER

    Targeted Radiation Therapy Slows Disease Progression in Advanced Prostate Cancer

    November 27, 2026
    BIOTECHNOLOGY

    Scientists Reveal How CRISPR Systems Recruit Enzymes for Precise DNA Insertion

    November 26, 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
Loading…
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
32
A A
0
ADVERTISEMENT

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:

Advertisement
  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.

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

Multiple alignment with sum of pairs and consensus objective functions

Why Is Multiple String Alignment Harder Than Pairwise Alignment?

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:

  • 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.

Advertisement

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.


Discover more from RathBiotaClan

Subscribe to get the latest posts sent to your email.

Previous Post

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

Next Post

Negotiating with women builds more trust, even in anonymous online chats, Study finds

Shibasis Rath

Shibasis Rath

Shibasis Rath is the founder and editor of RathBiotaClan. He holds a B.Sc. in Zoology and a master's degree in Bioinformatics, and writes about genetics, evolution, zoology and the wider life sciences, turning peer-reviewed research into clear, accurate news for general readers.

Every article links to the original study, and health stories are written as research summaries, not medical advice.

RathBiotaClan: Connecting research to reality.

Related Posts

Multiple alignment with sum of pairs and consensus objective functions
BIOINFORMATICS

Multiple alignment with sum of pairs and consensus objective functions

November 19, 2026
Why Is Multiple String Alignment Harder Than Pairwise Alignment?
BIOINFORMATICS

Why Is Multiple String Alignment Harder Than Pairwise Alignment?

November 19, 2026
Multiple Sequence Comparasion For Structural Interference
BIOINFORMATICS

Multiple Sequence Comparasion For Structural Interference

November 19, 2026

POPULAR NEWS

man in black shirt holding black smartphone

Watching TikTok and Instagram Reels Videos Deactivates the Brain’s Cognitive Control Network, Study Finds

by Shibasis Rath
August 20, 2026
1

Millions of people finish short video after short video every day; a new brain-scan study shows that the very act...

The Edit Distance Between Two Strings Alignment

The Edit Distance Between Two Strings Alignment

by Shibasis Rath
July 2, 2026
0

Comparing two strings and measuring how different or similar they are is a fundamental problem in computer science, with applications...

Scientists Have a Fascinating Hypothesis About Why Smart People Should Spend Less Time With Friends

Scientists Have a Fascinating Hypothesis About Why Smart People Should Spend Less Time With Friends

by Shibasis Rath
August 15, 2026
0

Higher intelligence links to lower life satisfaction when people socialize more often with friends. Researchers found this pattern in data...

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 - Updated on July 2, 2026
0

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

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 - Updated on March 14, 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
Fruit Flies Without Heads Keep Cleaning Their Wings, Scientists Found the Cells Behind It

Fruit Flies Without Heads Keep Cleaning Their Wings, Scientists Found the Cells Behind It

by Shibasis Rath
November 30, 2026
0

Touch the wing of a fruit fly with no head, and its back legs still sweep the wing clean. That...

A New Lupus Drug Is Being Tested as a Simpler Alternative to CAR-T Cell Therapy

A New Lupus Drug Is Being Tested as a Simpler Alternative to CAR-T Cell Therapy

by Shibasis Rath
November 29, 2026
0

T cell engagers, lab-made antibodies that steer immune cells against rogue B cells, are drawing interest as a new lupus...

prostate-cancer

Targeted Radiation Therapy Slows Disease Progression in Advanced Prostate Cancer

by Shibasis Rath
November 27, 2026
0

A targeted radioactive therapy may give men with advanced prostate cancer more time before their disease worsens. In a phase...

Scientists Reveal How CRISPR Systems Recruit Enzymes for Precise DNA Insertion

Scientists Reveal How CRISPR Systems Recruit Enzymes for Precise DNA Insertion

by Gupteswar Acharya
November 26, 2026
0

Cryo-EM reveals how CRISPR-associated transposases recruit proteins and activate precise DNA insertion in bacteria. Researchers captured three structural stages of...

ADVERTISEMENT

Google News

Get RathBiotaClan stories in your Google News feed.

Add to Google News

RathBiotaClan – RBC

RathBiotaClan

Connecting Research to Reality.

Trusted life science news and biology research for students, researchers, and science enthusiasts.

About Us

Privacy Policies

Contact Us

Editorial Standard

Latest Posts

  • Fruit Flies Without Heads Keep Cleaning Their Wings, Scientists Found the Cells Behind It
  • A New Lupus Drug Is Being Tested as a Simpler Alternative to CAR-T Cell Therapy
  • Targeted Radiation Therapy Slows Disease Progression in Advanced Prostate Cancer
  • Scientists Reveal How CRISPR Systems Recruit Enzymes for Precise DNA Insertion

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 RathBiotaClan | Life Science & Biology Research
  • 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
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.

Discover more from RathBiotaClan

Subscribe now to keep reading and get access to the full archive.

Continue reading