# Module36 - NP-complete and NP-hard problems•Definition of...

This preview shows pages 1–9. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: NP-complete and NP-hard problems•Definition of complexity class NP–Nondeterministic computation–Problems that can be verified•The P = NP Question–Concept of NP-hard and NP-complete problemsTraditional definition of NP•Turing machine model of computation–Simple model where data is on an infinite capacity tape–Only operations are reading char stored in current tape cell, writing a char to current tape cell, moving tape head left or right one square•Deterministic versus nondeterministic computation–Deterministic: At any point in time, next move is determined–Nondeterministic: At any point in time, several next moves are possible•NP: Class of problems that can be solved by a nondeterminstic turing machine in polynomial timeTuring MachinesA Turing machine has a finite-state-control (its program), a two way infinite tape (its memory) and a read-write head (its program counter) 111111HeadTape….….Finite StateControlNondeterministic Running Time•We measure running time by looking at height of computation tree, NOT number of nodes explored•Both computation have same height 4 and thus same running timeDeterministic ComputationNondeterministic ComputationND computation returning yes•If any leaf node returns yes, we consider the input to be a yes input.•If all leaf nodes return no, then we consider the input to be a no input.Yes ResultNo ResultShowing a problem is in NP•Hamiltonian Path–Input: Undirected graph G = (V,E)–Y/N Question: Does G contain a HP?•Nondeterministic polynomial-time solution–Guess a hamiltonian path P (ordering of vertices)•V! possible orderings•For binary tree, V log V height to generate all guesses–Verify guessed ordering is correct–Return yes/no if ordering is actually a HP Illustration123Yes input graph123132213231312321Guess PhaseNondeterministic---------------Verify PhaseDeterministic123No input graph123132213231312321Guess PhaseNondeterministic---------------Verify PhaseDeterministicAlternate definition of NP•Preliminary Definitions–...
View Full Document

{[ snackBarMessage ]}

### Page1 / 23

Module36 - NP-complete and NP-hard problems•Definition of...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online