Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Science

Deep Algorithms? 596

Stridar writes "A paper presented in a recent article quotes Donald Knuth as saying the computer science has 500 deep algorithms. He mentions that Euclid's algorithm is one of the most important, and he seems to agree with the idea that CS will be mature when it has 1000 deep algorithms. What I would like to ask Slashdot is the following. What are the most important algorithms in CS? What is your favorite algorithm? And finally, what are the outstanding problems for which algorithms would be immediately placed in the "Top 1000" category." We had an older story where two scientists picked their top ten algorithms.
This discussion has been archived. No new comments can be posted.

Deep Algorithms?

Comments Filter:
  • by cjpez ( 148000 )
    Does the Bubble Sort algorithm count as important?
    • by Odinson ( 4523 )
      Without bubble it would be impossible to obtain a bell curve in computer science classes.

      You're damn right it's important.

      • lol. See, its uses go on and on! Soon we'll find it cleaning up the environment and solving all of the world's complicated social problems!
  • My pick goes for RSA (Score:4, Interesting)

    by dgerman ( 78602 ) on Tuesday March 26, 2002 @05:16PM (#3230816) Homepage

    THe algorighm is simple, powerful and beautiful. Its properties allows to use for encryption or for authentication. It is simple enough that can be described in a piece of paper, and understood with basic mathematical background, and it affected the e-world in many different, some of them still to be seen.
  • Purely to add a little bit of the aesthetic to the list. [Check it out] [bu.edu]

  • by jwinter1 ( 147688 ) on Tuesday March 26, 2002 @05:51PM (#3230852) Homepage
    Of course,

    Lather. Rinse. Repeat.
    • by seanadams.com ( 463190 ) on Tuesday March 26, 2002 @06:49PM (#3231220) Homepage
      Lather. Rinse. Repeat.

      This fails the first requirement of an algorithm, according to Knuth:


      1 Finiteness. An algorithm must always terminate after a finite number of steps.
      - Knuth, TAOCP Vol 1, Page 4


      You know there's some guy still in the shower...
      • by blazin ( 119416 ) on Tuesday March 26, 2002 @07:00PM (#3231322) Homepage Journal
        I think at some point this algorithm should throw the outOfShampooException thus making it terminate after a finite number of iterations.

        Assuming everything shuts down correctly, the destructor or finalization method should be something along the lines of

        getOutofShower();
        self.dry(self);
        self.dress(s elf);
      • Heh...heh (Score:3, Funny)

        by waldoj ( 8229 )
        You know there's some guy still in the shower...

        OK, so it's 1987, and I'm 8 years old. My family has just gotten our first computer, an IBM PS/2 Model 30 -- one of the systems with BASIC in ROM. I''ve taken up writing in BASIC, and do so in most of my free time. Which, as an eight-year-old, is a considerably amount of time. I'd taught myself all about Boolean logic, loops, etc., etc.

        This is the part that I don't remember, probably because it's been obliterated by my family repeating the story so often. I've been in the shower for something like half an hour when my mother starts knocking on the door, wanting to know if I'm OK. I insist that I'm fine. This process is repeated for a while until they finally force me to get out, no doubt prune-like by this time. My mother asks me what in the world I've been doing in the shower for so long.

        I point to the directions on the back of the bottle and say, simply, "Wash. Rinse. Repeat."

        -Waldo Jaquith
  • I don't know the actual name of this algorithm. It's quite useful if, for example, you want to match items from two lists.

    You start with 2 sets of items that are related in some way. Next, you identify possible matching relationships. You then rank each relationship pair with some metric, sort the relationship list, and remove all lower ranking relationships. This leaves you with a list of the highest ranking relationships, with items appearing only once in the relationship list.

    This was a trivial exercise in Lisp (where I first implemented it), but I've used it quite a few times in various other languages. Anyone know the name of this?

  • by Sangui5 ( 12317 ) on Tuesday March 26, 2002 @05:55PM (#3230857)

    My personal favorite is the skiplist. O(ln n) insert, search, and delete in the average case. Simple to understand, has good constant factors, doesn't require maintence (unlike trees). Really, what more could you want?

    Here's the paper:

    ftp://ftp.cs.umd.edu/pub/skipLists (many formats) [umd.edu]
    PDF [umd.edu]
    • Skip list problems (Score:4, Insightful)

      by cpeterso ( 19082 ) on Tuesday March 26, 2002 @07:27PM (#3231503) Homepage
      As I noted in another post, one problem with skip lists is that each node must be dynamically resizable because the number of forward pointers is changing and not known at compile-time.

      Another problem with skip lists is that they are not very friendly to multiple readers and writers because the nodes provide unfortunate concurrency "chokepoints". In a binary tree, for example, subtrees can be locked without blocking readers in adjacent subtrees.
  • Topological Sort (Score:5, Interesting)

    by CvD ( 94050 ) on Tuesday March 26, 2002 @05:55PM (#3230862) Homepage Journal
    Resolving dependencies between any number things requires this very useful graph sorting algorithm.
  • Algorithms? (Score:4, Interesting)

    by FortKnox ( 169099 ) on Tuesday March 26, 2002 @05:57PM (#3230866) Homepage Journal
    Algorithms? Its all about PATTERNS now-a-days!

    Honestly, I don't think CS will be considered "mature" just by the number of complex algorithms it has.
    There's more to CS than algorithms.

    And, I always thought algorithms were grouped into "Discrete Mathematics" not "Computer Science" (granted, there is overlap, but isn't there overlap in most sciences??).
    • by dhogaza ( 64507 ) on Tuesday March 26, 2002 @06:04PM (#3230877) Homepage
      Well, one world-famous mathematician was once quoted as haughtily saying that "Computer Science is just a trivial subset of Discrete Mathematics"...
    • Re:Algorithms? (Score:3, Insightful)

      by Anonymous Coward
      There is a big difference between programming and computer science.

      Patterns have more to do with programming than computer science.

      My one professor was fond of telling us everytime we showed up in class, not understanding his advanced statitistical discussions of machine states and the like:

      "Oh yes, you are programmers, not Computer Scientists."
    • Re:Algorithms? (Score:4, Interesting)

      by wdr1 ( 31310 ) <wdr1@p[ ]x.com ['obo' in gap]> on Tuesday March 26, 2002 @07:44PM (#3231615) Homepage Journal
      Er, not really.

      It depends on what field you're working in. Patterns are all the rage in OOP, and especially in Java. No doubt about that. Alas, they alone do not encompass all that is technology.

      But, more to the point, patterns are a component of software engineering. Similiar to patterns, algorithms are a component of computer science. (Although it's probably safe to to say algorithms play a *much* larger compontent in CS, than patterns are in S.E.).

      What's the difference between software engineering and computer science? Hard to explain, but it's a little bit akin to the difference between Physics and Engineering. The former tends to deal with matters more theoritcal, the latter, matters more pratical.

      It worth noting that both algorithms and patterns feed into being a good software engineer, as least IMHO.

      -Bill

  • by Foresto ( 127767 ) on Tuesday March 26, 2002 @05:58PM (#3230868) Homepage
    I dont think I'd call it my favorite algorithm, but the Boyer-Moore string searching algorithm [utexas.edu] is pretty cool.
  • by td ( 46763 ) on Tuesday March 26, 2002 @06:02PM (#3230870) Homepage
    Quicksort
    The Unification Algorithm
    Skip Lists
    Conjugate Gradients
    Karmarkar's linear programming algorithm
    Knuth-Morris-Pratt string matching
    Multidimensional scaling
    The Kernighan-Lin TSP & graph-partitioning methods
    Lempel-Ziv compression
    Fast Fourier Transform
    Quine-McCluskey optimization
    Celine/Gosper/Zeilberger/Wilf algorithm for hypergeometric identities
    Fast Multipole method
  • by gpinzone ( 531794 ) on Tuesday March 26, 2002 @06:03PM (#3230874) Homepage Journal
    begin
    while alarm ringing
    cover head with blankets
    mprecate the onerous noisemaker softly
    consider turning the damn thing off
    if feeling remarkably hyperactive
    then
    lethargically slither out of blankets
    sinuously stretch out arm
    sigh
    bang it to kingdom come
    else
    go back to sleep sweet sleep
    endif
    if hear name being called
    then
    see who it is
    if kid brother/sister
    then
    ready
    aim
    fire
    watch baneful clock execute a parabolic trajectory
    in approximate direction of youngster
    if target intercepted
    then
    ignore howls for Amnesty International
    else
    swear a thousand maledictions
    endif
    else if father
    then
    get out of bed hyper-quickly
    if feeling watched
    then
    turn alarm off gently
    else
    kick alarm off gently
    endif
    else if mother
    then
    scan her for arms, especially those prohibited by
    Geneva Convention
    if result is affirmative
    then
    begin negotiations
    else
    pretend not to have seen her
    increase snoring intensity
    endif
    endif
    if feel something cold and wet being sloshed onto
    blankets
    then
    yell blue murder
    get out
    endif
    endwhile
    end

    Dinoj Surendran @ 1995 - no rights reserved
  • Hello World (Score:4, Interesting)

    by Wolfier ( 94144 ) on Tuesday March 26, 2002 @06:04PM (#3230879)
    One of the most important algorithms ever invented.

    Seriously, how about Simulated Annealing or Genetic Algorithm?
  • Ok, since we're all stuck on the Internet, which is something that has to grow in size continually, I'd say one the routing algorithm has got to be one of the most important. The Internet can't exist without it. Also to note is that we do need faster routing algorithms to cater for future addressing.
  • simplex method (Score:5, Interesting)

    by Gary Yngve ( 416254 ) on Tuesday March 26, 2002 @06:07PM (#3230882)
    It is so far-reaching.

    linear programming, minimax game searches, network flow, primal-dual techniques for approximation algorithms......
  • by Anonymous Coward
    * Randomized primality testing
    * Gaussian elimination
    * Euclid's gcd algorithm

    All three run in time polynomial in the bitlength of the input, yet the first thing that springs to mind is exponential time:

    primality testing: try dividing by every number between 2 and sqrt(N).
    matrix determinant: the straight definition has n! terms. With Gaussian elimination you can compute the determinant in O(n^3) time.
    gcd: factorize both number and compare? (ugh)

    Gotta appreciate algorithms that show real insight into a problem.
  • you can't forget bogosort [tuxedo.org]. :-)

    Paul

  • Favorite algorithms (Score:2, Interesting)

    by gewalker ( 57809 )
    Hashing algorithms. Stick that in your pipe and smoke it.

    On basis of frequency, it's obvious that simple algorithms are the most common. Linear search of an array, bubble sorts (no matter how bad they are), and linked lists are so common that its hard to believe that anything could be more popular (or frequently abused)
    • Hashes are just so useful. If I were among the group of people working on the C++ Standard Template Library I'd have stuck hashing containers in. Right now, things like hash_map are not a part of the official standard, BUT there are some good implementations out there. Supposedly, hashing containers are going to be in the next standard - hooray!
  • by JonWan ( 456212 ) on Tuesday March 26, 2002 @06:09PM (#3230891)
    The "Content Scrambling System" it seems pretty Damn important to the MPAA and Congress. They even passed a law (DMCA) to support it..
  • Anything from Photoshop to cellphones benefits from fast signal processing. A little complex analysis turns an O(n^2) algorithm to O(n log n).
  • by sketchy_gomez ( 566910 ) on Tuesday March 26, 2002 @06:11PM (#3230905)
    I'm going with the Fast Fourier Transform, because it is ubiquitous in signal processing and it has various number theoretic applications. As an added bonus: The Quantum Fourier Transform can be used in Shor's Algorithm to factor numbers in polynomial time! Although, this is not yet practically realizable..
  • 1) Patent the obvious
    2) Sue
    3) PROFIT!!
  • by Anonymous Coward
    IMHO, asking "what are the outstanding problems for which algorithms would be immediately placed in the "Top 1000" category?" reveals a misunderstanding of Knuth's article (All Questions Answered). In regards to "deep algorithms", Knuth was speaking of the maturity of computer science as a theoretical discipline, not as an engineering science. An algorithm is "deep" because it is beautiful (to use another of Knuths words), that is, it demonstrates a penetrating insight into the nature of computation. In this regard, the actual problem domain addressed by any given algorithm, in and of itself, is irrelevant. In fact, in the same article, Knuth is asked to give the five most important problems in computer science. He replies that he "doesn't like this top ten business", but prefers the "bottom ten". What is important, he says, is "the little things ... the stones in the wall".
  • The CORDIC Algorithm (Score:4, Informative)

    by Caractacus Potts ( 74726 ) on Tuesday March 26, 2002 @06:13PM (#3230922)

    COordinate Rotation DIgital Computer

    This algorithm is implemented by most FPUs and even some PGAs to calculate trigonometric and hyperbolic functions. It replaces the evaluation of those power series you've already forgotten about from school with a clever combinations of bit-shifts and additions. Back in the days when multiplications were much more expensive than additions, this is how it was done.

  • I have no idea how it works, but search engines have no trouble finding me pics of nekkid wimmenz. Kudos to whoever invented it!
  • Prune your betas! (Score:5, Interesting)

    by Logician007 ( 569132 ) on Tuesday March 26, 2002 @06:15PM (#3230939)
    Alpha-Beta Pruning or "minimax" is my favorite. It is a good way to trim your search space, but as far as I know pretty much is only used in strategy game playing. Chess specifically. The hard part about it is comming quantifying the value of the moves each player can make (Number of pieces, position on the board, tactics, blah!). Unlike most tradeoffs in CS, this one saves both time & space.
  • Clearly, the most important algorythm. ;)
  • I vote for the MD5 Checksum algorithm.

  • The papers (from IEEE Computational Science and Engineering) that describe the top 10 (numerical) algorithms are online at Stanford [stanford.edu]. This is an excellent collection of papers!
  • Deep vs. important (Score:5, Interesting)

    by phr2 ( 545169 ) on Tuesday March 26, 2002 @06:22PM (#3230993)
    Not all important (to practitioners) algorithms are deep, and vice versa. "Deep" algorithms are of course always important to theorists.

    Deep and important: fast fourier transform, simplex method, LLL lattice point algorithm,
    Schoof algorithm for elliptic curve point counting, etc.

    Deep and unimportant: interior-point linear programming (everyone uses the simplex method in practice despite its theoretically exponential worst case running time)

    Incredibly deep: Number Field Sieve. But whether it's important to practitioners is sort of a paradox.

    Shallow and important: ordinary arithmetic

    Shallow and unimportant: Slashdot moderation algorithm :-)
  • This has to be one algorithm that gets a mention. The idea is simple, but it's implementation is really effective.

    Paul.
  • Is my favorite. It was one of the few things I actually learned while in college - and found interesting.
  • by David Greene ( 463 ) on Tuesday March 26, 2002 @06:23PM (#3231010)
    Here are some of my choices, biased by my interest in compilers and computer architecture:
    • Chaitin-Briggs graph coloring: This gets good solutions to the NP-complete problem without taking too much time. This algorithm is the basis for most register allocation algorithms in compilers. Strangely, it's been said that this algorithm can't be used to allocate registers on machines like the x86 due to odd instruction formats and register restrictions. However, Matt Postiff's thesis [umich.edu] shows how it can be done.
    • Iterative Dataflow: The standard algorithm used for most compiler program analysis passes.
    • Tomasulo's Algorithm: This forms the basis for most of the modern high-performance microprocessor implementations available today. This along with CDC's Scoreboarding technique introduced the idea of out-of-order instruction execution.
    • X Prediction (where X = branch, value, dependency, way, etc.): Prediction is so fundamental to high-performance (and sometimes low power!) computing that it's important to recognize the contribution. There are about 3 original ideas in computer architecture and this is one of them.
  • Perhaps, hash tables and quicksort are the top software algorithms. They both are usually hidden from programmers (unless you're coding in low-level programming language), so we don't always $pay->{$attention} to the details.

    Just think about it, how many times the hash tables and sort algorithms were used to render this very page?
  • Without it Slashdot would not exist.
  • by PD ( 9577 ) <slashdotlinux@pdrap.org> on Tuesday March 26, 2002 @06:27PM (#3231035) Homepage Journal
  • My personal favorite (and one I use all the time) is Lewis Caroll [lewiscarroll.org]'s algorithm that allows you to find the day of the week [wlu.edu] (Monday, Tuesday, etc.) for any given date (for example, August 15, 2001 would return a Wednesday). It's pretty useful with our school's attendance system, which is written in Perl and run on Apache.

    Personally, I find it interesting that this algorithm was developed by the same guy who wrote Alice's Adventures in Wonderland [bibliomania.com]. A guy I teach with showed it to me a couple months ago, and I'm planning on using it in class soon to teach some programming concepts.

    First they ignore you, then they laugh at you, then they fight you, then you win. -- Gandhi

  • So what are the best texts on algorithms? I mean texts that describe the algorithm and cover the etiology and perhaps importance rather than just being a cookbook or leaving everything as an exercise for the reader?

    The Knuth books? Or is there something better?
  • I'm surprised that nobody has mentioned finite element analysis as the most important algorithm. Just about any modern structure built today is analyzed to determine it's structural characteristics using FE analysis. From a car bumper to the Sears Tower, it's all about FE.

  • OK... It's not deep... but using XOR to swap the value of two variables is pretty fun.
    No temporary storage needed!
    // Swap A and B

    A ^= B;
    B ^= A;
    A ^= B;
    // Swap of A and B complete

    Jono

  • I'm going to make the brave supposition that quantum computers will overcome the decoherence problem and scale to non-trivial sizes.

    (Even if this doesn't happen, the following algorithms still deserve honorable mention for being the first to make use of quantum parallelism to give results unattainable thus far by classical algorithms):

    - Shor's algorithm for factoring and discrete log
    - Grover's search algorithm
  • by SecurityGuy ( 217807 ) on Tuesday March 26, 2002 @06:38PM (#3231136)
    Gotta be inventing the Internet! How could you top that?
  • by leob ( 154345 ) on Tuesday March 26, 2002 @06:39PM (#3231147)
    The funniest, while quite deep, algorithm is a text compression (or, rather, transformation) algorithm called Burrows-Wheeler Transform [dogma.net]. It is quite a surprizing realization that you can write the letters of a message in a somewhat "sorted" way, but it is still possible to restore the message. The algorithm was only invented in the 1980's, but it is so simple and cute that even (bright) children can understand it and use it for "cryptograms". I am somewhat surprized that it was not invented earlier.

    Speaking of sorting, the scientists contemporary to Galileo used it to "patent" their yet unverified ideas and hypotheses by publishing a "one-way hash" of the statement describing the idea by alphabetically sorting the letters of that statement. E.g. a hypothesis "Mars has two satellites" will be "Aaaeehillmorsssstttw". Of course, to be secure, the statement must be much longer.

  • Natural selection is the algorithm that solves all of life's problems :)
  • by Ungrounded Lightning ( 62228 ) on Tuesday March 26, 2002 @06:43PM (#3231169) Journal
    My favorite is Djikstra's Communicating Semaphores, along with the related algorithms documented in Djikstra & Riddle's paper "The 'T.H.E.' multiprogramming System".

    With Mark Weiser's addition of the "T" primative (more commonly called "non-blocking P" i.e. "Try to P but if that would block return an error flag instead.") you have a fantastically powerful tool in a tiny amount of code.

    For instance: I was able to implement a kernel for an actor-based, real-time, prioritized, preemptive multitasking system, including initialization code, an idle task, and a minimal startup task table (i.e. everything but the application tasks and device drivers):

    - In under 512 bytes of code and initialization data.
    - On an 8080.

    Communicating P, V, and T, (along with a flavor of "V" doubling as a return-from-interrupt) are a complete set of primitives for such work.

    For those not familiar, an "actor" in this context is a class such that each instance of that class or any subclass of it is a separate thread of execution. Messages are exchanged between threads via queues on semaphores rather than C++ member function calls / Smalltalk message sends, but otherwise all the object-oriented concepts apply directly.

    Communicating Semaphores handle locking (like normal semaphores), message queueing, and resource allocation (by holding a queue of messages, each of which represents, or actually is, a resource).

    "T" lets interrupt routines run initially as parasites on the interrupted task, then "T" a free-message-buffer queue, fill in the message, and "V" it to the incoming-work semaphore of the actual service routine as the interrupt exits - provoking a context switch if the service routine is higher priority than whatever was running. The interrupt routine can punt and return to the interrupted task if no buffers are available.
  • There's some good ones (like QuickSort) that should be #1, but here's a random collection of some algorithms I find interesting:

    • The recursive-descent parser generator
    • Regular expression to DFA algorithm (it's its own proof!)
    • The Lisp interpreter written in Lisp (and no you can't use eval). An elegant algorithm demonstrating how data and code can become one.
    • The Mini-Max Algorithm
    • The Backfeed Neural Network Algorithm
    • Euclid's greatest common divisor algorithm (technically not a computing science algorithm)
    • Mandelbrot set algorithm
    • The Ray-Tracing algorithm
  • My vote: The Bresenham Line algorithm. It provides the most efficient method to draw arbitrary lines on a raster (ie. pixel-based) screen. All 3D Graphics are heavily dependant on this beautiful algorithm.

    There have been improvements to the Bresenham line, effectively quadrupling the draw speed over the base Bresenham algorithm.

    But the base aspect of Bresenham's work is critical: It allowed the drawing of lines on our computer screens using integer, rather than floating point, arithmetic. 3D Graphics wouldn't be the same without his contribution.
  • 1000 is too naive (Score:5, Interesting)

    by B.D.Mills ( 18626 ) on Tuesday March 26, 2002 @07:04PM (#3231353)
    500 deep algorithms, 1000 is maturity? To me this sounds a bit like like Bill Gates saying that 640K is enough for anyone, or the ancient Greeks saying that mathematics is mature because Euclid has codified his geometric axioms, or the head of the US patent office saying that everything's been invented in 1899. (All of which are probably apocryphal, but I digress.)

    It's too premature. Computer science has been around for little over half a century. Who knows what will be discovered in the centuries ahead? Mathematics is the source of many algorithms, yet new discoveries are being made in mathematics even now. Don't stop searching when we get to 1000. There's still going to be many new and wondrous algorithms to discover for the geniuses of the future.
    • Maybe, if you'd read what prof. Knuth said, you'd know he mentioned the 1000 algorithm as a START. About the number of algorithms the CS should have to START to be recognized as a relevant science.

  • by cube farmer ( 240151 ) on Tuesday March 26, 2002 @07:10PM (#3231391) Homepage

    Since I'm not formally trained as a computer scientist (I'm merely an information technology major, sorry), I can't offer much in the way of "deep" algorithms to this list.

    However, I can poke fun...

    My personal favorite algorithm is:

    1. Launch Web Site
    2. ??????
    3. Profit!

    (Ducks)

  • by Anonymous Squonk ( 128339 ) on Tuesday March 26, 2002 @08:42PM (#3231965) Journal
    If x=2 Then y=2 Else y=1

    Where x is the number of people in the elevator and y is the number of people who know for sure who farted.

  • by grytpype ( 53367 ) on Tuesday March 26, 2002 @09:55PM (#3232311) Homepage
    I think what Knuth means by "deep algorithm" is one that seems fundamental, something that tells us about the nature of reality, not necessarily something that is useful.
  • by zook ( 34771 ) on Wednesday March 27, 2002 @02:45AM (#3233279)
    Pessimal Algorithms and Simplexity Analysis [nec.com] Read it---you'll like it. Find out the best algorithm to use if your boss makes you sort a list in Paris.

"I've seen it. It's rubbish." -- Marvin the Paranoid Android

Working...