Package Phase3
Class DancingLinksProblem
java.lang.Object
Phase3.DancingLinksProblem
public class DancingLinksProblem
extends java.lang.Object
Class for solving the dancing links problem
-
Field Summary
Fields Modifier and Type Field Description (package private) floatbestScore(package private) java.lang.Object[]bestSolution(package private) booleanexactCover(package private) booleanfoundSolution(package private) java.lang.String[]headerNames(package private) boolean[][]inputMatrix(package private) intlayerCutoff(package private) intmaxSeconds(package private) java.util.List<java.lang.Float>maxValuePerLayer(package private) booleanprecise(package private) floatpruneCutoff(package private) intpruneWait(package private) DataObjectroot(package private) java.util.List<java.lang.Integer>rowTypes(package private) longrun(package private) ColumnObjectsmallestColumn(package private) java.time.Instantstart(package private) longtimeElapsed -
Constructor Summary
Constructors Constructor Description DancingLinksProblem(boolean[][] inputMatrix, java.lang.String[] headerNames, java.util.List<java.lang.Integer> rowTypes, boolean exactCover, int maxSeconds, boolean precise) -
Method Summary
Modifier and Type Method Description voidanswerToUI()voidcreateDataStructure()Method creating the dancing links data structurefloatgetSolutionScore(java.util.ArrayList<java.lang.Integer> solution)voidpartialCoverDriver(java.util.ArrayList<java.lang.Integer> tmp_branch_solution, int layer)voidreduceInput()Method that removes/unlinks columns that can't be filledvoidsolveDriver()
-
Field Details
-
inputMatrix
boolean[][] inputMatrix -
headerNames
java.lang.String[] headerNames -
rowTypes
java.util.List<java.lang.Integer> rowTypes -
exactCover
boolean exactCover -
maxSeconds
int maxSeconds -
root
DataObject root -
timeElapsed
long timeElapsed -
start
java.time.Instant start -
precise
boolean precise -
bestScore
float bestScore -
bestSolution
java.lang.Object[] bestSolution -
run
long run -
maxValuePerLayer
java.util.List<java.lang.Float> maxValuePerLayer -
pruneWait
int pruneWait -
pruneCutoff
float pruneCutoff -
layerCutoff
int layerCutoff -
foundSolution
boolean foundSolution -
smallestColumn
ColumnObject smallestColumn
-
-
Constructor Details
-
DancingLinksProblem
public DancingLinksProblem(boolean[][] inputMatrix, java.lang.String[] headerNames, java.util.List<java.lang.Integer> rowTypes, boolean exactCover, int maxSeconds, boolean precise)
-
-
Method Details
-
createDataStructure
public void createDataStructure()Method creating the dancing links data structure -
solveDriver
public void solveDriver() -
partialCoverDriver
public void partialCoverDriver(java.util.ArrayList<java.lang.Integer> tmp_branch_solution, int layer) -
getSolutionScore
public float getSolutionScore(java.util.ArrayList<java.lang.Integer> solution) -
answerToUI
public void answerToUI() -
reduceInput
public void reduceInput()Method that removes/unlinks columns that can't be filled
-