DS-chapter9(NP-completeness&auml;&iquest;&reg;&aelig;”&sup1;)

# DS-chapter9(NP-completeness&auml;&iquest;&reg;&aelig;”&sup1;)

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

CHAPTER 9 Graph Algorithms 9.7 Introduction NP -Completeness Introduction NP -Completeness The Euler circuit problem :find a path that touches every edge exactly once Time is Linear. The Hamiltonian cycle problem :find a simple cycle that contains every vertex. No linear algorithm. The single-source unweighted shortest-path problem for directed graphs is solvable in linear time . The longest-simple –path problem is not solvable in linear time. A brief H quick and informal discussion

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

View Full Document
Applications of Depth-First Search 3. Euler Circuits Draw each line exactly once without lifting your pen from the paper – Euler tour Draw each line exactly once without lifting your pen from the paper, AND finish at the starting point – Euler curcuit P Proposition H An Euler circuit is possible only if the graph is connected and each vertex has an even degree. HProposition H An Euler tour is possible if there are exactly two vertices having odd degree. One must start at one of the odd- degree vertices.
Applications of Depth-First Search 2 6 9 8 3 7 1 12 4 10 5 11 Note: The path should be maintained as a linked list. For each adjacency list, maintain a pointer to the last edge

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.

## DS-chapter9(NP-completeness&auml;&iquest;&reg;&aelig;”&sup1;)

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

View Full Document
Ask a homework question - tutors are online