I need to write an algorithm that, given a social network represented as a graph, finds out if a set of people X form a close relationship. This means that every person in X has a relation with each other.
For example if we have the graph:
The set {H,B,O} form a close friendship since every person in the subgraph is connected to each other.
The set {O,F,K} does not since we can't go from O to F
How would pseudocode for this specific algorithm look like?