For anyone interested or stuck in a similar problem: it's NP-complete. Thanks to the fact that I pointed to the thread in cstheory.
To understand why it is NP-complete, first of all, we note that the problem can be formulated as follows: taking into account a weighted directed graph G with N verifications and an edge E on G, find out if E lies on a (simple) negative cycle. If so, E should be in subgraph H. If it is not, it should not be in H.
Now let the edge E be equal to E = (u, v) with weight w. We would like to know if there exists a path from v to u with a total weight W such that W + w <0. If we could do it in polynomial time, we could also solve the Hamiltonian cycle problem in polynomial time:
Give edge E a weight of N - 1.00001. Assign all other edges in the graph a weight of -1. Now the graph of only the negative cycle on which E lies is a cycle containing all the vertices (this cycle has a weight of -0.00001) and, therefore, is a Hamiltonian cycle.
Thanks so much for thinking!
source share