Class WeaklyConnectedComponents<U>
java.lang.Object
es.uam.eps.ir.relison.sna.community.detection.connectedness.WeaklyConnectedComponents<U>
- Type Parameters:
U
- Type of the users.
- All Implemented Interfaces:
CommunityDetectionAlgorithm<U>
public class WeaklyConnectedComponents<U> extends java.lang.Object implements CommunityDetectionAlgorithm<U>
Computes communities via the Strongly Connected Components
-
Constructor Summary
Constructors Constructor Description WeaklyConnectedComponents()
-
Method Summary
Modifier and Type Method Description Communities<U>
detectCommunities(Graph<U> graph)
Computes the communities for a certain graph.private java.util.Collection<java.util.Collection<U>>
findWCC(Graph<U> g)
Finds the weakly connected components of the graph.private void
visit(U u, Graph<U> g, java.util.Set<U> discovered, java.util.Collection<U> component)
Visits a node by using the inlinks
-
Constructor Details
-
WeaklyConnectedComponents
public WeaklyConnectedComponents()
-
-
Method Details
-
detectCommunities
Description copied from interface:CommunityDetectionAlgorithm
Computes the communities for a certain graph.- Specified by:
detectCommunities
in interfaceCommunityDetectionAlgorithm<U>
- Parameters:
graph
- The full graph.- Returns:
- The communities if everything went OK, null if not.
-
findWCC
Finds the weakly connected components of the graph.- Parameters:
g
- The graph.- Returns:
- The weakly connected clusters of the graph.
-
visit
private void visit(U u, Graph<U> g, java.util.Set<U> discovered, java.util.Collection<U> component)Visits a node by using the inlinks- Parameters:
u
- The starting node.g
- The graph.discovered
- The discovered items.component
- The component.
-