Class BMatching

Class Documentation

class BMatching

Public Functions

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

Constructs a new BMatching.

Parameters:
  • b – b values

  • numNodes – Maximum number of nodes.

bool isProper() const

Checks whether this is a proper b-matching.

Returns:

bool

void match(node u, node v)

Sets two nodes u and v as each others matching NodeMatches.

Parameters:
  • u

  • v

void unmatch(node u, node v)

Resets the two nodes u and v to unmatched.

Parameters:
  • u

  • v

bool isUnmatched(node u) const

Checks if node is unmatched.

Parameters:

u

Returns:

bool

bool areMatched(node u, node v) const

Checks if the two nodes u and v are matched together.

Parameters:
  • u – node.

  • v – node.

Returns:

bool

count size() const

Get the number of edges in this b-matching.

Returns:

Number of edges in b-matching.

edgeweight weight() const

Get total weight of edges in this b-matching.

Returns:

edgeweight

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

Retrieves a reference to the set of matches for each node.

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

Retrieves the b-value for each node.

Protected Attributes

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