Abstract.Composers commonly employ ornamentation and elaboration techniques to generate varied versions of an initial core melodic idea. Dynamic programming techniques, based on edit operations, are used to find similarities between melodic strings. However, replacements, insertions and deletions may give non-musically pertinent similarities, especially if rhythmic or metrical structure is not considered. We propose, herein, to compute the similarity between a reduced query and a melody employing only fragmentation operations. Such fragmentations transform one note from the reduced query into a possible large set of notes, taking into account pitch and rhythm constraints, as well as elementary parallelism information. We test the proposed algorithm on four "theme and variations" piano pieces by W. A. Mozart and L. van Beethoven and show that the proposed constrained fragmentation operations are capable of detecting simple variations with high sensitivity and specificity.