Program Listing for File GroupClosenessGrowShrink.hpp

Return to documentation for file (include/networkit/centrality/GroupClosenessGrowShrink.hpp)

/*
 *  GroupClosenessGrowShrink.hpp
 *
 *  Created on: 19.12.2019
 *      Author: Eugenio Angriman <angrimae@hu-berlin.de>
 */

#ifndef NETWORKIT_CENTRALITY_GROUP_CLOSENESS_GROW_SHRINK_HPP_
#define NETWORKIT_CENTRALITY_GROUP_CLOSENESS_GROW_SHRINK_HPP_

#include <memory>
#include <vector>

#include <networkit/base/Algorithm.hpp>
#include <networkit/graph/Graph.hpp>

namespace NetworKit {

// pImpl
namespace GroupClosenessGrowShrinkDetails {
template <class>
class GroupClosenessGrowShrinkImpl;
} // namespace GroupClosenessGrowShrinkDetails

class GroupClosenessGrowShrink final : public Algorithm {

public:
    GroupClosenessGrowShrink(const Graph &graph, const std::vector<node> &group,
                             bool extended = false, count insertions = 0,
                             count maxIterations = 100);
    template <class Iter>
    GroupClosenessGrowShrink(const Graph &G, Iter first, Iter last, bool extended = false,
                             count insertions = 0, count maxIterations = 100)
        : GroupClosenessGrowShrink(G, std::vector<node>(first, last), extended, insertions,
                                   maxIterations) {}

    ~GroupClosenessGrowShrink() override;

    void run() override;

    std::vector<node> groupMaxCloseness() const;

    count numberOfIterations() const;

private:
    const Graph *G;
    std::unique_ptr<GroupClosenessGrowShrinkDetails::GroupClosenessGrowShrinkImpl<edgeweight>>
        weightedImpl;
    std::unique_ptr<GroupClosenessGrowShrinkDetails::GroupClosenessGrowShrinkImpl<count>>
        unweightedImpl;
};
} // namespace NetworKit

#endif // NETWORKIT_CENTRALITY_GROUP_CLOSENESS_GROW_SHRINK_HPP_