Calculating weighted similarity or difference (e.g., don`t-care areas)