Package org.graph4j.util
Class Cycle
A cycle is a closed path, meaning that the last vertex of the path is
connected to the first one.
Vertices can not repeat. Edges can not repeat.
The length of a cycle is the number of edges in the path plus the one between
the endpoints.
- Author:
- Cristian Frăsinaru
- See Also:
-
Field Summary
Fields inherited from class org.graph4j.util.VertexCollection
bitset, DEFAULT_CAPACITY, first, graph, numVertices, vertices -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.graph4j.util.Path
firstVertex, isHamiltonian, lastVertexMethods inherited from class org.graph4j.util.Trail
checkDuplicateEdgesMethods inherited from class org.graph4j.util.Walk
add, checkEdge, checkEdges, isDirected, reverse, typeMethods inherited from class org.graph4j.util.VertexList
addAll, get, indexOf, indexOf, insert, remove, removeFromPos, set, union, unionMethods inherited from class org.graph4j.util.VertexCollection
clear, computeVerticesWeight, contains, getGraph, grow, isClique, isEmpty, isStableSet, iterator, numVertices, removeAll, removeLast, retainAll, size, union, vertexToString, verticesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Cycle
-
Cycle
-
Cycle
-
-
Method Details
-
isValid
public final boolean isValid() -
isInduced
public boolean isInduced()Description copied from class:PathChecks if the path is induced (there is no chord). -
isClosed
public boolean isClosed() -
length
public int length()Description copied from class:WalkThe length of the walk, trail, path or cycle (number of edges). -
computeEdgesWeight
public double computeEdgesWeight()- Overrides:
computeEdgesWeightin classWalk- Returns:
- the sum of the edge weights.
-
hashCode
public int hashCode() -
equals
-
toString
-