Homework #31 Sample Solution

Homework #31 Sample Solution

<p>Homework #31 sample solution:</p><p>9-15.</p><p>Problem: Hamiltonian path Input: A graph G, and vertices s and t Output: Does G contain a path which starts from s, ends at t, and visits all vertices without visiting any vertex more than once?</p><p>To prove Hamiltonian path is NP-complete, we show that Hamiltonian path is both in NP and NP-hard (by reducing Hamiltonian cycle to Hamiltonian path).</p><p>Hamiltonian path is in NP because we have a polynomial-time verifier with a path as certificate. The verifier will check if the path is a Hamiltonian path.</p><p>To show Hamiltonian path is NP-hard, we reduce Hamiltonian Cycle to it: Let G = (V, E) be a directed graph. Take any vertex u in V, let V’ = V – { v } U { v1, v2 } and</p><p>E’ = E U { (v1, u) | (v, u) in E } U { (u, v2, u) | (u, v) in E}. Let G’ = (V’, E’). It’s obvious that G’ can be constructed in polynomial time.</p><p>Claim: G has a Hamiltonian cycle iff G’ has a Hamiltonian path.</p><p>Proof of the claim is omitted here.</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us