restore indirect relations within a transitive relation

mardi 25 février 2014

Hi,



I have a transitive relation and wana build a complete set of pairs that reflect all (direct/indirect) relations among the pairs.



Ex.: suppose I have this relation R = { (1,2), (2,3), (3,5), (5,7), (3,4) }



I wana to produce this relation R oper R = { (1,2), (1,3), (1,4), (1,5), (1,7), (2,3), (2,4), (2,5), (2,7), (3,4), (3,5), (3,7), (5,7) }



I tried to use the composite operator (°), but I got this R U (R ° R) = { (1,2), (2,3), (3,5), (5,7), (3,4), (1,3), (2,4), (2,5), (3,7) } which is not complete. In this case I need a loop operator until all pairs are restored.



Is there an operator that I can used to reflect that?



Thanks in advance.





0 commentaires:

Enregistrer un commentaire