|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.wwu.tobikley.acgc.algorithms.CountingAlgorithm
public abstract class CountingAlgorithm
Basic functionality of an algorithm to count the q-Colorings of a graph. The following aspects are addresed:
algorithm.
| Field Summary | |
|---|---|
protected Vector<CountingResult> |
detailedResults
Description, Result and Runtime for each iteration done of the algorithm. |
protected long |
endTime
Time the algorithm ended in ms. |
protected Graph |
graphBackup
A backup copy of the input graph. |
protected ColoredGraph |
graphWorkingCopy
A copy of the graph the algorithm will work with. |
protected int |
numberOfColors
The integer q, as the question is: How many q-Colorings are there. |
protected int |
progress
Proportion of the task finished so far (per hundred). |
protected String |
progressText
Description of the current task being performed. |
protected BigInteger |
returnVal
The number of q-Colorings of the graph. |
protected long |
startTime
Time the algorithm was started in ms. |
| Constructor Summary | |
|---|---|
CountingAlgorithm(Graph g,
int numberOfColors)
Creates a new instance of a counting algorithm. |
|
| Method Summary | |
|---|---|
protected abstract void |
algorithm()
Specifies the counting algorithm. |
BigInteger |
call()
Called from outside when the algorithm is executed. |
Collection<CountingResult> |
getDetailedResults()
Description, Result and Runtime for each iteration done of the algorithm. |
Graph |
getGraph()
Returns the working copy of the graph. |
int |
getNumberOfColors()
Returns the number q as the question is: How many q-Colorings are there. |
int |
getProgress()
Returns the proportion of the task finished so far (per hundred). |
String |
getProgressText()
Description of the current task being performed. |
long |
getRunTime()
Returns the time the time the algorithm ran for calculation. |
void |
setNumberOfColors(int numberOfColors)
Sets the number q as the question is: How many q-Colorings are there. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Graph graphBackup
protected ColoredGraph graphWorkingCopy
protected int numberOfColors
protected BigInteger returnVal
protected long startTime
protected long endTime
protected int progress
protected String progressText
protected Vector<CountingResult> detailedResults
| Constructor Detail |
|---|
public CountingAlgorithm(Graph g,
int numberOfColors)
g - The graph to calculate the number of q-Colorings from.numberOfColors - The number q as the question is: How many q-Colorings are there.| Method Detail |
|---|
public long getRunTime()
protected abstract void algorithm()
graphWorkingCopy. A copy is provided, because some
algorithms might e.g. require adding or removing elements.
The algorithm is required to store its result to
returnVal, hence there is no result to this method.
public BigInteger call()
detailedResults.
call in interface Callable<BigInteger>public void setNumberOfColors(int numberOfColors)
numberOfColors - the numberOfColors to setpublic int getNumberOfColors()
public Graph getGraph()
public int getProgress()
public String getProgressText()
public Collection<CountingResult> getDetailedResults()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||