How to solve this interesting problem?

Revision en1, by fck_cheater, 2021-06-13 16:12:40

We are given some graph nodes and every node has three things:

  1. Cost to include this node

  2. Money we get while we include this node.

  3. It's parent who should be included if this node is included ( It's may possible to not having a parent for some node )

Now I have to choose some nodes out of these such that total cost of selected nodes shouldn't exceed M and we should be able to earn maximum possible money.

How to solve this problem?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English fck_cheater 2021-06-13 16:12:40 498 Initial revision (published)