Package classycle.graph
Class StrongComponent
java.lang.Object
classycle.graph.Vertex
classycle.graph.StrongComponent
- All Implemented Interfaces:
Comparable<Vertex>
A strong component is a subgraph of a directed graph where every two
vertices are mutually reachable.
- Author:
- Franz-Josef Elmer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addVertex
(AtomicVertex vertex) Adds the specified vertex to this strong component.void
Calculates all graph properties of this component.int
int
Returns the number of vertices building this strong component.getVertex
(int index) Returns the vertex of the specified index.boolean
isActive()
void
reset()
Reset this component.void
setActive
(boolean active) void
setLongestWalk
(int longestWalk) toString()
Returns toString() of the attributes and the number of incoming and outgoing arcs.Methods inherited from class classycle.graph.Vertex
addIncomingArcTo, addOutgoingArcTo, compareTo, getAttributes, getHeadVertex, getNumberOfIncomingArcs, getNumberOfOutgoingArcs, getTailVertex, isVisited, visit
-
Constructor Details
-
StrongComponent
public StrongComponent()Default constructor. TheAttributes
of a strong component will a null pointer.
-
-
Method Details
-
getNumberOfVertices
public int getNumberOfVertices()Returns the number of vertices building this strong component. -
getVertex
Returns the vertex of the specified index. -
addVertex
Adds the specified vertex to this strong component. Note, that added vertices are inserted at index 0 of the list of vertices. -
calculateAttributes
public void calculateAttributes()Calculates all graph properties of this component. These properties can be obtained from getAttributes casted asGraphAttributes
. -
reset
public void reset()Reset this component. Calls reset of the superclass. Sets the activity flag to false and the longest walk to -1. -
isActive
public boolean isActive() -
setActive
public void setActive(boolean active) -
getLongestWalk
public int getLongestWalk() -
setLongestWalk
public void setLongestWalk(int longestWalk) -
toString
Description copied from class:Vertex
Returns toString() of the attributes and the number of incoming and outgoing arcs.
-