Solve a dynamic programming problem that requires finding the optimal path through a multi-dimensional state space under specific constraints.