caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Martin Jambon <mjambon@burnham.org>
To: Andreas Biegert <andreas.biegert@googlemail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Package with multidimensional AND sparse matrices?
Date: Tue, 4 Jul 2006 09:06:16 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0607040820370.3458@droopy> (raw)
In-Reply-To: <fd0847170607040046q6c96c8e9w2d0a494948bb40db@mail.gmail.com>

On Tue, 4 Jul 2006, Andreas Biegert wrote:

> Well, in short: the algorithm computes the optimal multiple alignment
> of up to n protein sequences with maximum length L. The
> straightforward and theoretically optimal approach to solve this
> problem is by dynamic programming, therefore the time and space
> complexity is O(L^n). I managed to come up with a pretty good
> heuristic that lets me boil down the number of cells that need to be
> computed giving me a complexitiy of O(L^2) instead of O(L^n), in fact
> I can even manually adjust the number of nonzero entries in the
> matrix. In the 2000*2000*2000*2000 matrix only at most 2000 cells will
> be non-zero. Furthermore for all non-zero cells M(i,j,k,l) holds
> i<j<k<l. The bad news is that performance is important since the
> program has to run under 5min. An estimation of the time requirements
> given the number of sequences n and masimum lengths L is:
>
> 24 * L^2 * T_x * 2^(n+1) - 1
> with T_x being about 100ns
>
> For n=4 and L=2000 I get just about 5min. Would it be a bad idea to
> use Hashtables all the way instead of matrices? Accessing elements in
> a hashtable has O(1), right?

Yes, if you create it big enough so that it doesn't get resized.
The best is that you look at hashtbl.ml in the standard library to see 
how it is implemented.

But I wouldn't worry too much for now: try Hashtbl and you will quickly 
see if it's fast enough or not.


Martin

--
Martin Jambon, PhD - http://martin.jambon.free.fr
Visit http://wikiomics.org, the Bioinformatics Howto Wiki


  reply	other threads:[~2006-07-04 17:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-03 22:55 Andreas Biegert
2000-01-02  4:56 ` [Caml-list] " Jon Harrop
     [not found]   ` <fd0847170607040038u117d2594r38adcbdf1f00ec04@mail.gmail.com>
2006-07-04  7:46     ` Andreas Biegert
2006-07-04  9:06       ` Martin Jambon [this message]
2006-07-04 10:03       ` Jon Harrop
2006-07-04 16:55         ` Andreas Biegert
2006-07-03 23:59 ` Markus Mottl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0607040820370.3458@droopy \
    --to=mjambon@burnham.org \
    --cc=andreas.biegert@googlemail.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).