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 7491271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:57:13+00:00 2026-05-29T15:57:13+00:00

Using the Smith-Waterman algorithm for a book homework assignment, I made up a table

  • 0

Using the Smith-Waterman algorithm for a book homework assignment, I made up a table of values. Building the table was easy once I understood how the values are acquired, but now I’m having difficulty with determining the best alignment sequence from the table.

The table example was generated following the formula

min(  (i+1, j+1)+penalty)
      (i+1, j)+2)
      (i, j+1)+2))

In the book pseudocode, penalty had a value of 0 if i==j and 1 otherwise.

The first 4 rows and columns look like this, with a penalty of 1 for a mismatch and 2 for a gap. :

14   12   10   8
15   13   11   9
16   14   12   10
17   15   13   11

According to the directions in the book, the method for determining the path are

  1. Start at array slot [0][0], in this case the value is 14
    • Check slot [0][1]. As we move left to the slot, a gap is inserted, thus adding 2 to the value, resulting in 14
    • Check slot [1][0], and another gap is inserted resulting in a value of 17
    • Check slot [1][1]. As we move diagonally, the penalty value is added to to the slot value, giving a result of 14

Since I have two matching possibilities in [0][1] and [1][1], which is to be used for the next step?

  • 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-05-29T15:57:14+00:00Added an answer on May 29, 2026 at 3:57 pm

    It seems to me that you already applied the weights when constructed the matrix, at least, this is how the standard variation of SW works. To determine the path, you are likely just following the path to the lower number, not adding the penalty any more. I may be wrong; please post a link to the book page in Google Books, or other description matching your book if in doubt. It seems to me that in your case the best path moves are 3 steps right, 14-12-10-8.

    In either case, whether I am right or wrong in the above expression of doubt, you can still hit an ambiguous path point in the matrix. An orthogonal move represents a gap in either sequence, while a diagonal move corresponds to an alignment (which I think always represents a mismatch if the choice is ambiguous, but prove that). Really you can follow either path. As long as you reach a zero or the corner, you will get two paths with the same cost. A preference of a gap vs. mismatch has been already applied when constructing the matrix, encoded in the balance of gap and mismatch penalties, so the case is truly ambiguous.

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

Sidebar

Related Questions

I am learning MVVM using sample created by Josh Smith at http://msdn.microsoft.com/en-us/magazine/dd419663.aspx I wanted
Example XML using element nodes: <?xml version=1.0 encoding=utf-8?> <users> <user> <name>David Smith</name> <phone>0441 234443</phone>
I'm writing some WPF code involving Adorners. I'm using Josh Smith's UIElementAdorner.cs (found in
Client: string value = <?xml version=1.0?><person><firstname>john</firstname><lastname>smith</lastname> <person/>; using (HttpResponseMessage response = m_RestHttpClient.Post(new/customerxml/+value2, frm.CreateHttpContent())) {
I'd like to String.Split() the following string using a comma as the delimitter: John,Smith,123
I am using Login Control available in ASP.NET 2.0 in the login page. Once
I have this string 'john smith~123 Street~Apt 4~New York~NY~12345' Using JavaScript, what is the
Question: I'm using Josh Smith's implementation of commands for MVVM using routed commands. I
I've tried several things... using Variables and Templates, and have made some slow progress.
I'm using Mark Smith's Julmar MVVM-Helpers library in an application and would like to

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.