a map<pair, float> might even be enough if the relation has no other purpose than holding this value.