Newsgroups: comp.ai.genetic
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!handel!jtoth
From: jtoth@handel.Princeton.EDU (Gabor J.Toth)
Subject: Re: how do I do "fitness-proportionate" selection?
Message-ID: <1995Feb26.163006.26908@Princeton.EDU>
Originator: news@hedgehog.Princeton.EDU
Sender: news@Princeton.EDU (USENET News System)
Nntp-Posting-Host: handel.princeton.edu
Organization: Princeton University
References: <3h8v33$pij@decaxp.harvard.edu> <D4BG3G.Kq7@westminster.ac.uk> <3iic11$p6u@sndsu1.sedalia.sinet.slb.com>
Date: Sun, 26 Feb 1995 16:30:06 GMT
Lines: 22

In article <3iic11$p6u@sndsu1.sedalia.sinet.slb.com>,
Nick Walton <walton@ukfca1.sinet.slb.com> wrote:

>Rather than scanning down an array of fitness totals, how about 
>  1. Generate the array of incremental fitness sums
>     together with the total fitness.
>  2. Generate a random value from the total
>     fitness
>  3. Binary search the array for an index i
>     such that a[i] < random value <= a[i+1]

This should be very efficient if you use selection *with* replacement. If
you use  selection  *without* replacement,  you'd  need to recompute your
array after each selection, which isn't that efficient. Whether selection
without    replacement is worth  the    trouble  is another question.  My
experience shows that  yes, but that  can  boldly depend on  the problems
you're working on.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Gabor J.Toth      jtoth@princeton.edu     http://www.princeton.edu/~jtoth
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

