Class WeaklyStableMarriage<T>
- java.lang.Object
-
- com.bakdata.dedupe.matching.AbstractStableMarriage<T>
-
- com.bakdata.dedupe.matching.WeaklyStableMarriage<T>
-
- Type Parameters:
T
- the type of the record.
- All Implemented Interfaces:
Assigner<T>
,BipartiteMatcher<T>
public final class WeaklyStableMarriage<T> extends AbstractStableMarriage<T>
Implements a weakly stable matching based on the stable marriage with indifference (i.e., ties)."A matching will be called weakly stable unless there is a couple each of whom strictly prefers the other to his/her partner in the matching. It is not hard to see that, in the stable marriage case, if ties are broken arbitrarily, any matching that is stable in the resulting (strict) instance is weakly stable in the original instance. So the Gale/Shapley algorithm (or other algorithms that find a stable matching in the classical case) may be applied in this context to find a weakly stable matching."[1]
The preference list may be incomplete if some pairs absolutely do not want to matched. However, in this case, there may be fewer matches than elements.
[1] Irving, Robert W. (1994-02-15). "Stable marriage and indifference". Discrete Applied Mathematics. 48 (3): 261–272. doi:10.1016/0166-218X(92)00179-P.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.bakdata.dedupe.matching.AbstractStableMarriage
AbstractStableMarriage.AbstractMatcher, AbstractStableMarriage.Matcher
-
-
Constructor Summary
Constructors Constructor Description WeaklyStableMarriage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(java.lang.Object other)
protected AbstractStableMarriage.Matcher
createMatcher(java.util.List<? extends java.util.Queue<java.util.List<java.lang.Integer>>> mensFavoriteWomen, java.util.List<? extends java.util.Queue<java.util.List<java.lang.Integer>>> womensFavoriteMen)
boolean
equals(java.lang.Object o)
int
hashCode()
java.lang.String
toString()
-
Methods inherited from class com.bakdata.dedupe.matching.AbstractStableMarriage
match
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.bakdata.dedupe.matching.Assigner
assignMaterialized
-
Methods inherited from interface com.bakdata.dedupe.matching.BipartiteMatcher
assign, matchMaterialized
-
-
-
-
Method Detail
-
createMatcher
protected AbstractStableMarriage.Matcher createMatcher(java.util.List<? extends java.util.Queue<java.util.List<java.lang.Integer>>> mensFavoriteWomen, java.util.List<? extends java.util.Queue<java.util.List<java.lang.Integer>>> womensFavoriteMen)
- Specified by:
createMatcher
in classAbstractStableMarriage<T>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-