R implementation of sorting by reversals

Posted by user1357015 on Stack Overflow See other posts from Stack Overflow or by user1357015
Published on 2012-10-14T14:46:06Z Indexed on 2012/10/15 3:38 UTC
Read the original article Hit count: 135

Filed under:
|
|

I was wondering if there is an implementation in R where it sorts a permutation of n numbers into the original 1...n sequence and provides the number of reversals needed. Eg an implementation of the "sorting by reversals" or "sorting by translocation" as outlined in this ppt.

Specifically, I have a permutation of a sequence of n elements, pi(n), and I want to figure out how close it is to the original sequence. The number of reversals seems a good metric.

Thanks!

© Stack Overflow or respective owner

Related posts about algorithm

Related posts about r