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 DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: NPcomplete and NPhard problemsDefinition of complexity class NPNondeterministic computationProblems that can be verifiedThe P = NP QuestionConcept of NPhard and NPcomplete 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 finitestatecontrol (its program), a two way infinite tape (its memory) and a readwrite 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 polynomialtime 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 PhaseNondeterministicVerify PhaseDeterministic123No input graph123132213231312321Guess PhaseNondeterministicVerify PhaseDeterministicAlternate definition of NPPreliminary Definitions...
View
Full
Document
 Fall '07
 TORNG

Click to edit the document details