simultaneous multiple key sorting algorithm

Manfred Nowak svv1999 at hotmail.com
Fri Jan 27 22:03:31 PST 2012


Andrei Alexandrescu wrote:

Andrei Alexandrescu wrote:

> generally what one wants is a selection of "best of breed" stocks
> that are among the top ones in a variety of categories. (Relative
> importance could be assigned to each category.) 

This is quite different and easier than the problem initially
stated, because ranks must not be computed.

1) Compute the individual importance `ii' of each element `e'  
2) Use the linear median algorithm to find the element `ek' whose 
individual importance `ii' is close to rank `k' of all elements `e',
where `k' is the number of elements `e' acceptable as "best of the 
breed"
3) return all elements `e' whith `e.ii >= ek.ii'. This can be done
by a sweep over the array. 

Please note, that this relies on having choosen the vector of relativ 
importances for the categories correctly. How does one know about this 
correctness?

For example in marketing it is desired to occupy unique selling points, 
because the gain of profit might be huge. But this means, that also the 
loss for the seller is huge.

In your example with body and hair length one might choose a candidate 
who simply has missed the haurdresser the day before.

-manfred 



More information about the Digitalmars-d mailing list