(PR4)
(PR4)
BHUTAN
JIGME NAMGYEL ENGINEERING
COLLEGE
Practical Report 4
This approach is particularly useful in optimization problems, where the goal is to find the best
solution among a set of possible solutions. For example, it can be applied to problems like finding
the shortest path in a graph, minimizing costs, or maximizing profits.
One advantage of dynamic programming is that it can significantly improve the efficiency of
algorithms by avoiding redundant computations. This can lead to faster and more efficient solutions
for complex problems. It also provides a systematic and organized way to solve problems by
breaking them down into smaller, more manageable parts.
However, dynamic programming also has its disadvantages. One notable drawback is that it may
not be the most intuitive approach for certain types of problems, and identifying the optimal
substructure (breaking down the problem into subproblems) can be challenging. Additionally, the
storage of solutions to subproblems can consume a significant amount of memory, making it less
suitable for problems with large input sizes.
3) Procedure:
1. Define the mathematical problem, including the objective function, constraints, and decision
variable bounds.
2
2. Assign coefficients for the objective function and define the coefficients and right-hand side
values for the constraints.
3. Specify the bounds for each decision variable to ensure they meet the problem requirements.
4. Formulate a function that computes the objective value based on the current values of decision
variables.
5. Set up the initial conditions for the dynamic programming approach, including the number of
decision variables and constraints.
6. Develop a recursive function that explores possible solutions, updating decision variable values
while considering constraints and maximizing the objective function.
7. Print or display the maximum value of the objective function and the corresponding values of
decision variables obtained from the dynamic programming solution.
4) Analytical method:
3
4
5
5) Simulation method:
6
6) Result and discussion:
The optimum value of x is 1.1 and y is 0. The optimum value of objective function is approximately
3.3. This is also validated from practical. The maximization problem above was to maximize 3x – y
so it was obvious that to get maximum value, we need maximum value of x (which was 1.1) and
minimum value of y (which was 0). These maximum and minimum values were obtained from the
limits calculated in theoretical validation.
6) Conclusion:
After completing this practical, I came to understand that complex problem can be subdivided into
smaller problems so that it is easy to understand and solve. Dynamic programming is used both for
solving linear and non-linear optimization problems. It is done in two stages and value of one
variable is found in terms of the other. In the next stage, that value is used to find the other
variable.