Different Algorithm Types: A Primer

Source: blogs.cfainstitute.org

Algorithms are so commonplace today that we’ve come to take them for granted – so much so that we can be forgiven for thinking that all algorithms are the same or perform the same tasks.

But depending on what kind of context they’re being employed in, algorithms can yield vastly distinct results. Below we’re taking a look at three of the most common types of algorithms we interact with on a day-to-day basis.

Collaborative Filtering Engines

Source: towardsdatascience.com

The most common algorithms we interact with on social media, web stores, and OTT media services typically fall into two camps – Collaborative Filtering Engines and Content-Based Filtering engines.

While they have key similarities and even occasionally overlap in hybrid systems, they’re use-cases are quite distinct. Collaborative Filtering algorithms, for example, are based on the interactions and feedback of an individual user.

By tracking the behaviour of a user, a CF algorithm makes predictions and suggestions drawn from the activity of users it finds to be similar. This is commonly found on social media networks, where a user’s personal timeline or feed will slowly come to reflect their interests as the algorithm learns their preferences and populates their feed with content that it finds similar users engaged with.

Random Number Generators

While the other algorithms discussed here each operate with a specific and shared goal in mind – that of helping users filter through information – in certain situations, algorithms are employed for a wholly distinct purpose.

Such is the case with RNGs, short for random number generator, which are algorithmically-led tools designed to simulate or emulate randomness. While such randomisers do crop up on media platforms, such as the shuffle button on your Spotify playlists, RNGs are specifically more closely associated with the world of gaming.

Games, from RPGs to those found in an online casino, rely on RNGs to ensure randomised outcomes, creating an engaging and unpredictable experience. Take, for example, a popular game that belongs to the RPG genre. In these games, players must navigate a large map, battle monsters, and uncover treasure. Meanwhile, in a casino, players might spin a slot machine, trusting the RNG to produce a fair and random result each time.

One of the most popular and enduring mechanics of RPGs is randomised loot drops. This refers to gold, items, and even rare weapons and armour that get left behind when you defeat an enemy.

Certain games will employ randomised percentages for specific items. For example, in World of Warcraft, high-level bosses often offer the chance of dropping extremely rare items only 3% of the time. The decision as to when to drop said item comes down to an RNG.

Likewise, when fighting a monster, the chance of landing a critical hit will likewise be determined by RNGs. This type of algorithm is also commonplace in digital variants of table games and slot titles, where they must step in to simulate the randomisation of their real-world counterparts.

Content-Based Filtering Engines

Source: upwork.com

Whereas CF engines take as their focus the activity of the user, content-based engines draw their conclusions from their item databases. You will most commonly find CB engines in use on e-commerce platforms like Amazon. Unlike CF engines, these do not need training on user activity and thus can make recommendations instantaneously.

CB engines use contextual information to make predictions. For example, if such an algorithm notes that you have placed an inflatable mattress in your shopping cart, it would likely take this as a cue to suggest that you also might want to purchase an air pump.

This conclusion is drawn on all the data it has at its disposal about which items thematically or conceptually overlap with one another.

However, this method does come with limitations as it’s a ‘flatter’ algorithm, in as far as it doesn’t train itself on individual user preferences. To get around this, most now incorporate some features of collaborative-filtering also, to get the best of both worlds.

Optimization Algorithms

Ever wonder how some systems seem to effortlessly find the best solution from a range of options? That’s the magic of optimization algorithms at work. They are the unsung heroes behind many of our daily activities and complex processes, be it in business operations or the realm of machine learning.

Imagine a delivery company trying to chart the fastest route for its fleet while saving on fuel and ensuring more deliveries. That’s where an optimization algorithm steps in, sifting through countless route possibilities to pinpoint the most efficient one. Likewise, when machine learning tools predict the weather or stock market trends, these algorithms are there, fine-tuning the system for the best outcome.

Search Algorithms

Source: volusion.com

Then there are search algorithms, the behind-the-scenes wizards helping us find specific pieces of data in vast datasets. They power everything from our favorite search engines to databases.

Think about the times you’ve typed something into Google. What you might not see is the intricate search algorithm diving deep into the vast ocean of the internet, fishing out the most relevant web pages for you. In a more technical sense, search algorithms, like the binary search, are used to quickly spot specific values in organized lists.

And let’s not forget e-commerce sites. Hunting for that perfect product? It’s a search algorithm that brings forward the top choices, considering factors like your past preferences, product reviews, and so much more.

Data Sorting Algorithms

Another cornerstone in the algorithmic domain is data sorting algorithms. As the digital universe expands, organizing this vast amount of information becomes not just a luxury but a necessity. These algorithms efficiently arrange data into a particular sequence, making subsequent data retrieval and processing faster and more manageable.

Consider the contact list on your smartphone. Every time you add a new contact, a sorting algorithm works silently to place this entry in alphabetical order, ensuring you can find it later with ease. Similarly, in online stores, when you opt to view products by price or customer ratings, sorting algorithms swing into action, arranging items as per your preference.

Moreover, in financial sectors, where transactions happen by the second, sorting algorithms help in organizing vast datasets chronologically or by transaction amounts. By streamlining the chaotic world of data, these algorithms act as the unsung caretakers, simplifying our interactions and ensuring efficiency across various digital platforms.