An algorithm is software that runs a list of specified instructions for computations or problem-solving. We've often heard the word algorithm used with social media or video streaming. Much like any programming code, algorithms aren't inherently good or bad. They're strictly operating on the instructions they've been given.
What Makes Something an Algorithm?
One of the most significant indicators of algorithmic function is automation. By their nature, algorithms act as stand-ins for humans by using set values to determine a course of action for various inputs. Think about an internet search figuring out what results to present, a platform’s automated regulation of content that is or isn’t appropriate, and so on.
However, automated software isn’t necessarily an algorithm. Algorithms are like small automated processes for individual functions, while software automation often performs more than a single task without human oversight. So it’s more apt to think of automated software as a collection of several algorithms, each focusing on a different function within the whole. Think of algorithms as a predefined process that tells software how to reach a decision, and AI as software using data to make its own decision.
How Do Algorithms Work?
An algorithm starts with an initial input — numbers, words, visual content, etc Then, the program runs through its list to figure out what to do with it. The results will vary, depending on the algorithm’s purpose, and can include anything from numeric computations to making decisions. And those decisions can involve categorization, restriction, removal, tiering, promotion, etc.
For example, an algorithm may incrementally work its way through an ordered list of tasks, or it may perform tasks repeatedly on a loop. Algorithms can also work conditionally, performing something akin to IF-THEN (i.e. if X =Y, do Z) functions like you might find in basic programming or even use in Excel.
Types of Algorithms
With software continuing to become more complex as technology improves, more and more types of algorithms are being utilized. There are several classifications out there, but here are a handful of the more common forms:
- Backtracking: Tackles a problem piece by piece.
- Brute Force: Attempts to solve problems by testing as many iterations and solutions as possible until it finds one or more ways to complete the function.
- Divide-and-conquer: A 2-part process that breaks a problem into smaller chunks, then finds the answers to the smaller problems and puts them back together to create the solution.
- Dynamic Programming: Separates a problem into two smaller problems, and once it figures out their respective solutions, it remembers the results to apply them again in future problems.
- Encryption: Changes the properties of supplied data to make it more difficult to be understood without the associated decryption key.
- Greedy: Attempts to find the fastest solution to a problem and then applies that solution across the board, but being quick doesn’t always equate to being ideal.
- Hashing: Similar to encryption, information is “scrambled” to be unreadable, but the change is permanent and cannot be undone or deciphered later.
- Randomized: Often used with other algorithms to reduce calculation time, complexity, or memory usage by introducing random elements.
- Recursive: Runs repeatedly, with the values decreasing each cycle until the presented problem is solved.
- Search Engine: Uses provided keywords and other data to scour connected databases (or websites) to locate results that pertain to the initial input.
- Sorting: Reorganizes any supplied data (names, dates, prices, etc.) into an ordered list based on the algorithm’s set instructions.
How We Use Algorithms
In general, algorithms are designed to take the human element—be it a propensity for errors or susceptibility to tedium—out of the figurative equation. When working as intended, they let us focus more on larger complex tasks without getting bogged down with mundane busy work like repetitive calculations.
Many of us have created simple algorithms when sorting a spreadsheet with multiple columns. Another algorithm all of us have encountered is an internet search. Encryption algorithms are commonly used in the background on our smartphones to protect our data. And, of course, the often-discussed algorithms are always running in the background of popular social media apps, used to suggest posts based on observed behaviors.
Anything involving "machine learning," such as ChatGPT, Adobe's Firefly models, and other AI-driven processes, also uses algorithms. Of course, just as algorithms can be influenced (or biased) based on the data sets they're pulling from, the same can apply to AI.