I have two seperate problems both revolving around graphs and determining an approach to find a simple path from s to t that goes via as many blue vertices as possible. Additionally I have to determine which one of the two problems that is NP-Hard.
The graph in the first problem is an undirected graph where some of the vertices are blue and the graph in the other problem is a a directed acyclic graph also where some of the vertices are blue.
I have got a hint that the second problem with the directed acyclic graph, can be solved using dynamic programming, but I have a very hard time grasping how the problem can be modelled as a dynamic programming problem, as I do not quite see the overlapping of subproblems. Maybe one could demonstrate or clarify how this can be done?
Also the first problem should be the NPHard one, that can be reduced to a Hamiltonian Path, I can partly see how this is correct, but then the question arises, can the second problem with the directed acyclic graph then also be reduced to a Hamiltonian Path, also making it NPHard? Why or why not?