Module36 - NP-complete and NP-hard problemsDefinition of...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: NP-complete and NP-hard problemsDefinition of complexity class NPNondeterministic computationProblems that can be verifiedThe P = NP QuestionConcept of NP-hard and NP-complete problemsTraditional definition of NPTuring machine model of computationSimple model where data is on an infinite capacity tapeOnly operations are reading char stored in current tape cell, writing a char to current tape cell, moving tape head left or right one squareDeterministic versus nondeterministic computationDeterministic: At any point in time, next move is determinedNondeterministic: At any point in time, several next moves are possibleNP: 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 TimeWe measure running time by looking at height of computation tree, NOT number of nodes exploredBoth computation have same height 4 and thus same running timeDeterministic ComputationNondeterministic ComputationND computation returning yesIf 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 NPHamiltonian PathInput: Undirected graph G = (V,E)Y/N Question: Does G contain a HP?Nondeterministic polynomial-time solutionGuess a hamiltonian path P (ordering of vertices)V! possible orderingsFor binary tree, V log V height to generate all guessesVerify guessed ordering is correctReturn yes/no if ordering is actually a HP Illustration123Yes input graph123132213231312321Guess PhaseNondeterministic---------------Verify PhaseDeterministic123No input graph123132213231312321Guess PhaseNondeterministic---------------Verify PhaseDeterministicAlternate definition of NPPreliminary Definitions...
View Full Document

Page1 / 23

Module36 - NP-complete and NP-hard problemsDefinition of...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online