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

Determines the weakly connected components of a directed graph. More...

#include <WeaklyConnectedComponents.h>

Public Member Functions

 WeaklyConnectedComponents (const Graph &G)
 Create WeaklyConnectedComponents class for Graph G. More...
 
void run ()
 This method determines the weakly connected components for the graph given in the constructor. More...
 
count numberOfComponents ()
 Get the number of weakly connected components. More...
 
count componentOfNode (node u)
 Get the the component in which node u is. More...
 
std::map< index, countgetComponentSizes ()
 Get 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
 

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 the weakly connected components of a directed graph.

Constructor & Destructor Documentation

NetworKit::WeaklyConnectedComponents::WeaklyConnectedComponents ( const Graph G)

Create WeaklyConnectedComponents class for Graph G.

Parameters
GThe graph.

Member Function Documentation

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

Get the the component in which node u is.

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

Get the map from component to size.

Returns
A map that maps each component to its size.
count NetworKit::WeaklyConnectedComponents::numberOfComponents ( )
inline

Get the number of weakly connected components.

Returns
The number of weakly connected components.
void NetworKit::WeaklyConnectedComponents::run ( )
virtual

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

Implements NetworKit::Algorithm.


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