Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: permutation swap distance
Replies: 3   Last Post: Aug 26, 2013 8:00 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Bruno Luong

Posts: 8,830
Registered: 7/26/08
Re: permutation swap distance
Posted: Aug 26, 2013 7:24 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Michal Kvasnicka" wrote in message <kvf0j4$e9r$1@newscl01ah.mathworks.com>...
> I am looking for effective (algoritmically fastest) implementation of swap distance metric algorithm for two permutations.
>
> Example:
> perm1 = [ 1 2 3]
> perm2 = [ 3 2 1]
>
> swapdist(perm1,perm2) = 3
>
> because
> 1 2 3 -> 2 1 3 -> 2 3 1 -> 3 2 1 (3 neighbor elements swaps)
>
> Any hints?
>
> Michal


See my code in this thread:

http://www.mathworks.com/matlabcentral/newsreader/view_thread/239871

Bruno



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.