Class Cycles


  • public abstract class Cycles
    extends java.lang.Object
    Collection of helper methods related to cycles.
    Author:
    Dimitrios Michail
    • Constructor Summary

      Constructors 
      Constructor Description
      Cycles()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <V,​E>
      GraphPath<V,​E>
      simpleCycleToGraphPath​(Graph<V,​E> graph, java.util.List<E> cycle)
      Transform a simple cycle from an edge set representation to a graph path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Cycles

        public Cycles()
    • Method Detail

      • simpleCycleToGraphPath

        public static <V,​E> GraphPath<V,​E> simpleCycleToGraphPath​(Graph<V,​E> graph,
                                                                              java.util.List<E> cycle)
        Transform a simple cycle from an edge set representation to a graph path. A simple cycle contains vertices with degrees either zero or two. This method treats directed graphs as undirected.
        Type Parameters:
        V - graph vertex type
        E - graph edge type
        Parameters:
        graph - the graph
        cycle - the simple cycle
        Returns:
        the cycle as a graph path
        Throws:
        java.lang.IllegalArgumentException - if the provided edge set is not a simple cycle (circuit)