If g is c's brother then clearly c is also g's brother.
If you want to only show one of these two orderings then also require that X and Y be in alphabetical order: compare(<, X, Y).
But the situation is even worse. Suppose Huey, Dewey, and Louie all have the same father, so they are all brothers or half brothers. Then you will get SIX results for them, pairwise in each order, or 3 results if you require alphabetical order.
It looks to me like you need to do some more work on DEFINING THE PROBLEM before jumping into coding. For examples, if Bob and Carl have the same mother but different fathers are they to be considered as brothers? Do you want to distinguish full brothers from half brothers?
--
---------------------------
| BBB b \ Barbara at LivingHistory stop co stop uk
| B B aa rrr b |
| BBB a a r bbb | ,008015L080180,022036,029037
| B B a a r b b | ,047045,L014114L4.
| BBB aa a r bbb |
-----------------------------