/* * Solution.java */ package janet.applications.branchandbound; import janet.applications.branchandbound.Q; import janet.services.*; import java.util.*; /** The interface of an object that represents a solution to a branch & bound * search. * @author Peter Cappello * @version 1.0 */ public interface Solution extends java.io.Serializable { /** returns an LinkedList of the Solution objects that are the children of * this Solution. * @param problem An object that represents the input of this branch & bound * search. * For example, in a traveling salesman problem, it could be a distance matrix. * @param upperBound The best known cost of a Solution for this problem. * @return an Q of [partial] Solution objects that represent the children * of the node in the search tree represented by this [partial] Solution. */ public Q getChildren( Object problem, int upperBound ); /** returns the lower bound on the cost of any complete Solution that is an * extension of this partial Solution. * @return the lower bound on the cost of any complete Solution that is an * extension of this partial Solution. */ public int getLowerBound(); /** returns true if and only if this solution should be explored directly by * a Host (as opposed to being further decomposed). * @return true if and only if this solution should be explored directly by * a Host (as opposed to being further decomposed). * @param myTask a reference to the task encapsulating this partial solution. * This may be used when the question of whether or not the solution * is atomic depends on task properties, such as whether this task * has been assigned more than once (suggesting that it may be big). */ public boolean isAtomic( Task myTask ); /** returns true if and only if the partial Solution is, in fact, complete. * @return true if and only if the partial Solution is, in fact, complete. */ public boolean isComplete(); /** returns a String representation of this partial solution. * @return a String representation of this partial solution. */ public String toString(); }