Class CycleBasisAlgorithm.CycleBasisImpl<V,​E>

    • Constructor Detail

      • CycleBasisImpl

        public CycleBasisImpl​(Graph<V,​E> graph)
        Construct a new instance.
        Parameters:
        graph - the graph
      • CycleBasisImpl

        public CycleBasisImpl​(Graph<V,​E> graph,
                              Set<List<E>> cycles,
                              int length,
                              double weight)
        Construct a new instance.
        Parameters:
        graph - the graph
        cycles - the cycles of the basis
        length - the length of the cycle basis
        weight - the weight of the cycle basis
    • Method Detail

      • getLength

        public int getLength()
        Get the length of the cycle basis. The length of the cycle basis is the sum of the lengths of its cycles. The length of a cycle is the total number of edges of the cycle.
        Specified by:
        getLength in interface CycleBasisAlgorithm.CycleBasis<V,​E>
        Returns:
        the length of the cycles basis
      • getWeight

        public double getWeight()
        Get the weight of the cycle basis. The weight of the cycle basis is the sum of the weights of its cycles. The weight of a cycle is the sum of the weights of its edges.
        Specified by:
        getWeight in interface CycleBasisAlgorithm.CycleBasis<V,​E>
        Returns:
        the length of the cycles basis