The most straightforward relationship is
Father (B) and son (A).
The most reduced relationship is
A = B (self), with the two grandfathers coming from different paternal / maternal lineages - for example, if both grandfathers married the same woman at some point.
The weakest relationship is
A and B are more distantly related than through their grandfathers, if A’s grandfather sired A’s parent before A’s grandfather was adopted by B’s grandfather. If B’s grandfather disclaimed any prior progeny that A’s grandfather sired before adoption, there might not even be a legal relationship between A and B that originated from their grandfathers.