Genetic Algorithm Improves Shellsort
gstover writes "As a personal programming project recently, I used a genetic algorithm to find a better sequence of increments for Shellsort. It found at least one sequence that out-performs the best previously known by about 5 percent. Here
is an article about it (also here).
I believe this is the first time a
genetic algorithm has actually improved Shellsort."
You'll be included in THE book & be famous
Mark
Personally, I am quite impressed with the concept of Genetic Algorithms.
I could imagine your shell sort could be applied to database technologies by creating a separate low priority thread that would generate the "gene pool" to improve the indexing of the tables in the background.
On a side note I am learning about genetic algorithms with hopes that I may work on it when I take my Masters in Computer Science.
Archie - CIO-for-hire
This may be the first time something potentially important hit Slashdot before being reported elsewhere! :-)
May we never see th
I guess it's a nice thing that shellsort is getting improved, and I do realize that this is great for genetic research, but, pardon me for being an uneducated ignorant bastard, does it have any practical value, seeing as quicksort is much faster than shellsort? Or am I wrong?
Now if only there could only be a genetic algorithm enhancement of current methods of finding the factors of large numbers whose factors are two very large primes.
simply well done
-- -- --
Help my mini cause: My journal
I don't mean to be a rube, but what exactly does this mean, what's the significance, and will this change my life for the better? tia.
"Notice that the mating process has nothing to do with the constraints placed on valid organisms."
I wish more women would read Slashdot. Chalk one up for the "Size Doesn't Matter" team.
"I chose single-point crossover as the method of mating because it is simple & generic."
I choose doggie style for the same reasons.
One of my professors at Midwestern State University (texas) has done this before. Although it seems you may have improved on his solution. (but I couldnt find a copy of his paper)
"Faster Shellsort Sequences: A Genetic Algorithm Application", Proceedings of the International Society for Computers and Their Applications(ISCA), April 7-9, 1999. (With Shashidhar Yachavaram) Presented at the conference, Cancun Mexico.
In Melanie Mitchell's wonderful book, "An Introduction to Genetic Algorithms", page 21-27, The author describes using genetic algorithms to find optimal patterns for "sorting networks". They are used for sorting chips (hardware) to sort in chunks of say 16 or 64 units. The order of comparisons is important. Using genetic algorithms, they were able to come very close to the best sequences found by humans. (I don't know if hardware sorting is still used. I had the impression that it is a mainframe thing.)
Thus, optimizing sorting algorithms with GA is not new in itself.
Table-ized A.I.
Here's Sedgewick's Shell Sort implementation in C
Samplesort vs Timsort.
Intro
-----
"This describes an adaptive, stable, natural mergesort, modestly called
timsort (hey, I earned it ). It has supernatural performance on many
kinds of partially ordered arrays (less than lg(N!) comparisons needed, and
as few as N-1), yet as fast as Python's previous highly tuned samplesort
hybrid on random arrays."
the sequence "run 8" in figure 2 in section 9 does not seem to be a valid sequence. I.e. it is not in sorted order and the number 13 appears twice. Is this a typo?
From a GA fan, and seeing all the articles on distributed computing...
You may also be interested in Tierra. Open-ended networked evolution - it's pretty nifty.
Got to love watching the computer solve problems for you. Ahh...
Keep your packets off my GNU/Girlfriend!
Are you sure the "improvement" is not an artifact of the particular random inputs used? This could easily explain such a small (5%) improvement.
Also, randomly ordered inputs are not common in practical applications. Did you test (or consider testing) partially sorted and partially reverse-sorted numbers? Presumably the contrived sequences (such as Sedgewick's) are balanced to provide good results for both random and non-random data.
...13 and 25 must be a typo. ...3716 1325 444... would make sense.
The comb sort is a variation of the bubble sort algorithm that achieves N log(N) execution times, similar to heapsort. The algorithm is simple and memory efficient, compared to Quicksort.
1 /c ombsort.htm
http://cs.clackamas.cc.or.us/molatore/cs260Spr0
http://world.std.com/~jdveale/combsort.htm
A paper about genetic algorithms, written by a guy named Gene.
You masturbate on the keyboard too?
Genetic algorithms are interesting in that they can become more efficient and modify themselves. I don't mean to sound like a ludite but is this a good way to develop algorithms?
/evolves you don't get the same output from the same input.. I guess thats the point, but I don't want my programs running like that.
Is the efficiency gained worth the difficulty in proving the new genetical enhanced algorithm works?
Its hard enough with vigorous testing to prove simple programs work without fail without introducing some random "Genetic" changes that may break the algorithm for some input cases.
One of the problems with AI and self modifing algorithms is that as it learns
Shell Sort works by roughly sorting, then sorting a little finer, and so on, until you finely sort every piece of data, and hopefully at this final and potentially most time-consuming step, there isn't a lot of work to be done.
The thing is, there's no platonic God-like perfect mathmatically-proven best choice of how fine or rough the early iterations should be. No matter what increments you use (within certain constraints) Shell Sort will still work every single time (the last step at increment 1 guarantees it) -- it's just a matter of performance. Nobody knows what increments work best, and you can't just mathmatically figure it out.
As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
I was extrapolating to the "AI Future" of much more complex algorithms being evaluated (evolved) in more fundamental ways then just changing parameters.
My frame of mind is has changed. Right now is I'm working on very time constrained real time stuff, and when I have to do it in X seconds I like to know what the worse case is, not best average case.
The genetic algorithm sounds like and iterative test to try and find the optimum increments for shell sort. Really nothing revolutionary.
I couldn't recall from the test description, but it doesn't seem that different arrays to sort were used to evolve the parameters of the sort (increment list). If this is the case the solution is just a sort optimized for a particular dataset and of little use.
I would be interested to see how well the algorithm would work elvolved against different random data sets (almost in order, always reverse order, random).
And then compared with others Standard increments.
They could have a competion like they have to come up with good prisoners delima algorithms, but instead come up with the best shell sort increments...
I thought Daniel Hillis(founder of Thinking Machines) published some similiar results at one of the Artificial Life conferences a few years ago.
The current system needs to be replaced, and that is the best method I can think of to replace it.
I truly and sincerely believe that you should think about that claim, and then think a whole lot harder about what you'd like to see replace it. There are plenty of places in the world, still, where the protections that we take for granted don't exist. I'm guessing you wouldn't like to be there a whole lot, and releasing all the stuff that's currently protected is a one-way trip.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
What protections do you take for granted? I don't like being here a whole lot either, but I guess it's better than being elsewhere on the planet for the time being.
You act as if the same things that were used before encryption becomes useless, will still be used after encrytion becomes usesless. When Encryption becomes invalid, at the very least transactions will have to be performed by armored truck. Hopfully the hassels involved will bring a sea change to a non monetary system, one in which if someone doesn't want to work then they are treated as an invalid, and that is their incentive to work instead of money.