Imagine that you have a problem (mathbf{P}) that you know is (mathcal{N P})-complete. For this problem you
Question:
Imagine that you have a problem \(\mathbf{P}\) that you know is \(\mathcal{N P}\)-complete. For this problem you have two algorithms to solve it. For each algorithm, some problem instances of \(\mathbf{P}\) run in polynomial time and others run in exponential time (there are lots of heuristic-based algorithms for real \(\mathcal{N P}\)-complete problems with this behavior). You can't tell beforehand for any given problem instance whether it will run in polynomial or exponential time on either algorithm. However, you do know that for every problem instance, at least one of the two algorithms will solve it in polynomial time.
(a) What should you do?
(b) What is the running time of your solution?
(c) What does it say about the question of \(\mathcal{P}=\mathcal{N} \mathcal{P}\) if the conditions described in this problem existed?
Step by Step Answer:
Practical Introduction To Data Structures And Algorithm Analysis Java Edition
ISBN: 9780136609117
1st Edition
Authors: Clifford A. Shaffer