Program Listing for File TotalNeighborsIndex.hpp

Return to documentation for file (include/networkit/linkprediction/TotalNeighborsIndex.hpp)

/*
 * TotalNeighborsIndex.hpp
 *
 *  Created on: 05.04.2015
 *      Author: Kolja Esders
 */

#ifndef NETWORKIT_LINKPREDICTION_TOTAL_NEIGHBORS_INDEX_HPP_
#define NETWORKIT_LINKPREDICTION_TOTAL_NEIGHBORS_INDEX_HPP_

#include <networkit/linkprediction/LinkPredictor.hpp>

namespace NetworKit {

class TotalNeighborsIndex final : public LinkPredictor {
    double runImpl(node u, node v) override {
        return NeighborhoodUtility::getNeighborsUnion(*G, u, v).size();
    }

public:
    using LinkPredictor::LinkPredictor;
};

} // namespace NetworKit

#endif // NETWORKIT_LINKPREDICTION_TOTAL_NEIGHBORS_INDEX_HPP_