I am trying to find all maximal cliques in a graph, without overlapping.
the function max_cliques()
returns all possible maximal cliques in the graph, but I want every vertex to be included in only one clique- in the largest clique it can be part of.
for example, if the output of the max_cliques()
are the following cliques:
{A,B,C}, {A,B,D}, {A,B,J,K}, {E,F,G,H}, {E,F,G,I}
I want to remove some cliques so that all the vertexes will appear in exacly one clique, so the final set will be:
{A,B,J,K}, {E,F,G,H}
A and B are included in 3 cliques, so I want to choose the cliques so that the final set will include maximum vertexes as possible. if there are two possible cliques in the same length- take a random one. (I don't mind to not include all the vertexes)
I would really appreciate an idea to solve this problem, even without going into details of cliques- the question is basically how to remove the shortest "lists" that contain overlapping elements.
thanks in advance