Suppose a number of trees among which we have the following tree. Tree configuration's is represented by 2 lists arranged as tuples representing tree edge's:
ss-pair=[(1, 2), (2, 3), (3, 4), (4, 5), (8, 9), (9, 10), (11, 12), (12, 13), (13, 14), (14, 15)]
ts-pair=[(4, 9), (6, 11),(8, 13)]
What is required is to find the direct and indirect links between the two lists.
By examining the two lists, it can be seen that ts-pair edge (6,11) is a direct link since node 6 DOES NOT APPEAR in the ss-pair list although node 11 is present, while (4, 9) and (8, 13) edges are indirect links, nodes 4, 8, 9 and 13 are in ss-pair.
Expected result should be:
direct-link=[(6, 11)]
indirect-link=[(4, 9), (8, 13)]
The question is: how to get the expected result and generalize the code for any tree configuration ?