Program Listing for File PreferentialAttachmentIndex.hpp

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

/*
 * PreferentialAttachmentIndex.hpp
 *
 *  Created on: 22.03.2015
 *      Author: Kolja Esders
 */

#ifndef NETWORKIT_LINKPREDICTION_PREFERENTIAL_ATTACHMENT_INDEX_HPP_
#define NETWORKIT_LINKPREDICTION_PREFERENTIAL_ATTACHMENT_INDEX_HPP_

#include <networkit/linkprediction/LinkPredictor.hpp>

namespace NetworKit {

class PreferentialAttachmentIndex final : public LinkPredictor {
    double runImpl(node u, node v) override { return G->degree(u) * G->degree(v); }

public:
    using LinkPredictor::LinkPredictor;
};

} // namespace NetworKit

#endif // NETWORKIT_LINKPREDICTION_PREFERENTIAL_ATTACHMENT_INDEX_HPP_