Program Listing for File BMatching.hpp

Return to documentation for file (include/networkit/matching/BMatching.hpp)

/*
 * BMatching.hpp
 *
 *  Created on: 07.08.2023
 *      Author: Fabian Brandt-Tumescheit
 *              Frieda Gerharz
 */

#ifndef NETWORKIT_MATCHING_B_MATCHING_HPP_
#define NETWORKIT_MATCHING_B_MATCHING_HPP_

#include <unordered_set>
#include <networkit/auxiliary/Log.hpp>
#include <networkit/graph/Graph.hpp>

namespace NetworKit {

class BMatching {

public:
    BMatching(const Graph &G, const std::vector<count> &b);

    bool isProper() const;

    void match(node u, node v);

    void unmatch(node u, node v);

    bool isUnmatched(node u) const;

    bool areMatched(node u, node v) const;

    count size() const;

    edgeweight weight() const;

    const std::vector<std::unordered_set<node>> &getMatches() const;

    const std::vector<count> &getB() const;

protected:
    const Graph &G;
    const std::vector<count> b;
    std::vector<std::unordered_set<node>> matches;
};

} /* namespace NetworKit */
#endif // NETWORKIT_MATCHING_B_MATCHING_HPP_