A Molecular Algorithm for Longest Path Problem