Variants of matching problems can often be reduced to standard matching problems by adding further vertices and edges, to the orginal problem:
the gadgets of Tutte or Lovasz and Plummer for reducing the task of finding a optimal f-factor (provided its existence) of a possibly weighted graph.
given a graph with $n$ vertices, the problem of finding an optimal matching with $k$ edges can be solved by adding $n-2k$ vertices that are adjacent every original vertex via an edge with cost $0$ in case of a minimization problem.