Program Listing for File Centrality.hpp

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

/*
 * Centrality.hpp
 *
 *  Created on: 19.02.2014
 *      Author: Christian Staudt
 */

#ifndef NETWORKIT_CENTRALITY_CENTRALITY_HPP_
#define NETWORKIT_CENTRALITY_CENTRALITY_HPP_

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

namespace NetworKit {

class Centrality : public Algorithm {
public:
    Centrality(const Graph &G, bool normalized = false, bool computeEdgeCentrality = false);

    void run() override = 0;

    virtual const std::vector<double> &scores() const;

    virtual std::vector<double> edgeScores();

    virtual std::vector<std::pair<node, double>> ranking();

    virtual double score(node v);

    virtual double maximum();

    virtual double centralization();

protected:
    const Graph &G;
    std::vector<double> scoreData;
    std::vector<double> edgeScoreData;
    bool normalized; // true if scores should be normalized in the interval [0,1]
    bool computeEdgeCentrality;
};

} /* namespace NetworKit */

#endif // NETWORKIT_CENTRALITY_CENTRALITY_HPP_