Say we have a graph:
g = CompleteGraph[5];
and that we want to find all the triangles in g
. I tried to use FindKClique
, in the following way:
FindKClique[g,1,{3},All]
but it returns an empty list and I am not sure why. I must be misunderstanding something about FindKClique
but I'm not sure what it is. The output I would expect to get is the following:
Map[First,FindCycle[g,{3},All],{2}]
{{3, 2, 4}, {3, 5, 4}, {1, 5, 3}, {2, 3, 5}, {2, 4, 5}, {1, 5, 2}, {1, 3, 2}, {1, 2, 4}, {1, 3, 4}, {1, 5, 4}}
Can someone explain why FindKClique
is not doing what I thought it would?