Hi All! It's been a while 
I need to find a solution in order to identify all the numbers which are inter-related.
For example, 1 is linked to 2, and threfore 2 is linked to 1. So I have a chain 1-2.
Then 2 is linked to 3, and 3 is linked to 2, and it is linked to 1, so I have a chain 1-2-3.
Now, 4 is linked to 1 and 3 and this number are also inter-related (i.e. 1 is linked to 3) so I have a chain 1-3-4. Howewer 4 is not linked to 2 so I will not have a chain 1-2-3-4, but instead I will have a chain 1-2-3 and a chain 4-3
The final result should be a succession of chains, with the first chain being the longest (with all the numbers inter-related), and then the other chains should be shorter and shorter.
The aim is to find out which divisions (represented by number), are interdependant, and which are more likely to work in isolation.
I hope it does make sense, I am happy to use VBA but I am not sure how to do this yet. So if you have any idea please share!
Please find the example table below (the real one is quite bigger (58 divisions):
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]1
[/TD]
[TD]2
[/TD]
[TD]3
[/TD]
[TD]4
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD][/TD]
[TD]X
[/TD]
[TD]X
[/TD]
[TD]X
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]X
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]X
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]X
[/TD]
[TD][/TD]
[TD]X
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Many Thanks!

I need to find a solution in order to identify all the numbers which are inter-related.
For example, 1 is linked to 2, and threfore 2 is linked to 1. So I have a chain 1-2.
Then 2 is linked to 3, and 3 is linked to 2, and it is linked to 1, so I have a chain 1-2-3.
Now, 4 is linked to 1 and 3 and this number are also inter-related (i.e. 1 is linked to 3) so I have a chain 1-3-4. Howewer 4 is not linked to 2 so I will not have a chain 1-2-3-4, but instead I will have a chain 1-2-3 and a chain 4-3
The final result should be a succession of chains, with the first chain being the longest (with all the numbers inter-related), and then the other chains should be shorter and shorter.
The aim is to find out which divisions (represented by number), are interdependant, and which are more likely to work in isolation.
I hope it does make sense, I am happy to use VBA but I am not sure how to do this yet. So if you have any idea please share!
Please find the example table below (the real one is quite bigger (58 divisions):
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]1
[/TD]
[TD]2
[/TD]
[TD]3
[/TD]
[TD]4
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD][/TD]
[TD]X
[/TD]
[TD]X
[/TD]
[TD]X
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]X
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]X
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]X
[/TD]
[TD][/TD]
[TD]X
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Many Thanks!

Last edited: