In problem solving, a method that always produces a problem solution (though not necessarily very efficiently) is known as algorithm. The algorithm is a defined procedure (set of step-by-step procedures ) that provides the correct answer to a particular problem and yields the best possible answer every time. This method is often expressed in the form of a graph.