|
Data Structures and Algorithms
with Object-Oriented Design Patterns in Python |
Devise a suitable representation for the state of a node and then implement the following properties getIsFeasible, getIsComplete, getObjective, getBound, and getSuccessors. Note, the getSuccessors method returns an iterator object that enumerates all the successors of a given node.
class GreedySolution(Solution):
def greedySuccessor(self):
pass
greedySuccessor = abstractmethod(greedySuccessor)class SimulatedAnnealingSolution(Solution):
def randomSuccessor(self):
pass
randomSuccessor = abstractmethod(randomSuccessor) ![]()