/*
 * LPDegreeOrdered.h
 *
 *  Created on: 24.09.2013
 *      Author: cls
 */

#ifndef NETWORKIT_COMMUNITY_LP_DEGREE_ORDERED_HPP_
#define NETWORKIT_COMMUNITY_LP_DEGREE_ORDERED_HPP_

#include <networkit/community/CommunityDetectionAlgorithm.hpp>

namespace NetworKit {

typedef index label; // a label is the same as a cluster id

/**
 * @ingroup community
 * Label propagation-based community detection algorithm which
 * processes nodes in increasing order of node degree.
 */
class LPDegreeOrdered: public CommunityDetectionAlgorithm {
private:
    count nIterations = 0;	//!< number of iterations in last run


public:
    /**
     * Constructor to the degree ordered label propagation community detection algorithm.
     *
     * @param[in]	G	input graph
     */
    LPDegreeOrdered(const Graph& G);

    /**
     * Detect communities.
     */
    virtual void run() override;

    /**
    * Get number of iterations in last run.
    *
    * @return Number of iterations.
    */
    virtual count numberOfIterations();

    std::string toString() const override;

};

} /* namespace NetworKit */
#endif // NETWORKIT_COMMUNITY_LP_DEGREE_ORDERED_HPP_
