GraphLab Project

graphlab.library.algorithms.util
Class AcyclicChecker

java.lang.Object
  extended by graphlab.library.algorithms.Algorithm
      extended by graphlab.library.algorithms.util.AcyclicChecker
All Implemented Interfaces:
AlgorithmInterface, AutomatedAlgorithm
Direct Known Subclasses:
AcyclicCheckerAnim

public class AcyclicChecker
extends Algorithm
implements AutomatedAlgorithm

Checks whether a graph is acyclic. Usage:

graphlab.library.algorithms.util.AcyclicChecker.isGraphAcyclic(graph);

The above statement returns true if the graph is acyclic. The graph parameter is your graph object. Note that there is no need to explicitly parameterize the generic method isGraphAcyclic. Types are automatically deduced from the supplied graph object with no java unchecked convertion warning.

Author:
Omid Aladini

Constructor Summary
AcyclicChecker()
           
 
Method Summary
 void doAlgorithm()
           
static
<VertexType extends BaseVertex,EdgeType extends BaseEdge<VertexType>>
boolean
isGraphAcyclic(BaseGraph<VertexType,EdgeType> graph)
          Checks whether the current graph is acyclic.
 
Methods inherited from class graphlab.library.algorithms.Algorithm
acceptEventDispatcher, dispatchEvent, getDispatcher
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface graphlab.library.algorithms.AlgorithmInterface
acceptEventDispatcher
 

Constructor Detail

AcyclicChecker

public AcyclicChecker()
Method Detail

isGraphAcyclic

public static <VertexType extends BaseVertex,EdgeType extends BaseEdge<VertexType>> boolean isGraphAcyclic(BaseGraph<VertexType,EdgeType> graph)
Checks whether the current graph is acyclic.

Returns:
True if graph is acyclic and false otherwise.
Throws:
InvalidGraphException

doAlgorithm

public void doAlgorithm()
Specified by:
doAlgorithm in interface AutomatedAlgorithm

GraphLab Project