Given a DAG (V, E), find the maximum subset V' of V so that every vertex in V' can't reach other vertices in V'. |V| <= 3000, |E| <= 20000
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
Given a DAG (V, E), find the maximum subset V' of V so that every vertex in V' can't reach other vertices in V'. |V| <= 3000, |E| <= 20000
Название |
---|
Auto comment: topic has been updated by start_over (previous revision, new revision, compare).
The problem wants the largest antichain in the poset defined by the transitive closure of the DAG (so we assume that the graph is the transitive closure of itself — this can be done in $$$O(VE)$$$). You can show that it is the size of the min-cut in the graph defined as follows: the vertex set consists of a source $$$s$$$ and a sink $$$t$$$, every vertex $$$v$$$ in the DAG corresponds to two vertices $$$v_1, v_2$$$, there are edges $$$(s, v_1)$$$ and $$$(v_2, t)$$$, and for any $$$(u, v)$$$ in the DAG, there is an edge $$$(u_1, v_2)$$$. All edges have capacity $$$1$$$. Since this is a unit network, finding the max flow using Dinic will be $$$O(E \sqrt{V})$$$, and recovering the min cut can be done in linear time. So the overall complexity is $$$O(VE + V^{2.5})$$$.
I'm not sure if this is the correct solution or not. For the DAG with no edge, the answer is |V|, but the min-cut for graph created by your solution is 0.
My bad, I had intended to write the complement of the min cut in some sense instead of the min cut. The vertices that form an antichain are the vertices $$$v$$$ such that $$$v_1$$$ and $$$v_2$$$ are in different partitions of the cut. Hopefully this clears the confusion.