patternMinor
Time complexity of a precedence constrained selection problem
Viewed 0 times
problemselectionconstrainedtimeprecedencecomplexity
Problem
I wonder if you have an idea over the time complexity of the following problem, or a problem similar to this one (generally a selection problem)
[Assuming operations on integers take O(1) time]
We are given a set $N$ of $n$ items, that are subject to general precedence constraints (a partial order $E$ on $N$). The problem could then be represented by an acyclic directed graph $G(N,E)$ where the nodes represent items and edges represent precedence constraints. Each item has a selection cost $c_i$ that may be positive, zero, or negative. The objective is to find a subset $S \subseteq N$ of items that is precedence feasible, i.e., $\forall i \in S:\{j \in N|(j,i) \in E\}\subset S$, and minimizes the total selection cost $F(S)=\sum_{i \in S}c_i$.
I tried to find a reduction from CLIQUE or 3-Dimensional Matching, but I couldn't.
Thank you in advance :)
[Assuming operations on integers take O(1) time]
We are given a set $N$ of $n$ items, that are subject to general precedence constraints (a partial order $E$ on $N$). The problem could then be represented by an acyclic directed graph $G(N,E)$ where the nodes represent items and edges represent precedence constraints. Each item has a selection cost $c_i$ that may be positive, zero, or negative. The objective is to find a subset $S \subseteq N$ of items that is precedence feasible, i.e., $\forall i \in S:\{j \in N|(j,i) \in E\}\subset S$, and minimizes the total selection cost $F(S)=\sum_{i \in S}c_i$.
I tried to find a reduction from CLIQUE or 3-Dimensional Matching, but I couldn't.
Thank you in advance :)
Solution
If you flip the signs on your costs and reverse edge directions, this is the Closure Problem, also known as the Open-Pit Mining Problem, and it's actually solvable in polynomial time using a rather non-obvious transformation into maximum flow.
The algorithm is described in the Wikipedia page linked above. Briefly, it involves setting the capacity of each edge to infinity, which has the effect that any minimum cut avoids all original graph edges in the forward direction (since any cut that included such an edge would have infinite flow), and adding a new edge to each vertex from one of two new vertices, $s$ (for positive-weight vertices) or $t$ (for negative-weight vertices). The capacity of any $s$-$t$ cut magically works out to be a constant minus the total weight of vertices on one side of the cut, so minimising this (which can be done by a max-flow algorithm) maximises said total weight!
The algorithm is described in the Wikipedia page linked above. Briefly, it involves setting the capacity of each edge to infinity, which has the effect that any minimum cut avoids all original graph edges in the forward direction (since any cut that included such an edge would have infinite flow), and adding a new edge to each vertex from one of two new vertices, $s$ (for positive-weight vertices) or $t$ (for negative-weight vertices). The capacity of any $s$-$t$ cut magically works out to be a constant minus the total weight of vertices on one side of the cut, so minimising this (which can be done by a max-flow algorithm) maximises said total weight!
Context
StackExchange Computer Science Q#65108, answer score: 2
Revisions (0)
No revisions yet.