The basic principle of dynamic programming.

Solving programming-related tasks can often require many system resources that will be unreasonably occupied over time.


As the experience of various sciences shows, the application of an analytical approach to solving complex problems ensures their solution in a shorter time than trying to solve a complex problem in a complex.


It was this experience that was used in developing the theory of dynamic programming.


So, the main goal of dynamic programming is to create the optimal substructure, which will highlight the optimal solution to small problems that are integral elements of a complex task.


The solution will be considered optimal if it can provide a solution to the original problem.


If we take as an example the situation from life, then when a tourist thinks about what places to go in Cyprus, this task will be transformed into the sub-tasks “freedom of use by means of transport”, “wealth of the city’s cultural fund”, “shopping opportunities”.


When solving these subtasks, the main significant points for the tourist in visiting Cyprus as a whole are highlighted, after which a decision is made regarding the route of the trip.


Dynamic programming whose task is to solve complex problems includes several stages of selecting the optimal substructure.


The first step is to split a large task into several subtasks much smaller in size.


At the second stage, if the solution of the subtask is complicated, then we recursively go through all three stages with the subtask.


The third stage is to use the solution that we found for the subtask, with the goal of finally solving the complex problem with which the first stage began.