Interface CCAHeuristic

All Known Implementing Classes:
AbstractCCAHeuristic

public interface CCAHeuristic

Interface of an heuristic to be used with the CycleCostAlgorithm class to reduce a Yutsis object with at least operations possible.

Author:
Dries.VanDyck@rug.ac.be
See Also:
CycleCostAlgorithm, Yutsis

Method Summary
 Cycle bestCycle(int[] bestcycleedge)
          This function returns the best Cycle to reduce and fills the best edge to interchange out of the cycle (min length 4).
 Cycle bestCycle(int[] bestcycleedge, int[] besticnodes)
          This function returns the best Cycle to reduce and fills the best edge to interchange out of the cycle (min length 4) together with the best interchange nodes in a canonical way.
 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) together with the best interchange nodes in a canonical way.
 int[] canonicalIC(int[] icedge, int[] icnodes)
          This method returns a canonical representation of the given interchange, without applying it.
 int[] canonicalIC(int[] icedge, int[] icnodes, int[] alticnodes)
          This method returns a canonical representation of the given interchange, without applying it.
 CycleGenerator cycleGenerator()
          Returns the CycleGenerator used by this CCAHeuristic.
 int[] interchangeNodes(Cycle bestcycle, int[] bestcycleedge)
          This method returns the nodes to be interchanged from the bestcycledge in order to reduce the bestcycle one unit in length and makes it canonical, without applying the interchange itself.
 Yutsis problem()
          Returns the problem considered.
 void setProblem(Yutsis y)
          Sets the Yutsis object for which operations must be choosen, a CycleGenerator will be constructed for the given Yutsis object.
 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.
 

Method Detail

setProblem

public void setProblem(Yutsis y)
Sets the Yutsis object for which operations must be choosen, a CycleGenerator will be constructed for the given Yutsis object.

See Also:
Yutsis, CycleGenerator

setProblem

public 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.

See Also:
Yutsis, CycleGenerator

problem

public Yutsis problem()
Returns the problem considered.

Returns:
the Yutsis object defining the problem or null if no problem is defined.
See Also:
Yutsis

cycleGenerator

public CycleGenerator cycleGenerator()
Returns the CycleGenerator used by this CCAHeuristic.

Returns:
the CycleGenerator used by the heuristic or null if no CycleGenerator is used.
See Also:
CycleGenerator

interchangeNodes

public int[] interchangeNodes(Cycle bestcycle,
                              int[] bestcycleedge)
This method returns the nodes to be interchanged from the bestcycledge in order to reduce the bestcycle one unit in length and makes it canonical, without applying the interchange itself. The canonical representation: take an edge (a.b) with adjacent edges (a,c), (a,d), (b,e), (b,f) then an IC a b c e is valid iff a < b && c < d.

Parameters:
bestcycle - the Cycle to be reduced
bestcycleedge - the edge on which to apply the interchange
Returns:
the nodes to interchange of the edge bestcycleedge in order to reduce the cycle one unit in length.
See Also:
Cycle

canonicalIC

public int[] canonicalIC(int[] icedge,
                         int[] icnodes)
This method returns a canonical representation of the given interchange, without applying it. The used canonical representation: take an edge (a.b) with adjacent edges (a,c), (a,d), (b,e), (b,f) then an IC a b c e is valid iff a < b && c < d.

Parameters:
icedge - the nodes of the edge on which the interchange applies
icnodes - the nodes to be interchanged
Returns:
the nodes to interchange making the IC canonical

canonicalIC

public int[] canonicalIC(int[] icedge,
                         int[] icnodes,
                         int[] alticnodes)
This method returns a canonical representation of the given interchange, without applying it. The used canonical representation: take an edge (a.b) with adjacent edges (a,c), (a,d), (b,e), (b,f) then an IC a b c e is valid iff a < b && c < d.

Parameters:
icedge - the nodes of the edge on which the interchange applies
icnodes - the nodes to be interchanged
alticnodes - the alternative nodes to be interchanged yielding the same effect.
Returns:
the nodes to interchange making the IC canonical

bestCycle

public Cycle bestCycle(int[] bestcycleedge)
This function returns the best Cycle to reduce and fills the best edge to interchange out of the cycle (min length 4). It will use a CycleGenerator to generate all relevant cycles.

Parameters:
bestcycleedge - array where the best edge to be interchanged out of the Cycle will be filled in
Returns:
the best Cycle

bestCycle

public Cycle bestCycle(int[] bestcycleedge,
                       int[] besticnodes)
This function returns the best Cycle to reduce and fills the best edge to interchange out of the cycle (min length 4) together with the best interchange nodes in a canonical way. It will use a CycleGenerator to generate all relevant cycles.

Parameters:
bestcycleedge - array where the best edge to be interchanged out of the Cycle will be filled in
besticnodes - array where the best icnodes will be filled in
Returns:
the best Cycle
See Also:
CycleCostAlgorithm

bestCycle

public 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) together with the best interchange nodes in a canonical way. It will use a CycleGenerator to generate all relevant cycles.

Parameters:
bestcycleedge - array where the best edge to be interchanged out of the Cycle will be filled in
besticnodes - array where the best icnodes will be filled in
candidates - ArrayList which will be filled with equivalent operations, the first corresponds to the returned best Cycle.
Returns:
the best Cycle