Dynamic programming, when referring to the field of computer science, describes a group of similar computer algorithms meant to solve complex problems by breaking the problem down into sets of smaller problems. First created by Richard Bellman in the 1950s, dynamic programming works with problems that are either overlapping subproblems or optimal substructures. To understand how dynamic programming works, it's best to understand the concept behind these two terms.
Overlapping subproblems describe complicated equations which, when broken down into smaller sets of equations, reuse parts of the smaller equations more than once to reach an answer. For example, a mathematical equation told to calculate all possible results using a set of numbers may calculate the same result numerous times while calculating other results only one time. Dynamic programming would tell this problem that after calculating the result the first time it should save that result and plug the answer into the equation later on instead of calculating it again. When dealing with long complex processes and equations, this saves time and creates a faster solution using far fewer steps.
Optimal substructures create a solution by finding the best answer to all subproblems and then creating the best overall answer. After breaking down a complex problem into smaller problems, the computer then uses a mathematical system to determine what the best answer for each problem is. It calculates the answer to the original problem from the smaller answers. Flaws do exist with this process. While it gives the solution that works the best mathematically, it may or may not be the best solution in real life, depending on the type of problem and how it relates to the real world.
During any of these operations, the dynamic programming algorithm tries to find the shortest path to the solution. It can take one of two approaches to do this. The top-down approach breaks the equation down into smaller equations and reuses the answers for these equations when necessary. The bottom-up approach tries to solve the smallest mathematical value after breaking the equation down and then works its way up toward the largest from there. Both approaches save time, but dynamic programming only works when the original problem can break down into smaller equations that at some point are reused to solve the equation.
exception 'Exception' with message 'error writing captcha: Duplicate entry '2147483647' for key 'PRIMARY'' in /ssd/www/wisegeek/public_html/_core/classes/public/Captcha.php:44 Stack trace: #0 /ssd/www/wisegeek/public_html/_core/controls/public/ControlDiscussionPostBox.php(324): Captcha->createCaptcha() #1 /ssd/www/wisegeek/public_html/framework/classes/Control.php(104): ControlDiscussionPostBox->preRender(false) #2 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): Control->render() #3 /ssd/www/wisegeek/public_html/tpl/default-nocustom-lu/pages/public/article/article.htm(526): Control->__toString() #4 /ssd/www/wisegeek/public_html/framework/classes/Control.php(300): require('/ssd/www/wisege...') #5 /ssd/www/wisegeek/public_html/framework/classes/Control.php(309): Control->requireTpl('pages/public/ar...', Object(PageArticleCom), true) #6 /ssd/www/wisegeek/public_html/framework/classes/Control.php(131): Control->renderTpl('pages/public/ar...', Object(PageArticleCom)) #7 /ssd/www/wisegeek/public_html/framework/classes/FormDataControl.php(87): Control->renderTemplate() #8 /ssd/www/wisegeek/public_html/framework/classes/Control.php(109): FormDataControl->renderTemplate() #9 /ssd/www/wisegeek/public_html/framework/classes/ScriptPage.php(50): Control->render(false) #10 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): ScriptPage->render() #11 /ssd/www/wisegeek/public_html/framework/classes/Page.php(97): Control->__toString() #12 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(443): Page->processRequest() #13 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(7): PublicFrontController->renderPage() #14 /ssd/www/wisegeek/public_html/index.php(11): PublicFrontController::run() #15 {main}