Package org.graph4j.util
Class Circuit
java.lang.Object
org.graph4j.util.VertexCollection
org.graph4j.util.VertexList
org.graph4j.util.Walk
org.graph4j.util.Trail
org.graph4j.util.Circuit
A circuit is a trail whose last vertex is connected to the first one.
Vertices can repeat. Edges can not repeat.
The length of a circuit is the number of edges in the trail 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.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
-
Circuit
-
Circuit
-
Circuit
-
-
Method Details
-
isValid
public boolean isValid() -
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.
-
join
Joins this circuit with another which has a common vertex.- Parameters:
other- another circuit of the graph, having a common vertex with this- Returns:
- a circuit join this circuit and the other
-
hashCode
public int hashCode() -
equals
-
toString
-