Back

is-perfect-matching? (clj)

(source)

function

(is-perfect-matching? g matching)
Decides whether the given set represents a valid perfect matching in `g` A *perfect matching* in a graph is a matching in which exactly one edge is incident upon each vertex. Parameters ---------- `g` : graph `matching` : set A set representing a matching. It must have elements of the form #{u v}, where [u v] is an edge in the matching. Returns ------- boolean Whether the given set or dictionary represents a valid perfect matching in the graph.

Examples