Program Listing for File Sparsifiers.hpp

Return to documentation for file (include/networkit/sparsification/Sparsifiers.hpp)

/*
 * Sparsifiers.hpp
 *
 *  Created on: 23.07.2014
 *      Author: Gerd Lindner
 */

#ifndef NETWORKIT_SPARSIFICATION_SPARSIFIERS_HPP_
#define NETWORKIT_SPARSIFICATION_SPARSIFIERS_HPP_

#include <networkit/graph/Graph.hpp>

namespace NetworKit {

class Sparsifier {

public:
    Sparsifier(const Graph &inputGraph);

    virtual ~Sparsifier() = default;

    virtual void run() = 0;

    Graph getGraph();

protected:
    const Graph &inputGraph;
    Graph outputGraph;
    bool hasOutput;
};

class SimmelianSparsifierNonParametric : public Sparsifier {

public:
    SimmelianSparsifierNonParametric(const Graph &graph, double threshold);

    void run() override;

private:
    double threshold;
};

class SimmelianSparsifierParametric : public Sparsifier {

public:
    SimmelianSparsifierParametric(const Graph &graph, int maxRank, int minOverlap);

    void run() override;

private:
    int maxRank;
    int minOverlap;
};

class MultiscaleSparsifier : public Sparsifier {

public:
    MultiscaleSparsifier(const Graph &graph, double alpha);

    void run() override;

private:
    double alpha;
};

class LocalSimilaritySparsifier : public Sparsifier {

public:
    LocalSimilaritySparsifier(const Graph &graph, double e);

    void run() override;

private:
    double e;
};

class SimmelianMultiscaleSparsifier : public Sparsifier {

public:
    SimmelianMultiscaleSparsifier(const Graph &graph, double alpha);

    void run() override;

private:
    double alpha;
};

class RandomSparsifier : public Sparsifier {

public:
    RandomSparsifier(const Graph &graph, double ratio);

    void run() override;

private:
    double ratio;
};

} /* namespace NetworKit */
#endif // NETWORKIT_SPARSIFICATION_SPARSIFIERS_HPP_