compare and grouped it.

Joined
May 26, 2011
Messages
1
Reaction score
0
hi ,
i have a table which have values like this :

Sub A Sub B Sub C Sub D
Sub A 0 0 1 0
Sub B 0 0 0 1
Sub C 1 0 0 1
Sub D 0 1 1 0

i want to compare columns and rows and assign color to Sub A, B , C and D and group it using graph coloring method. the value 0 means both 2 sub are connected and if 1 its not connected. If the value is 0 the color between those to sub must be different and if 1 can be same color but have to make sure the color not had been assigned to other sub which are already connected to itself. in this example the subs will be assigned with 2 colors which means 2 groups. Sub A - red, Sub C -red, Sub B - blue and Sub D- blue. Sub B and D not connected so it can be in same color. and same goes to Sub A and C. the final output should be in a table like this:

Column 1(red) Column 2(blue)
Sub A Sub B
Sub C Sub D

it has to be implemented in vb code. anyone please help me for the solution.
thanks.
 
Back
Top