public Set < Integer > getSharedVariables ( int factor1 , int factor2 ) { Set < Integer > varNums = new HashSet < Integer > ( factorVariableMap . get ( factor1 ) ) ; varNums . retainAll ( factorVariableMap . get ( factor2 ) ) ; return varNums ; }
Get all of the variables that the two factors have in common .