|
|
| Author |
Message |
Abstract Dissonance science forum Guru Wannabe
Joined: 29 Dec 2005
Posts: 201
|
Posted: Thu Apr 27, 2006 3:10 pm Post subject:
metric for permutations?
|
|
|
Does anyone have any info on a way to measure the "distance" between two
permutations? I need a good method that will allow me to compare how "close"
one permutation is to another.
I could treat them as a metric space over Z_n and I think that would work
but the problem is that it treats every element equally.
What I mean is that in some cases its more important that the first location
be the same than the second, etc...
I could measure them with something like
sum(|k-l|^(n-k),k=0..n) where w_k = w*_l, p1 = (w_0, ..., w_n) and p2 =
(w*_0, ..., w*_n)
or even something like
sum(|w(k)*(k-l)|,k=0..n)
where w(k) is a weight function.
These might violate the standard definition of a metric and there might be
some inconsistancies in my criteria. Just some idea. Obviously if two
permutations are the same then there "distance" should be 0.
The reason is that I want to see how "good" a permutation, picked at random,
is to a fixed permutation.
if I have something like
as the fixed permutation and I "randomly" choose
(4,2,5,3,1)
then its a pretty good "match" compared to (3,1,5,2,4) (which seems to be
the worse possible choice). Although I also would like to take into account
the order in which I'm right too.
if (4,2,5,1,3) is the fixed permutation,
then (2,4,5,1,3) is much worse then (4,2,5,3,1)
Thanks,
Jon |
|
| Back to top |
|
 |
digfarenough@gmail.com science forum beginner
Joined: 03 Apr 2006
Posts: 10
|
Posted: Thu Apr 27, 2006 3:24 pm Post subject:
Re: metric for permutations?
|
|
|
I would suggest that the simplest metric is just the number of element
swaps needed to turn one permutation into another (i.e. (4,2,5,1,3) is
one swap away from (4,2,5,3,1)), but it seems you want an explicit
formula for calculating the distance between two and I'm not sure how
easy it would be to express the above as a formula. I do believe it
satisfies the triangle inequality, though.
A start would be to consider the number of positions that differ
between two cases, which would be 0 or >=2 if the permutations are the
same length. But 4 elements being different could be solved by 2 to 4
swaps, depending on the specific permutation.
http://forums.wolfram.com/mathgroup/archive/2000/Jan/msg00251.html
contains an algorithm for computing distances in this sense, so it
might be a start. |
|
| Back to top |
|
 |
Peter Webb science forum Guru Wannabe
Joined: 05 May 2005
Posts: 192
|
Posted: Thu Apr 27, 2006 3:33 pm Post subject:
Re: metric for permutations?
|
|
|
"Abstract Dissonance" <Abstract.Dissonance@hotmail.com> wrote in message
news:1251nmnholiebc3@corp.supernews.com...
| Quote: | Does anyone have any info on a way to measure the "distance" between two
permutations? I need a good method that will allow me to compare how
"close" one permutation is to another.
I could treat them as a metric space over Z_n and I think that would work
but the problem is that it treats every element equally.
What I mean is that in some cases its more important that the first
location be the same than the second, etc...
I could measure them with something like
sum(|k-l|^(n-k),k=0..n) where w_k = w*_l, p1 = (w_0, ..., w_n) and p2 =
(w*_0, ..., w*_n)
or even something like
sum(|w(k)*(k-l)|,k=0..n)
where w(k) is a weight function.
These might violate the standard definition of a metric and there might be
some inconsistancies in my criteria. Just some idea. Obviously if two
permutations are the same then there "distance" should be 0.
The reason is that I want to see how "good" a permutation, picked at
random, is to a fixed permutation.
if I have something like
as the fixed permutation and I "randomly" choose
(4,2,5,3,1)
then its a pretty good "match" compared to (3,1,5,2,4) (which seems to be
the worse possible choice). Although I also would like to take into
account the order in which I'm right too.
if (4,2,5,1,3) is the fixed permutation,
then (2,4,5,1,3) is much worse then (4,2,5,3,1)
Thanks,
Jon
|
How about the minimum number of pairs that need to be swapped? If you
weighted each pair swap by position and found the global minimum in terms of
the sum of the swap costs then it would clearly satisfy the triangle
inequality. (Unfortunately, I can't prove and don't even know if its true
that simply finding the smallest number of pair swaps and then applying the
weighting factor would neccesarily satisfy the triangle inequality, though
it obviously does if all the weights are 1.) |
|
| Back to top |
|
 |
Gene Ward Smith science forum Guru
Joined: 08 Jul 2005
Posts: 409
|
Posted: Thu Apr 27, 2006 7:38 pm Post subject:
Re: metric for permutations?
|
|
|
Abstract Dissonance wrote:
| Quote: | Does anyone have any info on a way to measure the "distance" between two
permutations? I need a good method that will allow me to compare how "close"
one permutation is to another.
|
If you pick your favorite set of generators for Sn, and include g^(-1)
for each generator g, then the Cayley graph gives a sort of geometry
for the group, which you could use to measure distance. |
|
| Back to top |
|
 |
Abstract Dissonance science forum Guru Wannabe
Joined: 29 Dec 2005
Posts: 201
|
Posted: Thu Apr 27, 2006 8:21 pm Post subject:
Re: metric for permutations?
|
|
|
<digfarenough@gmail.com> wrote in message
news:1146151480.211584.143210@g10g2000cwb.googlegroups.com...
| Quote: | I would suggest that the simplest metric is just the number of element
swaps needed to turn one permutation into another (i.e. (4,2,5,1,3) is
one swap away from (4,2,5,3,1)), but it seems you want an explicit
formula for calculating the distance between two and I'm not sure how
easy it would be to express the above as a formula. I do believe it
satisfies the triangle inequality, though.
|
Well, I don't mind an algorithm. This was my first idea as its pretty simple
but doesn't take into account the order.
| Quote: | A start would be to consider the number of positions that differ
between two cases, which would be 0 or >=2 if the permutations are the
same length. But 4 elements being different could be solved by 2 to 4
swaps, depending on the specific permutation.
http://forums.wolfram.com/mathgroup/archive/2000/Jan/msg00251.html
contains an algorithm for computing distances in this sense, so it
might be a start.
|
I'll check it out.
Thanks,
Jon |
|
| Back to top |
|
 |
Abstract Dissonance science forum Guru Wannabe
Joined: 29 Dec 2005
Posts: 201
|
Posted: Thu Apr 27, 2006 8:22 pm Post subject:
Re: metric for permutations?
|
|
|
"Peter Webb" <webbfamily-diespamdie@optusnet.com.au> wrote in message
news:4450e463$0$10672$afc38c87@news.optusnet.com.au...
| Quote: |
"Abstract Dissonance" <Abstract.Dissonance@hotmail.com> wrote in message
news:1251nmnholiebc3@corp.supernews.com...
Does anyone have any info on a way to measure the "distance" between two
permutations? I need a good method that will allow me to compare how
"close" one permutation is to another.
I could treat them as a metric space over Z_n and I think that would work
but the problem is that it treats every element equally.
What I mean is that in some cases its more important that the first
location be the same than the second, etc...
I could measure them with something like
sum(|k-l|^(n-k),k=0..n) where w_k = w*_l, p1 = (w_0, ..., w_n) and p2 =
(w*_0, ..., w*_n)
or even something like
sum(|w(k)*(k-l)|,k=0..n)
where w(k) is a weight function.
These might violate the standard definition of a metric and there might
be some inconsistancies in my criteria. Just some idea. Obviously if two
permutations are the same then there "distance" should be 0.
The reason is that I want to see how "good" a permutation, picked at
random, is to a fixed permutation.
if I have something like
as the fixed permutation and I "randomly" choose
(4,2,5,3,1)
then its a pretty good "match" compared to (3,1,5,2,4) (which seems to be
the worse possible choice). Although I also would like to take into
account the order in which I'm right too.
if (4,2,5,1,3) is the fixed permutation,
then (2,4,5,1,3) is much worse then (4,2,5,3,1)
Thanks,
Jon
How about the minimum number of pairs that need to be swapped? If you
weighted each pair swap by position and found the global minimum in terms
of the sum of the swap costs then it would clearly satisfy the triangle
inequality. (Unfortunately, I can't prove and don't even know if its true
that simply finding the smallest number of pair swaps and then applying
the weighting factor would neccesarily satisfy the triangle inequality,
though it obviously does if all the weights are 1.)
|
That was my first guess too. I'll need to try and weight it though. I'll
have to look at it some more.
Thanks,
Jon |
|
| Back to top |
|
 |
Abstract Dissonance science forum Guru Wannabe
Joined: 29 Dec 2005
Posts: 201
|
Posted: Thu Apr 27, 2006 8:23 pm Post subject:
Re: metric for permutations?
|
|
|
"Gene Ward Smith" <genewardsmith@gmail.com> wrote in message
news:1146166688.767956.60470@i40g2000cwc.googlegroups.com...
| Quote: |
Abstract Dissonance wrote:
Does anyone have any info on a way to measure the "distance" between two
permutations? I need a good method that will allow me to compare how
"close"
one permutation is to another.
If you pick your favorite set of generators for Sn, and include g^(-1)
for each generator g, then the Cayley graph gives a sort of geometry
for the group, which you could use to measure distance.
|
Ok, I'll look more into it. Been a while since I've messed with Cayley
graphs.
Thanks,
Jon |
|
| Back to top |
|
 |
kunzmilan@atlas.cz science forum beginner
Joined: 21 Feb 2006
Posts: 42
|
Posted: Mon May 01, 2006 12:46 pm Post subject:
Re: metric for permutations?
|
|
|
Distances between permutations can be measured using Spearman
correlation coefficient. The sum of differences of positions of all
objects permuted as compared to the basic unit permutation is always 0.
These differences can be either positive or negative. The sum of
squared differences must be necessarily positive. These differences of
positions can be treated as distances in the cubes. |
|
| Back to top |
|
 |
kunzmilan@atlas.cz science forum beginner
Joined: 21 Feb 2006
Posts: 42
|
Posted: Mon May 01, 2006 12:46 pm Post subject:
Re: metric for permutations?
|
|
|
Distances between permutations can be measured using Spearman
correlation coefficient. The sum of differences of positions of all
objects permuted as compared to the basic unit permutation is always 0.
These differences can be either positive or negative. The sum of
squared differences must be necessarily positive. These differences of
positions can be treated as distances in the cubes. |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Fri Jan 09, 2009 1:03 pm | All times are GMT
|
|
MPAA | Loans | Debt Consolidation | WoW Gold | Online Advertising
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
Other DeniX Solutions sites:
Electronics forum |
Medicine forum |
Unix/Linux blog |
Unix/Linux documentation |
Unix/Linux forums
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|