How to solve this interesting problem?

Правка en1, от 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?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский fck_cheater 2021-06-13 16:12:40 498 Initial revision (published)