|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--CycleGenerator
Class that generates all relevant cycles of length 3 or bigger for a given Graph. A relevant cycle is a cycle that cannot be created as a sum of two other cycles in the cycle vector space. In fact this algorithm constructs all cycles composed of two shortest paths (even cycles) or two shortest paths and an edge, of which the relevant cycles are a subset.
Graph
,
Cycle
,
Path
,
PathGenerator
Constructor Summary | |
CycleGenerator(Graph g)
Constructs a new CycleGenerator object for the graph g and registers itself as ChangeListener for g. |
Method Summary | |
java.util.ArrayList[] |
cycles()
Returns all cycles as a ArrayList of Cycle's with all cycles of length l at index l-3. |
java.util.ArrayList |
cycles(int l)
Returns all cycles of length l as a ArrayList
of Cycle's. |
int |
girth()
Returns the girth of the Graph. |
java.util.ArrayList |
girthCycles()
Returns all girth cycles as a ArrayList of Cycle's. |
static void |
main(java.lang.String[] args)
Program which prints all relevant cycles to the screen of the YutsisGraph specified by the first argument. |
void |
stateChanged(javax.swing.event.ChangeEvent e)
Implementation of the ChangeListener interface. |
java.lang.String |
toString()
A String representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CycleGenerator(Graph g)
g
- the graph for which all relevant cycles have to be generatedGraph
Method Detail |
public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
public int girth()
Graph
public java.util.ArrayList girthCycles()
Cycle
public java.util.ArrayList[] cycles()
Cycle
public java.util.ArrayList cycles(int l)
l
as a ArrayList
of Cycle's.
l
- the length of the relevant Cycle's to be returned
Cycle
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args) throws java.io.IOException
YutsisGraph
specified by the first argument. When ran
without arguments it prints a "usage" to System.err. However
this class can be used with each object implementing the Graph
interface, this main function (and thus the program) only
works on YutsisGraph
s.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |