I have a big structure with items and relations between the items. I need to find all transitive relations for all items. I duplicate all links and use transitive closure. E.g.:
A --- B --- C E --- F --- G
|
|
D
As a result I need to get the pairs:
A-B, A-C, A-D, B-A, B-C, B-D, C-A, C-B, C-D, D-A, D-B, D-C,
E-F, E-G, F-E, F-G, G-E, G-F
For using transitive closure I should use pairs [A-B, B-A, B-C, C-B, B-D, D-B, E-F, F-E, F-G, G-F]. It's big problem for me because the dataset is very large. The best way to solve my problem would be an algorithm, that allows get all relations using only one-side links (A-B, B-C, C-D, E-F, F-G). Are there any algorithms to get all relations for each element of the graph without duplicate links?