You can reduce a given cover issue. This means that your NP problem is difficult and you should not expect to find an effective solution (in general).
, , , , , (, / , ). 2 ^ P * (N + M) , P - , N M - .
:
, S = {s [1],..., s [n]} S: S [1], S [1], S [2],..., S [N]. , S.
, , . START, END (S [i], t) t S [i]. :
- START (S [i], s [1]) S [i] s [1] S [i]
- (S [i], s [n]) END S [i] s [n] S [i].
- (S [i], s [k]) (S [i '], s [k + 1]) k 1... n-1 S [i] S [ '], .
- 1, (S [i], s) 1. / (S [i], s), (S [i], t) . /, .
START END S [i], S. 1 + n + p, p - .