Encapsulate the subset-generation code from SAT into its own class, then develop implementations of SAT (Program 5.1.1), SubsetSum (Exercise 5.5.18), and VertexCover (Exercise 5.5.19) that are clients of this class.
Program 5.1.1
Exercise 5.5.18
Using the code in SAT and the check() method given on page 853 as a starting point, develop a program Subset Sum that finds a solution to the subset sum problem for any given set of numbers.
Exercise 5.5.19
Using the code in SAT and the check() method from Exercise 5.5.7 as a starting point, develop a program Vertex Cover that finds a solution to the vertex cover problem for any given graph (and upper bound m on the number of vertices in the cover)
Exercise 5.5.7
Write a method that takes a graph G and a subset of vertices, and determines whether the subset of vertices is a vertex cover.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here