Program Listing for File AlgebraicDistanceIndex.hpp

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

/*
 * AlgebraicDistanceIndex.hpp
 *
 *  Created on: 19.06.2013
 *      Authors: cls, Kolja Esders
 */

#ifndef NETWORKIT_LINKPREDICTION_ALGEBRAIC_DISTANCE_INDEX_HPP_
#define NETWORKIT_LINKPREDICTION_ALGEBRAIC_DISTANCE_INDEX_HPP_

#include <networkit/auxiliary/Timer.hpp>
#include <networkit/graph/Graph.hpp>
#include <networkit/linkprediction/LinkPredictor.hpp>

namespace NetworKit {

class AlgebraicDistanceIndex final : public LinkPredictor {
    double runImpl(node u, node v) override;

    count numSystems;
    count numIters;
    double omega;
    index norm;
    static constexpr index MAX_NORM{0};

    std::vector<std::vector<double>>
        loads;

    void randomInit();

public:
    explicit AlgebraicDistanceIndex(count numberSystems, count numberIterations, double omega = 0.5,
                                    index norm = 2);

    explicit AlgebraicDistanceIndex(const Graph &G, count numberSystems, count numberIterations,
                                    double omega = 0.5, index norm = 2);

    void preprocess();
};

} /* namespace NetworKit */
#endif // NETWORKIT_LINKPREDICTION_ALGEBRAIC_DISTANCE_INDEX_HPP_