|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.algo.Cycles
public class Cycles
Responsible for finding cycles within a graph that have certain properties.
Constructor Summary | |
---|---|
Cycles()
|
Method Summary | |
---|---|
static EdgeList |
findAllCycleEdges(Graph graph,
boolean directed)
Returns all edges that are part of at least one directed or undirected simple cycle. |
static EdgeList |
findCycle(Graph graph,
boolean directed)
Returns an edge list that contains the edges of a cycle found in the given graph. |
static void |
findCycleEdges(Graph graph,
EdgeMap cycleEdges)
This method marks edges of a given graph whose removal or reversal would make that graph acyclic. |
static void |
findCycleEdges(Graph graph,
EdgeMap cycleEdges,
DataProvider costDP)
This method is similar to findCycleEdges(Graph, EdgeMap) , but instead of minimizing the
number of marked edges it tries to find a set of marked edges, for which the associated
cost is minimal. |
static void |
findCycleEdgesDFS(Graph graph,
EdgeMap cycleEdges)
Like findCycleEdges(Graph, EdgeMap) this method marks
edges of a given graph whose removal or reversal would make
that graph acyclic. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Cycles()
Method Detail |
---|
public static void findCycleEdges(Graph graph, EdgeMap cycleEdges)
graph
- the input graphcycleEdges
- return value. cycleEdge.getBool(e) == true iff
e is a detected cycle edge.public static void findCycleEdges(Graph graph, EdgeMap cycleEdges, DataProvider costDP)
findCycleEdges(Graph, EdgeMap)
, but instead of minimizing the
number of marked edges it tries to find a set of marked edges, for which the associated
cost is minimal. In case each edge has cost 1.0
the result will be
the same as the one returned by findCycleEdges(Graph, EdgeMap)
.
costDP
- data provider that yields the reversal cost for each edge. The reversal cost
for each edge must be a non-negative value of type double
.public static void findCycleEdgesDFS(Graph graph, EdgeMap cycleEdges)
findCycleEdges(Graph, EdgeMap)
this method marks
edges of a given graph whose removal or reversal would make
that graph acyclic. The implementation of this method is
based on a Depth First Search. The number of marked cycle edges
is expected to be slightly larger than when using
findCycleEdges(Graph, EdgeMap)
. The advantage of this method
is that the result set is more stable when edges get added or removed
over the time.
graph
- the input graphcycleEdges
- return value. cycleEdge.getBool(e) == true iff
e is a detected cycle edge.public static EdgeList findCycle(Graph graph, boolean directed)
public static final EdgeList findAllCycleEdges(Graph graph, boolean directed)
graph
- the input graphdirected
- whether or not to look for edges on directed cycles
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |