|
Orbital library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object orbital.algorithm.template.DynamicProgramming
public class DynamicProgramming
Framework (template class) for Dynamic Programming Algorithms.
Requires that the problem exhibits optimal substructure, i.e. optimal solutions to subproblems somehow generalize to optimal solutions of the whole problem. Then each optimal solutions carries within it independent optimal solutions to its subproblems. Further requires that the subproblems overlap, i.e. a simple recursive formulation would revisit the same subproblem over and over again.
bottom-up technique:
DynamicProgrammingProblem
,
Greedy
,
HeuristicAlgorithm.PatternDatabaseHeuristic
,
"R. E. Bellman. Dynamic Programming. Princeton Universit Press, Princeton, NJ, 1957."Nested Class Summary |
---|
Nested classes/interfaces inherited from interface orbital.algorithm.template.AlgorithmicTemplate |
---|
AlgorithmicTemplate.Configuration |
Constructor Summary | |
---|---|
DynamicProgramming()
|
Method Summary | |
---|---|
Function |
complexity()
O(n2) |
static java.lang.Object |
getSolutionPart(int[] partSpecification,
java.lang.Object[] partialSolutions)
Get the element in the (possibly multi-dimensional) array partialSolutions specified by the part specification. |
static void |
setSolutionPart(int[] partSpecification,
java.lang.Object[] partialSolutions,
java.lang.Object value)
|
java.lang.Object |
solve(AlgorithmicProblem p)
Generic solve method for a given algorithmic problem. |
java.lang.Object |
solve(DynamicProgrammingProblem p)
solves by dynamic programming. |
Function |
spaceComplexity()
Measure for the asymptotic space complexity of the central solution operation in O-notation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DynamicProgramming()
Method Detail |
---|
public java.lang.Object solve(AlgorithmicProblem p)
AlgorithmicTemplate
solve
in interface AlgorithmicTemplate
p
- algorithmic problem hook class which must fit the concrete
algorithmic template framework implementation.
Function.apply(Object)
public java.lang.Object solve(DynamicProgrammingProblem p)
public Function complexity()
complexity
in interface AlgorithmicTemplate
AlgorithmicTemplate.solve(AlgorithmicProblem)
public Function spaceComplexity()
AlgorithmicTemplate
spaceComplexity
in interface AlgorithmicTemplate
AlgorithmicTemplate.solve(AlgorithmicProblem)
public static java.lang.Object getSolutionPart(int[] partSpecification, java.lang.Object[] partialSolutions)
Utility.getPart(Object[],int[])
public static void setSolutionPart(int[] partSpecification, java.lang.Object[] partialSolutions, java.lang.Object value)
|
Orbital library 1.3.0: 11 Apr 2009 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |