I have a list of 2 tuples and I want to find a set of numbers, any 2 combination of which exists in the list (order does not matter). For example, here is a set of data and I want to find subgraph which is a complete graph with 4 vertices:
UndirectedEdge @@@
Join[{{1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}},
RandomInteger[{1, 20}, {100, 2}] /. {i_, i_} :> Nothing]
which should return me {1, 2, 3, 4} (and other pairs if randomly generated).
My current brute force solution is to find ConnectedComponents of size 3, and try to add new vertex one by one.(And using CompleteGraphQ seems not feasible too). Are there better solutions?
(In my real problem the number of vertices is not 4, so please do not use any special properties of it.)