ALGORITHM N COMPLEXITY (URGENT) 1.Build a model of the problem if such a model i
ID: 3692080 • Letter: A
Question
ALGORITHM N COMPLEXITY (URGENT)
1.Build a model of the problem if such a model is not provided.
2. Decide which class it belongs to: P, NP, NP-Complete, PSPACE.
3.If possible:
Propose a polynomial-time algorithm to solve it.
4. Analyze its time complexity.
Otherwise:
State the complexity of this problem.
5.Explain why.
We have a collection of n job requests to select from, each job i pays pi amount of reward. However, certain pairs of jobs cannot be selected together due to their time conflict. Gladly discovered that there are only exactly (n-1) pairs of conflicts but unfortunately, there is no job that is free of conflict with other jobs. The goal is to select the set of jobs that have no conflicts among themselves and also maximized the total amount of reward.
Explanation / Answer
1)
This problem is about dead lock avoidance problem.
So if any pair is busy ..
wait() //until new pair is available
processPair() //if available..start process
--------------------------------------------------------------------
2)
This class is NP-complete
we can solve this is in polynomial and non-polynomial time..
-------------------------------------------------------------------------------
3)
This problem is about dead lock avoidance problem.
So if any pair is busy ..
wait() //until new pair is available
processPair() //if available..start process
------------------------------------------------------------------------------
4)
Time complexity will be O(nm)
-------------------------------------------------
5)
Time complexity will be O(mn)
because we have m process and we have to wait n waits ... So O(nm)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.