comp.lang.ada
 help / color / mirror / Atom feed
From: Wes Groleau <wesgroleau@despammed.com>
Subject: Re: Smart sorting algorithm ?
Date: Wed, 10 Jul 2002 09:38:53 -0500
Date: 2002-07-10T09:38:53-05:00	[thread overview]
Message-ID: <3D2C46FD.AD325907@despammed.com> (raw)
In-Reply-To: VICW8.82172$xy.28338973@twister.socal.rr.com

> Smart.  You avoid making the same comparison more than once and learn from
> transitivity...  No matter what sorting algorithm you use, the table keeps
> the number of comparison down to nC2=n(n-1)/2 comparisons.  The gain from
> transitivity will depend upon your sorting algorithm, but some will give you
> no gain at all...

Someone suggested by e-mail/CGI (no return address)
that I use bucket sort.  But that won't work: the
items have an order, but no numeric value until
the sorting is complete.  Hence there is no way
to assign any particular item to any particular
bucket until the sorting is complete.

Background: We're taking a set of strings and
asking a human to make a better/worse value
judgment on each pair.

The only numeric value is the position in
the sorted list.  The lookup table for
transitivity uses the position in the unsorted
list.  

   "<" (L,R) is: if L better than R, return true

   ....

   Lookup : .... := (others => (others => Unknown));

   ....

   if Input (A) < Input (B) then

      Lookup (A,B) := Correct;

      if Lookup (B,C) = Correct then

         -- inference
         Lookup (A,C) := Correct;

If "=" is prevented or disallowed, then there are
four inferences for every C, and C loops through
Input'Range.  Recursion could add more inferences
for each inference made.

-- 
Wes Groleau
http://freepages.rootsweb.com/~wgroleau



  reply	other threads:[~2002-07-10 14:38 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-02 16:32 Smart sorting algorithm ? Wes Groleau
2002-07-02 17:00 ` achrist
2002-07-02 20:00   ` Wes Groleau
2002-07-02 21:57     ` achrist
2002-07-02 22:22       ` Wes Groleau
2002-07-02 22:57         ` achrist
2002-07-03 14:25           ` Wes Groleau
2002-07-08 17:36       ` Ron
2002-07-02 20:48   ` Florian Weimer
2002-07-02 17:21 ` Wilhelm Spickermann
2002-07-02 20:01   ` Wes Groleau
2002-07-02 20:22     ` Tarjei T. Jensen
2002-07-06 13:40       ` Robert Dewar
2002-07-02 18:57 ` Florian Weimer
2002-07-02 20:08   ` Wes Groleau
2002-07-08 21:54 ` Wes Groleau
2002-07-09  4:35   ` Robert Dewar
2002-07-09  7:51   ` tmoran
2002-07-09 14:48   ` Ron
2002-07-10 14:38     ` Wes Groleau [this message]
2002-07-10 18:08       ` tmoran
2002-07-10 22:14         ` Wes Groleau
2002-07-09 18:59   ` Ron
2002-07-11 14:40     ` Wes Groleau
2002-07-11 20:04       ` Robert Dewar
2002-07-15 19:37         ` Wes Groleau
2002-07-15 22:08           ` achrist
  -- strict thread matches above, loose matches on Subject: below --
2002-07-02 17:50 Gautier direct_replies_not_read
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox