Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7773991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:15:58+00:00 2026-06-01T17:15:58+00:00

OK this is what I want to do: Get more than two strings and

  • 0

OK this is what I want to do:

Get more than two strings and “align” them (no DNA/RNA sequence or the like, just regular strings with not like 1000 items in each of them)

I’ve already done some work with pairwise alignment (align two strings) however the “gaps” create some issues for me when trying to align more than one pair.

Example (one I’m currently testing):

ABCDEF
ABGHCEEF
AJKLBCDYEOF

AB--CDEF
ABGHCEEF
=======================
AB--C-EF

A-B--C--E-F
AJKLBCDYEOF
=======================
A----C--E-F

And another (more illustrative) example :

http://nest.drkameleon.com
http://www.google.com
http://www.yahoo.com

http://nest.drkameleon.com
http://-www.--google--.com

=======================
http://----.------le--.com

http://----.------le--.com
http://-www.-----yahoo.com

=======================
http://----.----------.com

What I’m currently doing :

  • Sort the strings (longer strings come first in the list)
  • Align the first pair : A-B and get the result (let’s say R1)
  • Then align the second pair : R1 and C (result in R2)
  • Then align the third pair : R2 and D
  • And so on…

So what’s in your mind? How could I go for that? Is there a better way? (Of course, there must be…)

I’d rather do that in Perl/Python or something along these lines, however any type of code/reference would be more than welcome! 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:16:01+00:00Added an answer on June 1, 2026 at 5:16 pm

    I think you may be able to cast this problem as a more general string diff problem instead of a string alignment. Consider how GNU diff is used for finding differences between two files, and use the same algorithms as are used to perform an N-way diff.

    I’m not sure if the time/memory complexity of this approach is amenable to your needs, but you can at least think about the problem this way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two lists or more than . Some thing like this: listX =
I want to get a window like this How should i get this and
I want to compare two times and if the new time is more than
I have subclassed a UITableViewCell and within this class I want to get it's
How do I get and print a char from a user? This want do
I want to get this straight. I know what DLL's are. I have done
I want to get this image uploading script right, but for whatever reason it
i want to get the value of this td my code function check() {
I want to get the information that is returned by this query from SolrNet:
I want to get rid of the timestamp in this returned string. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.