|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.upc.dama.dex.tasks.Task
edu.upc.dama.dex.tasks.CompositeTask
edu.upc.dama.dex.algorithms.Connectivity
public abstract class Connectivity
Any class implementing this abstract class can be used to solve a problem related to graph connectivity as finding the strongly connected components or finding the weakly connected components. Any component of a graph is called connected if there is a path between every pair of nodes contained in this component.
| Field Summary |
|---|
| Fields inherited from interface edu.upc.dama.dex.algorithms.Algorithm |
|---|
NAVIGATION_BACKWARD, NAVIGATION_FORWARD, NAVIGATION_UNDIRECTED |
| Constructor Summary | |
|---|---|
Connectivity(Graph graph)
Creates a new instance of Connectivity. |
|
| Method Summary | |
|---|---|
void |
addAllEdges()
Adds all the edge types contained in the graph in order to restrict the set of edge types allowed while traversing the graph. |
void |
addAllNodes()
Adds all the node types contained in the graph to restrict the set of allowed node types. |
void |
addEdge(int edgetype)
Adds an edge type in order to restrict the set of edge types allowed while traversing the graph. |
void |
addNode(int nodetype)
Adds a node type in order to restrict the set of allowed node types while traversing the graph. |
abstract void |
close()
Closes the instance. |
ConnectedComponents |
getConnectedComponents()
Returns the results generated by the execution of the algorithm. |
abstract void |
run()
Runs the algorithm in order to find the connected components. |
void |
setMaterializedAttribute(java.lang.String nameattribute)
Creates a new common attribute type for all node types in the graph in order to store, persistently, the results related to the connected components found while executing this algorithm. |
| Methods inherited from class edu.upc.dama.dex.tasks.CompositeTask |
|---|
cancel, execute, init |
| Methods inherited from class edu.upc.dama.dex.tasks.Task |
|---|
main |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Connectivity(Graph graph)
Connectivity.
graph - Graph on which the algorithm will be run.| Method Detail |
|---|
public void addAllEdges()
public void addEdge(int edgetype)
edgetype - The edge type to restrict the set of edges allowed
while traversing the graph during the execution of the algorithm.public void addAllNodes()
public void addNode(int nodetype)
nodetype - The node type to restrict the set of nodes allowed
while traversing the graph during the execution of the algorithm.public abstract void close()
Once executed, the instance becomes invalid.
public ConnectedComponents getConnectedComponents()
ConnectedComponents
which contain information related to the connected components found.
public abstract void run()
throws java.lang.Throwable
This method can be called only once.
java.lang.Throwablepublic void setMaterializedAttribute(java.lang.String nameattribute)
Whenever the user wants to retrieve the results, even when the graph has
been closed and opened again, it is only necessary to create a new isntance
of the class ConnectedComponents indicating the graph and the
name of the common attribute type which stores the results. This instance
will have all the information related to the connected components found in
the moment of the execution of the algorithm that stored this data.
It is possible to run the algorithm without specifying this parameter in order to avoid materializing the results of the execution.
nameattribute - The name of the common attribute type for all node types
in the graph which will store persistently the results generated by the
execution of the algorithm.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||