I'm experimenting with the graph coloring algorithm. That is a way of coloring the nodes of a graph such that no 2 adjacent nodes have the same color.
Suppose I have the following data I want to "color" (assign to groups), where each word is a node:
- cat black
- cat grey
- dog grey
- dog black
I would expect the following groups:
- cat, dog
- black, grey
But what if I add the name of my 4th animal, which is grey (just like the color)?
So the 4th line becomes:
- dog black grey
The coloring algorithm couldn't distinguish between colors and names, so black and grey would end up in different groups.
How could I adjust the algorithm so that it becomes "less strict"?
Like: Only if 2 nodes appear in more than 90% together, consider them adjacent and put them in the same group.
Note: The example I provided is simplified. I can't just group my words by name or color, so I need a more general approach.