use KNIME to find out relationship

I want to use KNIME to find out relation between products.
For example, product 1 is produced by plant A, and procut 9 &procut 2 is also produced by plant A,
which means procut 9 is a sub-product of product 1 .So product 5 is sub-product of product 9.

plant Product code
A 1
B 5
B 9
A 9
A 2
Finally, i want to get a report like below:

P Sub-P
1 9
1 5
1 2

Hi there!

Sry for a later response. This sounds interesting and I would love to tackle it with KNIME but don’t quite get the logic so if you can explain a bit more would be thankful. Here are couple of questions:

  • So why are 2 and 9 sub-products of 1? Because 1 is less than 2 and 9 or?
  • Also why is 5 sub-product of 9? Because they are from the same plant (B) but 9 is also from plant A and already a sub-product so 9 can not be sub-product from two products?
  • Algorithm should start determining sub-products using alphabetic order? Cause if you start from B you would have 9 being sub-product of 5 and 1 and 2 sub-product of 1 and 2…

Enlighten us and we will help you :smiley:

Have a nice day,
Ivan