Data Structures and Algorithms
with Object-Oriented Design Patterns in Java
to represent the nodes of the solution space of a
0/1-knapsack problem described in Section
.
Devise a suitable representation for the state of a node and then implement the following methods isFeasible, isComplete, getObjective, getBound, clone, and getSuccessors. Note, the getSuccessors method returns an Enumeration which that enumerates all the successors of a given node.
to solve the problem given in Table
.
to solve the problem given in Table
.
to solve the problem given in Table
.
for the
change counting problem described in Section
.
for the
scales balancing problem described in Section
.
for the
N-queens problem described in Exercise
.public interface GreedySolution
extends Solution
{
Solution GreedySuccessor ();
}
To do this you will have to add a method to the
Solution interface:
public interface SimulatedAnnealingSolution
extends Solution
{
Solution RandomSuccessor ();
}
.
![]()
Copyright © 1998 by Bruno R. Preiss, P.Eng. All rights reserved.