# [graph-tool] clique-finding algorithm

Snehal Shekatkar snehalshekatkar at gmail.com
Thu Oct 27 16:50:30 CEST 2016

```Though the snippet that I provided is not the best possible that one could
write, it breaks the loop if the bigger clique than the last one is not
found (if tot ==0; break). Perhaps you should use `while` and do the same
thing.

Regards
Snehal

On Thu, Oct 27, 2016 at 7:53 PM, Reckoner <reckoner at gmail.com> wrote:

> How do you know if the clique is maximal ( not contained in a larger
> clique)?
>
> On Wed, Oct 26, 2016 at 8:13 AM, Snehal Shekatkar
> <snehalshekatkar at gmail.com> wrote:
> > I don't think any such function exists. But if you can use gt.motifs to
> do
> > this. For example, the following code gives simple implementation for
> > finding the size of the maximum clique:
> >
> > G = gt.price_network(100, 3, directed = False)
> >
> > tot = 1
> >
> > for i in range(1, G.num_vertices() + 1):
> >     g = gt.complete_graph(i)
> >     tot = gt.motifs(G, k = i, motif_list = [g, ])[1][0]
> >     print(i, tot)
> >     if tot == 0:
> >         break
> >
> > Regards
> > Snehal
> >
> >
> > On Wed, Oct 26, 2016 at 6:42 PM, Reckoner <reckoner at gmail.com> wrote:
> >>
> >> Hi,
> >>
> >> Are there any maximal clique-finding algorithms implemented in graph
> tool?
> >>
> >> For example,
> >>
> >>
> generated/networkx.algorithms.clique.find_cliques.html
> >>
> >>
> >> Thanks!
> >> _______________________________________________
> >> graph-tool mailing list
> >> graph-tool at skewed.de
> >> https://lists.skewed.de/mailman/listinfo/graph-tool
> >
> >
> >
> >
> > --
> >
> >
> >
> >
> > Snehal Madhukar Shekatkar
> > Pune
> > India
> >
> > _______________________________________________
> > graph-tool mailing list
> > graph-tool at skewed.de
> > https://lists.skewed.de/mailman/listinfo/graph-tool
> >
> _______________________________________________
> graph-tool mailing list
> graph-tool at skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>

--