In graph theory, a '''Hall violator''' is a set of vertices in a graph, that violate the condition to Hall's marriage theorem.<ref>{{Cite arXiv|last=Lenchner|first=Jonathan|date=2020-01-19|title=On a Generalization of the Marriage Problem|class=math.CO|language=en|eprint=1907.05870v3}}</ref>
Formally, given a bipartite graph {{math|1=''G'' = (''X'' + ''Y'', ''E'')}}, a Hall-violator in {{math|''X''}} is a subset {{math|''W''}} of {{math|''X''}}, for which {{math|{{!}}''N<sub>G</sub>''(''W''){{!}} < {{!}}''W''{{!}}}}, where {{math|''N<sub>G</sub>''(''W'')}} is the set of neighbors of {{math|''W''}} in {{math|''G''}}.
If {{math|''W''}} is a Hall violator, then there is no matching that saturates all vertices of {{math|''W''}}. Therefore, there is also no matching that saturates {{math|''X''}}. Hall's marriage theorem says that the opposite is also true: if there is no Hall violator, then there exists a matching that saturates {{math|''X''}}.
== Algorithms == thumb|250x250px
=== Finding a Hall violator === A Hall violator can be found by an efficient algorithm. The algorithm below uses the following terms:
* An ''{{math|M}}-alternating path'', for some matching {{math|''M''}}, is a path in which the first edge is not an edge of {{math|''M''}}, the second edge is of {{math|''M''}}, the third is not of {{math|''M''}}, etc. * A vertex {{math|''z''}} is ''{{math|M}}-reachable'' from some vertex {{math|''x''}}, if there is an {{math|''M''}}-alternating path from {{math|''x''}} to {{math|''z''}}.
As an example, consider the figure at the right, where the vertical (blue) edges denote the matching {{math|''M''}}. The vertex sets {{math|''Y''<sub>1</sub>, ''X''<sub>1</sub>,''Y''<sub>2</sub>, ''X''<sub>2</sub>}}, are {{math|''M''}}-reachable from {{math|''x''<sub>0</sub>}} (or any other vertex of {{math|''X''<sub>0</sub>}}), but {{math|''Y''<sub>3</sub>}} and {{math|''X''<sub>3</sub>}} are not {{math|''M''}}-reachable from {{math|''x''<sub>0</sub>}}.
The algorithm for finding a Hall violator proceeds as follows.
# Find a maximum matching {{math|''M''}} (it can be found with the Hopcroft–Karp algorithm). # If all vertices of {{math|''X''}} are matched, then '''return "There is no Hall violator".''' # Otherwise, let {{math|''x''<sub>0</sub>}} be an unmatched vertex. # Let {{math|''W''}} be the set of all vertices of {{math|''X''}} that are {{math|''M''}}-reachable from {{math|''x''<sub>0</sub>}} (it can be found using Breadth-first search; in the figure, {{math|''W''}} contains {{math|''x''<sub>0</sub>}} and {{math|''X''<sub>1</sub>}} and {{math|''X''<sub>2</sub>}}). # '''Return {{math|''W''}}'''.
This {{math|''W''}} is indeed a Hall-violator because of the following facts:
* All vertices of {{math|''N<sub>G</sub>''(''W'')}} are matched by {{math|''M''}}. Suppose by contradiction that some vertex {{math|''y''}} in {{math|''N<sub>G</sub>''(''W'')}} is unmatched by {{math|''M''}}. Let {{math|''x''}} be its neighbor in ''{{math|W}}''. The path from {{math|''x''<sub>0</sub>}} to {{math|''x''}} to {{math|''y''}} is an {{math|''M''}}-augmenting path - it is {{math|''M''}}-alternating and it starts and ends with unmatched vertices, so by "inverting" it we can increase {{math|''M''}}, contradicting its maximality. * {{math|''W''}} contains all the matches of {{math|''N<sub>G</sub>''(''W'')}} by {{math|''M''}}. This is because all these matches are {{math|''M''}}-reachable from {{math|''x''<sub>0</sub>}}. * {{math|''W''}} contains another vertex - {{math|''x''<sub>0</sub>}} - that is unmatched by {{math|''M''}} by definition. * Hence, {{math|1={{!}}''W''{{!}} = {{!}}''N<sub>G</sub>''(''W''){{!}} + 1 > {{!}}''N<sub>G</sub>''(''W''){{!}}}}, so {{math|''W''}} indeed satisfies the definition of a Hall violator.
=== Finding minimal and minimum Hall violators === An '''inclusion-minimal Hall violator''' is a Hall violator such that each of its subsets is not a Hall violator.
The above algorithm, in fact, finds an inclusion-minimal Hall violator. This is because, if any vertex is removed from {{math|''W''}}, then the remaining vertices can be perfectly matched to the vertices of {{math|''N<sub>G</sub>''(''W'')}} (either by edges of {{math|''M''}}, or by edges of the M-alternating path from {{math|''x''<sub>0</sub>}}).<ref>{{Cite journal|last1=Gan|first1=Jiarui|last2=Suksompong|first2=Warut|last3=Voudouris|first3=Alexandros A.|date=2019-09-01|title=Envy-freeness in house allocation problems|journal=Mathematical Social Sciences|volume=101|pages=104–106|doi=10.1016/j.mathsocsci.2019.07.005|issn=0165-4896|arxiv=1905.00468|s2cid=143421680}}</ref>
The above algorithm does not necessarily find a '''minimum-cardinality Hall violator'''. For example, in the above figure, it returns a Hall violator of size 5, while {{math|''X''<sub>0</sub>}} is a Hall violator of size 3.
In fact, finding a minimum-cardinality Hall violator is NP-hard. This can be proved by reduction from the Clique problem.<ref>Aditya Kabra. "[http://dr.iiserpune.ac.in:8080/xmlui/handle/123456789/1005 Parameterized Complexity of Minimum k Union Problem]". MS Thesis. Theorem 3.2.5. This is also Exercise 13.28 in [4] Marek Cygan, Fedor V. Fomin, Lukasz Kowalik, Daniel Lokshtanov, Dniel Marx, Marcin Pilipczuk, Micha Pilipczuk and Saket Saurabh, "Parameterized Algorithms", Springer, 2016. See also [https://cs.stackexchange.com/a/147733/1342 this CS stackexchange post].</ref>
=== Finding a Hall violator or an augmenting path === The following algorithm<ref>{{Cite web|url=https://www.cse.ust.hk/~golin/COMP572/Notes/Matching.pdf|title=Bipartite Matching & the Hungarian Method|last=Mordecai J. Golin|date=2006|website=}}</ref><ref>{{Cite arXiv|last1=Segal-Halevi|first1=Erel|last2=Aigner-Horev|first2=Elad|date=2019-01-28|title=Envy-free Matchings in Bipartite Graphs and their Applications to Fair Division|class=cs.DS|language=en|eprint=1901.09527v2}}</ref> takes as input an arbitrary matching {{math|''M''}} in a graph, and a vertex {{math|''x''<sub>0</sub>}} in {{math|''X''}} that is not saturated by {{math|''M''}}.
It returns as output, either a Hall violator that contains {{math|''x''<sub>0</sub>}}, or a path that can be used to augment {{math|''M''}}.
# Set {{math|1=''k'' = 0}}, {{math|1=''W<sub>k</sub>'' := {''x<sub>0</sub>''}}}, {{math|1=''Z<sub>k</sub>'' := {} }}. # Assert: #* {{math|1=''W<sub>k</sub>'' = {''x''<sub>0</sub>,...,''x<sub>k</sub>''} }} where the {{math|''x<sub>i</sub>''}} are distinct vertices of {{math|''X''}}; #* {{math|1=''Z<sub>k</sub>'' = {''y''<sub>1</sub>,...,''y<sub>k</sub>''} }} where the {{math|''y<sub>i</sub>''}} are distinct vertices of {{math|''Y''}}; #* For all {{math|''i'' ≥ 1}}, {{math|''y<sub>i</sub>''}} is matched to {{math|''x<sub>i</sub>''}} by {{math|''M''}}. #* For all {{math|''i'' ≥ 1}}, {{math|''y<sub>i</sub>''}} is connected to some {{math|''x<sub>j</sub>''<sub><''i''</sub>}} by an edge not in {{math|''M''}}. # If {{math|N<sub>''G''</sub>(''W<sub>k</sub>'') ⊆ ''Z<sub>k</sub>''}}, then {{math|''W<sub>k</sub>''}} is a Hall violator, since {{math|1={{!}}''W''<sub>''k''</sub>{{!}} = ''k''+1 > ''k'' = {{!}}''Z''<sub>''k''</sub>{{!}} ≥ {{!}}''N''<sub>''G''</sub>(''W''<sub>''k''</sub>){{!}}}}. '''Return the Hall-violator {{math|''W<sub>k</sub>''}}'''. # Otherwise, let {{math|''y''<sub>''k''+1</sub>}} be a vertex in {{math|''N''<sub>''G''</sub>(''W<sub>k</sub>'') \ ''Z<sub>k</sub>.''}} Consider the following two cases: # Case 1: {{math|''y''<sub>''k''+1</sub>}} is matched by {{math|''M''}}. #* Since {{math|''x''<sub>0</sub>}} is unmatched, and every {{math|''x<sub>i</sub>''}} in {{math|''W<sub>k</sub>''}} is matched to {{math|''y<sub>i</sub>''}} in {{math|''Z<sub>k</sub>''}}, the partner of this {{math|''y''<sub>''k''+1</sub>}} must be some vertex of {{math|''X''}} that is not in {{math|''W<sub>k</sub>''}}. Denote it by {{math|''x''<sub>''k''+1</sub>}}. #* Let {{math|1=''W''<sub>''k''+1</sub> := ''W''<sub>''k''</sub> U {''x''<sub>''k''+1</sub>} }} and {{math|1=''Z''<sub>''k''+1</sub> := ''Z''<sub>''k''</sub> U {''y''<sub>''k''+1</sub>} }} and {{math|1=''k'' := ''k'' + 1}}. #* '''Go back to step 2'''. # Case 2: {{math|''y''<sub>''k''+1</sub>}} is unmatched by {{math|''M''}}. #* Since {{math|''y''<sub>''k''+1</sub>}} is in {{math|N<sub>''G''</sub>(''W<sub>k</sub>'')}}, it is connected to some {{math|''x<sub>i</sub>''}} (for {{math|''i'' < ''k'' + 1}}) by an edge not in {{math|''M''}}. {{math|''x<sub>i</sub>''}} is connected to {{math|''y<sub>i</sub>''}} by an edge in {{math|''M''}}. {{math|''y<sub>i</sub>''}} is connected to some {{math|''x''<sub>''j''</sub>}} (for {{math|''j'' < ''i''}}) by an edge not in {{math|''M''}}, and so on. Following these connections must eventually lead to {{math|''x''<sub>0</sub>}}, which is unmatched. Hence we have an M-augmenting path. '''Return the M-augmenting path'''.
At each iteration, {{math|''W<sub>k</sub>''}} and {{math|''Z<sub>k</sub>''}} grow by one vertex. Hence, the algorithm must finish after at most {{math|{{!}}''X''{{!}}}} iterations.
The procedure can be used iteratively: start with {{math|''M''}} being an empty matching, call the procedure again and again, until either a Hall violator is found, or the matching {{math|''M''}} saturates all vertices of {{math|''X''}}. This provides a constructive proof to Hall's theorem.
== External links ==
* An application of Hall violators in constraint programming.<ref>{{Cite journal|last1=Elffers|first1=Jan|last2=Gocht|first2=Stephan|last3=McCreesh|first3=Ciaran|last4=Nordström|first4=Jakob|date=2020-04-03|title=Justifying All Differences Using Pseudo-Boolean Reasoning|url=https://ojs.aaai.org/index.php/AAAI/article/view/5507|journal=Proceedings of the AAAI Conference on Artificial Intelligence|language=en|volume=34|issue=2|pages=1486–1494|doi=10.1609/aaai.v34i02.5507|s2cid=208242680|issn=2374-3468|doi-access=free}}</ref> * {{Cite web|url=https://cs.stackexchange.com/q/30017/1342|title=Finding a subset in bipartite graph violating Hall's condition|date=2014-09-15|website=Computer science stack exchange|access-date=2019-09-08}}
== References == {{Reflist}}
Category:Graph theory objects Category:Matching (graph theory)