This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Computational Complexity Of Creating A Dotplot

hi could someone please tell me what is the computational complexity of creating a dotplot ?

2 answers

It will be quadratic in the length of the sequence. You are comparing every base to every other base. There are n(n-1)/2 comparisons to be made.

The naive way is quadratic in the length of both length:

O(m * n)

where m is the length of sequence 1 and n is the length of sequence 2.

I would not be suprised if there is a fancy datastructure which could do the job in linear time.

You can't escape comparing nucleotide of one sequence against all of the other in order to find interesting changes occurring between the two genomes/chromosomes .

Long time ago: A very wise man stated that a linear algorithm for LCS would be impossible yet it exists.

Log in to answer this question.