|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--AbstractCCAHeuristic | +--EdgeCostHeuristic
This class implements an heuristic bases on edge costs for selecting operations to reduce a Yutsis object.
With every edge a cost is associated equal to the difference of the length of the two smallest cycles the edge is part of. The cost of a cycle is defined to be the minimum of the cost of the edges in the cycle. If two girth cycles have the same cost, the cycle for which the minimum cost is most reached is chosen. It this is also equal the cycle with lowest total edgecost is picked.
AbstractCCAHeuristic
,
CCAHeuristic
Constructor Summary | |
EdgeCostHeuristic()
Default constructor: constructs a new CycleCountHeuristic object |
|
EdgeCostHeuristic(Yutsis y)
Constructs a new CycleCountHeuristic object and sets the problem. |
|
EdgeCostHeuristic(Yutsis y,
CycleGenerator cg)
Constructs a new CycleCountHeuristic object and sets the problem. |
Method Summary | |
Cycle |
bestCycle(int[] bestcycleedge,
int[] besticnodes,
java.util.ArrayList candidates)
This function returns the best Cycle to reduce and fills the best edge to interchange out of the cycle (min length 4). |
void |
printCycleCost(Cycle c,
java.io.PrintStream out)
Prints the given Cycle with the costs of his edges on the given PrintStream. |
void |
printCycleCosts()
Prints all considered Cycle with the costs of their edges on System.out. |
void |
printCycleCosts(java.io.PrintStream out)
Prints all considered Cycle with the costs of their edges on the given PrintStream. |
void |
setProblem(Yutsis y,
CycleGenerator cg)
Sets the Yutsis object defining for which operations must be choosen, together with the CycleGenerator delivering the relevant cycles. |
void |
stateChanged(javax.swing.event.ChangeEvent e)
Implementation of the ChangeListener interface. |
Methods inherited from class AbstractCCAHeuristic |
bestCycle, bestCycle, canonicalIC, canonicalIC, cycleGenerator, interchangeNodes, problem, setProblem |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EdgeCostHeuristic()
public EdgeCostHeuristic(Yutsis y)
y
- the Yutsis object for which an operation has to be chosenYutsis
public EdgeCostHeuristic(Yutsis y, CycleGenerator cg)
y
- the Yutsis object for which an operation has to be chosencg
- the cycle generator containing the relevant cycles of yYutsis
,
CycleGenerator
Method Detail |
public void setProblem(Yutsis y, CycleGenerator cg)
setProblem
in interface CCAHeuristic
setProblem
in class AbstractCCAHeuristic
y
- the Yutsis object for which an operation has to be chosencg
- the cycle generator containing the relevant cycles of yYutsis
,
CycleGenerator
public Cycle bestCycle(int[] bestcycleedge, int[] besticnodes, java.util.ArrayList candidates)
bestCycle
in interface CCAHeuristic
bestcycleedge
- array where the best edge to be interchanged
out of the Cycle will be filled inbesticnodes
- array where the best icnodes will be filled incandidates
- ArrayList which will be filled with equivalent
operations, the first corresponds to the returned
best Cycle.
Cycle
,
CCAHeuristic
public void printCycleCosts()
Cycle
public void printCycleCosts(java.io.PrintStream out)
out
- the PrintStream to print toCycle
public void printCycleCost(Cycle c, java.io.PrintStream out)
c
- the Cycle to printedout
- the PrintStream to print toCycle
public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |