Adleman-ScAm94

Generate a set of random paths through the graph 2

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: 1984]). This is not to say that no algorithms exist for the Hamiltonian Path Problem, just no efficient ones. For example, consider the following algorithm: Given a graph with n vertices, 1. Generate a set of random paths through the graph. 2. For each path in the set: a. Check whether that path starts at the start vertex and ends with the end vertex. If not, remove that path from the set. b. Check if that path passes through exactly n vertices. If not, remove that path from the set. c. For each vertex, check if that path passes through that vertex. If not, remove that path from the set. 3. If the set is not empty, then report that there is a Hamiltonian path. If the set is empty, report that there is no Hamiltonian path. This is not a perfect algorithm; nevertheless, if the generation of paths is random enough and the resulting set large enough, then there is a high probability that it will give the correct answer. It is this algorithm that I implemented in the first DNA computation. Seven...
View Full Document

This note was uploaded on 11/28/2011 for the course COMP 790 taught by Professor Staff during the Fall '08 term at UNC.

Ask a homework question - tutors are online