Project selection problem expansion

Правка en3, от hxano, 2025-03-31 08:51:11

I have been stuck on this problem for a few days now. It seems to be an expansion of the Project selection problem (PSP).

For those unfamiliar with PSP, it goes something like this: There are $$$n$$$ projects to be completed, the project $$$i$$$ will add $$$a_i$$$ money to your total ($$$a_i$$$ can be negative), and there are $$$m$$$ dependencies, where the project $$$u$$$ requires the project $$$v$$$ to be completed before being completed itself. Your goal is to choose projects to complete so that the total sum of money is maximized. This can be easily solved using a minimum cut model as described in this blog.

We can restate the problem a bit more formally: Maximize the sum $$$S = \sum_{1 \le i \le n} a_i \cdot t_i$$$, so that $$$\forall 1 \le i \le n, t_i=0$$$ or $$$t_i=1$$$, and $$$\forall 1 \le j \le m$$$, if $$$t_{u_j}=1$$$ then $$$t_{v_j}=1$$$.

What my problem deals with, is the dependencies taking on different forms, such as "if $$$t_{u_j}=0$$$ then $$$t_{v_j}=1$$$", "if $$$t_{u_j}=1$$$ then $$$t_{v_j}=0$$$", and "if $$$t_{u_j}=0$$$ then $$$t_{v_j}=0$$$".

I'm also aware of this blog, which seems very reminiscent of the matter, but I was unable to derive a definite solution from it on my own.

I would love some help from Codeforces!

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский hxano 2025-03-31 08:51:11 89
en2 Английский hxano 2025-03-31 08:49:50 30 (published)
en1 Английский hxano 2025-03-31 08:48:40 1260 Initial revision (saved to drafts)