Program Listing for File WeaklyConnectedComponents.hpp

Return to documentation for file (include/networkit/components/WeaklyConnectedComponents.hpp)

/*
 * WeaklyConnectedComponents.hpp
 *
 *  Created on: June 20, 2017
 *      Author: Eugenio Angriman
 */

#ifndef NETWORKIT_COMPONENTS_WEAKLY_CONNECTED_COMPONENTS_HPP_
#define NETWORKIT_COMPONENTS_WEAKLY_CONNECTED_COMPONENTS_HPP_

#include <memory>

#include <networkit/components/ComponentDecomposition.hpp>

namespace NetworKit {

// pImpl
namespace ConnectedComponentsDetails {
template <bool>
class ConnectedComponentsImpl;
} // namespace ConnectedComponentsDetails

class WeaklyConnectedComponents final : public ComponentDecomposition {
public:
    WeaklyConnectedComponents(const Graph &G);

    ~WeaklyConnectedComponents() override;

    /*
     * Computes the weakly connected components of the input graph.
     */
    void run() override;

    static Graph extractLargestWeaklyConnectedComponent(const Graph &G, bool compactGraph = false);

private:
    std::unique_ptr<ConnectedComponentsDetails::ConnectedComponentsImpl<true>> impl;
};
} // namespace NetworKit

#endif // NETWORKIT_COMPONENTS_WEAKLY_CONNECTED_COMPONENTS_HPP_