As the human understanding of many processes throughout their field expanded, computer science expanded through that empirical data and extrapolated from that idea or experiment. For example, genetic programming is an algorithm developed from the simulation of biological processes, using greedy algorithm. Many of these algorithms are developed from mimicking how experts from their field approaches a problem. The Knapsack algorithm is derived from statistical and a probabilistic analysis often the field of business, combinatory, complexity theory, cryptography and applied mathematics. Each field of study thrived on a combinatorial optimization of the problem, by analyzing every possible outcome for their optimal solutions. The Knapsack algorithm is formulated for problem of this form, given a threshold Theta, how many alphas can be accumulated, given that the sum of the alpha should not exceed, threshold Theta, where alpha has many different values. Many Computer Science theorists have explored this approach of solving many problems in the dynamic programming solution. A brute force approach is often used to solve a knapsack problem if the complexity is not polynomial.
Often a programmer has to classify a problem and decided which approach is optimal, which algorithm to implement to solve the problem.