Questions tagged [matching]

A matching (aka Independent Edge Set) in a simple graph is the set of pairwise non-adjacent edges i.e. no two edges have common vertex.

A matching (aka Independent Edge Set) in a simple graph is the set of pairwise non-adjacent edges i.e. no two edges have common vertex. The related concepts are maximal matching, maximum matching, perfect or complete matching and near-perfect matching.

242 questions
15
votes
2 answers

Sampling perfect matching uniformly at random

Suppose I have a graph $G$ with $M(G)$ the (unknown) set of perfect matchings of $G$. Suppose this set is non-empty, then how difficult is it to sample uniformly at random from $M(G)$? What if I am okay with a distribution that is close to uniform,…
Artem Kaznatcheev
  • 4,872
  • 2
  • 28
  • 57
11
votes
1 answer

How fast can we compute the size of maximum matching in an unweighted bipartite graph?

Is there a way to compute the size of a maximum matching in an unweighted bipartite graph more efficiently (e.g. faster) than computing a maximum matching? It is a long shot but it is often an interesting problem to avoid throwaway computations…
10
votes
2 answers

An example where Knuth-Morris-Pratt Algorithm is faster than Boyer-Moore?

This page about Knuth-Moriss-Pratt Algorithm compared to Boyer-Moore describes a possible case where the Boyer-Moore algorithm suffers from small skip distance while KMP could perform better. I'm looking for a good example (text,pattern) that can…
Erb
  • 373
  • 2
  • 8
10
votes
1 answer

Counting and finding all perfect/maximum matchings in general graphs

Recently i've been dealing with a problem that led me to the following questions: Is there a good algorithm to enumerate all maximum/perfect matchings in a general graph? Is there a good algorithm for finding all maximum/perfect matchings in a…
10
votes
1 answer

Maximum matching with social distancing

Let $G = (X\cup Y, E)$ be a bipartite graph. Suppose $X$ contains people, $Y$ contains seats in a theatre, and each edge $(x,y)$ has a weight representing how much person $x$ is willing to pay for seat $y$. The goal is to find a maximum-weight…
Erel Segal-Halevi
  • 6,088
  • 1
  • 25
  • 60
9
votes
3 answers

Find a minimum-cardinality Hall-violator

Given a bipartite graph $(X,Y,E)$, in which there is no perfect matching, I want to find a smallest subset that violates Hall's condition, i.e., a minimum-cardinality set $S \subseteq X$ for which $|N(S)|<|S|$. This problem is the optimization…
Y.Zhang
  • 91
  • 1
8
votes
1 answer

Complexity of removing edges to eliminate a perfect matching

Suppose $G$ is a bipartite graph which has a perfect matching. I want to find the fewest number of edges to delete from $G$ so that a perfect matching no longer exists. What is the complexity of this problem? I'm aware that perfect matching has a…
8
votes
2 answers

Why is Savage's Vertex Cover algorithm a 2-approximation?

Carla. D. Savage formulated the following approximation algorithm for the vertex cover problem. Given graph $G$, start at arbitrary node and traverse $G$ depth-first Obtain DFS tree $T$ return $V_C =$ internal nodes of $T$. Now I read everywhere…
oarfish
  • 343
  • 2
  • 8
7
votes
1 answer

Complexity of Hopcroft-Karp

I have a rather basic question about the number of operations taken by the Hopcroft-Karp algorithm for finding a maximum matching in a bipartite graph. It is commonly reported as $O(m \sqrt{n})$ where $m$ is the number of edges in the graph and $n$…
7
votes
1 answer

How are REGEXP implemented in programming languages?

Is there a good general paper about the interpretation or compilation of REGEXP in programming languages for pattern matching, with or without variables? I am not looking for a quick explanation about the construction of DFAs, but for a real paper…
7
votes
2 answers

Maximum matching using linear programming

In a bipartite graph $G = (V,E)$, there is a neat algorithm for finding a maximum matching (or even a maximum-weight matching) using linear programming. It is explained here. The first step is to solve the following…
Erel Segal-Halevi
  • 6,088
  • 1
  • 25
  • 60
6
votes
1 answer

Which algorithm can calculate an optimal allocation of students to projects?

I am trying to find an algorithm which calculates an optimal and stable allocation of $n$ students to $m$ projects, where each student strictly ranks all projects by preference. The available projects are predetermined and of fixed number and each…
ingr8
  • 63
  • 1
  • 4
6
votes
2 answers

The stable marriage algorithm with asymmetric arrays

I have a question about the stable marriage algorithm, for what I know it can only be used when I have arrays with the same number of elements for building the preference and the ranking matrices. For example if we have 10 students that should be…
Little
  • 173
  • 1
  • 5
6
votes
1 answer

Finding a perfect matching using an LP

I have a basic question about the power of Linear Programming that has been bothering me for some time. I believe there is something simple I am missing. Linear Programming is $\mathsf{P}$-complete, which means that every problem in $\mathsf{P}$…
SamM
  • 1,712
  • 13
  • 20
5
votes
1 answer

Set of vertex-disjoint cycles maximizing different colored vertices

Let $G=(V,E)$ be a directed graph whose vertices $v \in V$ have colors and its edges $e\in E$ have costs $cost(e)$. I am looking to find a set of vertex-disjoint cycles that: First maximizes the number of differently colored covered vertices. In…
Adama
  • 153
  • 5
1
2 3
16 17