MITB Banner

How Is An Algorithm Designed? Here’s The Thought Process Behind It

Share

If we said that your day began and ended with an algorithm, it would still be an understatement. From turning off eerie chimes of alarm clocks to pulling down the curtains after binge-watching Netflix, modern man is under a deluge of algorithms.

Designing the right algorithm for a given application is a creative process. A problem has to be identified, a solution has to be sculpted out — sometimes remote and often oblivious to the domain of problem under consideration. Eventually, these pieces of solutions are threaded together to work in congruence with each other like a well-oiled contraption.

Being a successful algorithm designer requires a certain attitude — the ability to ask oneself questions to guide through the thought process. To use it effectively, you must not only ask the questions but answer them as well. For an algorithm designer, there is never an answer which says just “no”. But, “No, because…”

Understanding The Problem

The first step for designing an algorithm is to begin with the premise of the problem itself, like, the components of an input and the desired results, or the importance of optimisation in obtaining the answers. Because this exploring this question will decide whether to use more or fewer steps in an algorithm. When the significance of an optimised solution gets decided, factors like speed come into the picture. As a numerical problem is different from a graph algorithm problem which in turn is different from a geometric problem. Different problems, different speed hence varied efforts.

Redundancy Check

This is more or a less an obvious one because who wants to reinvent the wheel? Every problem will be searched for available solutions both popular and obscure ones. In case of finding none, an algorithm designer has to recheck for other domains with sub-branches that overlap with the problem under consideration.

What Heuristics

Since, the above step gives an idea about the accuracies, time and speed, one can then conclude on the magnitude of effort required. And, if the solution is to be checked for precision and it needs a test which will lead to searching for the tests available or design a customised test. If a solution is found to be working then it should be checked for its repeatability i.e whether it gives approximately similar results with changing data; large value in the sample first or the smaller sample or a random one altogether. After determining the characteristic of the solution to certain samples, the ill-performing heuristics should be noted as well.

Checks And Balances To Make A Case For ML Algorithms

The sections prior to this dealt with how to start with a problem at a fundamental level. From a machine learning perspective, which deals with large chunks of unprepared, non-linear data, questions such as time and speed and, accuracies become increasingly important and the modern day gadgetry provisions it as well, with all the advancements in computational devices.

The following are few questions a machine learning researchers would face or should ask before they posit a new algorithm:

  • Are there any special cases for the problem under consideration?
  • Why can’t this special-case algorithm be generalized to a wider class of inputs?
  • How does the solution behave when few input parameters are left out?
  • Is there a way to split the problem into two smaller problems? Does this suggest a divide-and-conquer algorithm?
  • How can dynamic programming be used to exploit the order of the elements; like the branches in a decision tree?
  • Can directed randomness be used to simulate the actual scenarios?
  • Is the problem similar to NP-complete problem?
  • If yes, then is that the reason behind improper efficiencies?

Conclusion

Problem-solving is not a science, but part art and part skill. It is one of the skills most worth developing. And, finally, the most important question that a researcher should save for the last, like we did in the article is, why not start again from the beginning and work through these questions again and if any of these answers have changed since the last trip?  Noted author and computer researcher Steven Skiena rightly said, “In algorithms, as in life, persistence usually pays off.”

 

Share
Picture of Ram Sagar

Ram Sagar

I have a master's degree in Robotics and I write about machine learning advancements.
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Courses & Careers

Become a Certified Generative AI Engineer

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India

Subscribe to Our Newsletter

The Belamy, our weekly Newsletter is a rage. Just enter your email below.