SparkseePython
6.0.2
|
ConnectedComponents class. More...
Public Member Functions | |
def | __init__ (self, s, materializedattribute) |
Creates a new instance of ConnectedComponents. More... | |
def | get_size (self, id_connected_component) |
Returns the number of nodes contained in the given connected component. More... | |
def | get_count (self) |
Returns the number of connected components found in the graph. More... | |
def | get_connected_component (self, id_node) |
Returns the connected component where the given node belongs to. More... | |
def | get_nodes (self, id_connected_component) |
Returns the collection of nodes contained in the given connected component. More... | |
def | close (self) |
Closes the ConnectedComponents instance. More... | |
def | is_closed (self) |
Gets if ConnectedComponents has been closed or not. More... | |
ConnectedComponents class.
This class contains the results processed on a Connectivity algorithm.
These results contain information related to the connected components found. We must consider that each connected component has a number in order to identify it. These number identifiers are values from 0 to N-1, where N is the number of different connected components found.
When executing any implementation of the Connectivity, it is possible to indicate whether the results of the execution must be stored persistently using the class Connectivity setMaterializedAttribute method. In case the results are set to be materialized, users can retrieve this data whenever they want, even if the graph has been closed and opened again, just by creating a new instance of this class.
Check out the 'Algorithms' section in the SPARKSEE User Manual for more details on this.
def sparksee.ConnectedComponents.__init__ | ( | self, | |
s, | |||
materializedattribute | |||
) |
Creates a new instance of ConnectedComponents.
This constructor method can only be called when a previous execution of any implementation of the Connectivity class has materialized the results in a common attribute type for all the nodes in the graph. For further information about materializing the results processed on any Connectivity execution see the documentation of the Connectivity::SetMaterializedAttribute method.
s | [in] Session to get the graph Graph on which the information will be retrieved just by getting the values contained in the given common attribute type for all the nodes in the graph and processing them. |
materializedattribute | [in] The common attribute type for all the nodes in the graph where data will be retrieved in order to process the results related to the connected components found in the graph. |
def sparksee.ConnectedComponents.close | ( | self | ) |
Closes the ConnectedComponents instance.
It must be called to ensure the integrity of all data.
def sparksee.ConnectedComponents.get_connected_component | ( | self, | |
id_node | |||
) |
Returns the connected component where the given node belongs to.
id_node | [in] The node identifier for which the connected component identifier where it belongs will be returned. |
def sparksee.ConnectedComponents.get_count | ( | self | ) |
Returns the number of connected components found in the graph.
def sparksee.ConnectedComponents.get_nodes | ( | self, | |
id_connected_component | |||
) |
Returns the collection of nodes contained in the given connected component.
id_connected_component | The connected component for which the collection of nodes contained in it will be returned. |
def sparksee.ConnectedComponents.get_size | ( | self, | |
id_connected_component | |||
) |
Returns the number of nodes contained in the given connected component.
id_connected_component | The connected component for which the number of nodes contained in it will be returned. |
def sparksee.ConnectedComponents.is_closed | ( | self | ) |
Gets if ConnectedComponents has been closed or not.