Orbital library

orbital.algorithm.template
Interface BacktrackingProblem

All Superinterfaces:
AlgorithmicProblem

public interface BacktrackingProblem
extends AlgorithmicProblem

Hook class for Backtracking Algorithms

Author:
Uwe Aßmann, André Platzer
See Also:
Backtracking, GeneralSearchProblem

Method Summary
 java.lang.Object chooseNext(int depth)
          Get the next choice variant at a depth.
 int getNumberOfVariants(int depth)
          Query on the number of solution variants for a single variable.
 int getNumberOfVars()
          Get the number of solution variables to find with Backtracking.
 boolean isConsistent(java.util.List choices, int depth)
          Checks whether the current choices are still consistent.
 

Method Detail

getNumberOfVars

int getNumberOfVars()
Get the number of solution variables to find with Backtracking.

Preconditions:
true

getNumberOfVariants

int getNumberOfVariants(int depth)
Query on the number of solution variants for a single variable.

Returns:
the number of variants for choosing the solution variable at the specified depth.
Preconditions:
depth >= 0

isConsistent

boolean isConsistent(java.util.List choices,
                     int depth)
Checks whether the current choices are still consistent.

Parameters:
choices - a fixed-length list (getNumberOfVars()) of partial solution values.
depth - is the depth level upto which current choices should be proved valid.
Returns:
whether the choices at the depth still represent a valid partial solution.
Preconditions:
depth >= 0 is the depth level upto which current choices should be proved valid
Postconditions:
RES indicates whether valid partial solution

chooseNext

java.lang.Object chooseNext(int depth)
Get the next choice variant at a depth.

Parameters:
depth - is the depth level which should yield a new solution variant.
Returns:
a new solution value for the variable at depth.
Preconditions:
depth >= 0
Postconditions:
RES is new solution value

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.