All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
NetworKit::DynConnectedComponents Class Reference

Determines and updates the connected components of an undirected graph. More...

#include <DynConnectedComponents.h>

Public Member Functions

 DynConnectedComponents (const Graph &G)
 Create ConnectedComponents class for Graph G. More...
 
void run () override
 This method determines the connected components for the graph given in the constructor. More...
 
void update (GraphEvent e) override
 Updates the connected components after an edge insertion or deletion. More...
 
void updateBatch (const std::vector< GraphEvent > &batch) override
 Updates the connected components after a batch of edge insertions or deletions. More...
 
count numberOfComponents ()
 Get the number of connected components. More...
 
count componentOfNode (node u)
 Returns the the component in which node u is. More...
 
std::map< index, countgetComponentSizes ()
 Returns the map from component to size. More...
 
std::vector< std::vector< node > > getComponents ()
 
- Public Member Functions inherited from NetworKit::Algorithm
 Algorithm ()
 Constructor to the algorithm base class. More...
 
virtual ~Algorithm ()=default
 Virtual default destructor. More...
 
bool hasFinished () const
 Indicates whether an algorithm has completed computation or not. More...
 
void assureFinished () const
 Assure that the algorithm has been run, throws a std::runtime_error otherwise. More...
 
virtual std::string toString () const
 Returns a string with the algorithm's name and its parameters, if there are any. More...
 
virtual bool isParallel () const
 
- Public Member Functions inherited from NetworKit::DynAlgorithm
virtual ~DynAlgorithm ()=default
 Virtual default destructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from NetworKit::Algorithm
bool hasRun
 A boolean variable indicating whether an algorithm has finished its computation or not. More...
 

Detailed Description

Determines and updates the connected components of an undirected graph.

Constructor & Destructor Documentation

NetworKit::DynConnectedComponents::DynConnectedComponents ( const Graph G)

Create ConnectedComponents class for Graph G.

Parameters
GThe graph.

Member Function Documentation

count NetworKit::DynConnectedComponents::componentOfNode ( node  u)
inline

Returns the the component in which node u is.

Parameters
[in]uThe node.
std::vector< std::vector< node > > NetworKit::DynConnectedComponents::getComponents ( )
Returns
Vector of components, each stored as (unordered) set of nodes.
std::map< index, count > NetworKit::DynConnectedComponents::getComponentSizes ( )
inline

Returns the map from component to size.

count NetworKit::DynConnectedComponents::numberOfComponents ( )
inline

Get the number of connected components.

Returns
The number of connected components.
void NetworKit::DynConnectedComponents::run ( )
overridevirtual

This method determines the connected components for the graph given in the constructor.

Implements NetworKit::Algorithm.

void NetworKit::DynConnectedComponents::update ( GraphEvent  e)
overridevirtual

Updates the connected components after an edge insertion or deletion.

Parameters
[in]eventThe event that happened (edge deletion or insertion).

Implements NetworKit::DynAlgorithm.

void NetworKit::DynConnectedComponents::updateBatch ( const std::vector< GraphEvent > &  batch)
overridevirtual

Updates the connected components after a batch of edge insertions or deletions.

Parameters
[in]batchA vector that contains a batch of edge insertions or deletions.

Implements NetworKit::DynAlgorithm.


The documentation for this class was generated from the following files: