# What's the difference between the greedy and Hamiltonian methods?

Given T={CTAGC, GAGCG, AGCGG, CGGAG}, using a greedy algorithm, the superstring S will be CTAGCGGAGCG.

From `S`, the combination of triplets will be given as s = {CTA, TAG, AGC, GCG, CGG, GGA, GAG, AGC, GCG}.

Both GCG and AGC are repeated.

If using s to retrieve the superstring by using Hamiltonian method, would the repeated words will be used or omitted?

If the repeated word is omitted, then CTA, TAG, AGC, GCG, CGG, GGA, and GAG constructed back will become GTAGCGGAGC.

So, in the end, both the greedy method and Hamiltonian method will provide different results in the superstring.

Why are they different? In my research, all the examples I found showed that there are no repeated words in the combination, so if I reconstruct the superstring using the Hamiltonian method, the result of the greedy and Hamiltonian methods will be the same. But what about the repeated words?

-
Conceptual algorithm questions are on-topic here: I just cleaned up your question a little bit. – user8 Oct 11 '11 at 15:14
@MarkTrapp - surely there's a GreedyVsHamiltonian.stackexchange.com site by now. – Joel Etherton Oct 11 '11 at 15:21

I didn't quite know the exact algorithm that expresses Super string `S` from the set `T` However here is a short answer to your question.