Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site ut-sally.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!ut-sally!crandell
From: crandell@ut-sally.UUCP (Jim Crandell)
Newsgroups: net.lang
Subject: Re: Re: Optimization technique wanted...
Message-ID: <332@ut-sally.UUCP>
Date: Wed, 28-Nov-84 04:30:57 EST
Article-I.D.: ut-sally.332
Posted: Wed Nov 28 04:30:57 1984
Date-Received: Fri, 30-Nov-84 07:01:29 EST
References: <438@ima.UUCP> <258@scc.UUCP>
Organization: U. Texas CS Dept., Austin, Texas
Lines: 21

> A jump is first considered to be a long jump. If its target appears before
> the jump leaves the ring buffer, it collapses to a short jump.
> 
> I am not a mathmatician, but I belive that this algorithm is order O(n).
> 
> Any comments?

Well, since you asked, yes.  It is O(n).  It's also imperfect.  Since
you effectively make only one pass over the jump list, you get only the
first-order effects; i.e., you initially assume (correctly) that all
jumps will be long, so as the hope of shortening each one wanes, you
give up on it without allowing yourself to take advantage of the
abbreviation of its postrange caused by the shortening of jumps whose
destinations haven't appeared yet at the time of the decision.

Funny thing about O(p(n)) algorithms for NP-complete problems.  They
usually don't work quite right.
-- 

    Jim Crandell, C. S. Dept., The University of Texas at Austin
               {ihnp4,seismo,ctvax}!ut-sally!crandell