Abstract: Melody is an important property for the perceptual description of Western musical pieces. In the monophonic context, retrieval systems based on melodic similarity generally consider sequences of pitches and durations. Algorithms that have been proposed for measuring melodic similarity rely on geometric representations, string matching techniques, etc. Adaptations of edit distance based algorithms, mainly applied in bioinformatic applications, to the musical domain have already been proposed. However, we present in this paper several experiments in order to optimize these methods. The different possible representations for pitches and durations are discussed and evaluated. Optimizations specific to musical applications are proposed and imply significant improvements of the algorithm. Evaluation of this algorithm led to the best results during the MIREX 2006 symbolic melodic similarity contest.