Ticket #5793: cliquer-5-ref.patch

File cliquer-5-ref.patch, 22.1 KB (added by rlm, 12 years ago)

Editing.

  • sage/graphs/cliquer.pyx

    # HG changeset patch
    # User Robert L. Miller <rlm@rlmiller.org>
    # Date 1248202547 25200
    # Node ID 121192e56a226dd67175a76683f8b255deb7e62b
    # Parent  bd5ab662f750d41d98b34246bd0babf24d2423b4
    Editing for trac #5793
    
    diff -r bd5ab662f750 -r 121192e56a22 sage/graphs/cliquer.pyx
    a b  
    9494   
    9595    EXAMPLES::
    9696   
    97     sage: C = Graph('DJ{')
    98     sage: clique_number(C)
    99     4
    100     sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
    101     sage: G.show(figsize=[2,2])
    102     sage: clique_number(G)
    103     3
     97        sage: C = Graph('DJ{')
     98        sage: clique_number(C)
     99        4
     100        sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
     101        sage: G.show(figsize=[2,2])
     102        sage: clique_number(G)
     103        3
    104104    """
    105105    graph=graph.relabel(inplace=False)
    106106    cdef graph_t *g
     
    116116
    117117
    118118def list_composition(a,b):
     119    """
     120    Composes a list ``a`` with a map ``b``.
     121   
     122    EXAMPLE::
     123   
     124        sage: from sage.graphs.cliquer import list_composition
     125        sage: list_composition([1,3,'a'], {'a':'b', 1:2, 2:3, 3:4})
     126        [2, 4, 'b']
     127   
     128    """
    119129    value=[]
    120130    for i in a:
    121131        value.append(b[i])
  • sage/graphs/graph.py

    diff -r bd5ab662f750 -r 121192e56a22 sage/graphs/graph.py
    a b  
    97559755
    97569756    ### Cliques
    97579757   
    9758     def cliques(self):
    9759         """
    9760         Returns the list of maximal cliques. Each maximal clique is
    9761         represented by a list of vertices.
    9762        
    9763         Currently only implemented for undirected graphs. Use
    9764         to_undirected to convert a digraph to an undirected graph.
    9765        
    9766         Maximal cliques are the largest complete subgraphs containing a
    9767         given point. This function is based on Networkx's implementation of
    9768         the Bron and Kerbosch Algorithm, [1].
    9769        
     9758    def cliques_maximal(self):
     9759        """
     9760        Returns the list of all maximal cliques, with each clique represented
     9761        by a list of vertices. A clique is an induced complete subgraph, and a
     9762        maximal clique is one not contained in a larger one.
     9763       
     9764        NOTES:
     9765       
     9766         - Currently only implemented for undirected graphs. Use to_undirected
     9767           to convert a digraph to an undirected graph.
     9768       
     9769        ALGORITHM:
     9770       
     9771         - This function is based on Networkx's implementation of the Bron and
     9772           Kerbosch Algorithm, [1].
     9773           
    97709774        REFERENCE:
    97719775
    97729776        - [1] Coen Bron and Joep Kerbosch. (1973). Algorithm 457:
     
    97769780       
    97779781        EXAMPLES::
    97789782       
    9779             sage: (graphs.ChvatalGraph()).cliques()
     9783            sage: graphs.ChvatalGraph().cliques_maximal()
    97809784            [[0, 1], [0, 4], [0, 6], [0, 9], [2, 1], [2, 3], [2, 6], [2, 8], [3, 4], [3, 7], [3, 9], [5, 1], [5, 4], [5, 10], [5, 11], [7, 1], [7, 8], [7, 11], [8, 4], [8, 10], [10, 6], [10, 9], [11, 6], [11, 9]]
    97819785            sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
    97829786            sage: G.show(figsize=[2,2])
    9783             sage: G.cliques()
     9787            sage: G.cliques_maximal()
    97849788            [[0, 1, 2], [0, 1, 3]]
     9789            sage: C=graphs.PetersenGraph()
     9790            sage: C.cliques_maximal()
     9791            [[0, 1], [0, 4], [0, 5], [2, 1], [2, 3], [2, 7], [3, 4], [3, 8], [6, 1], [6, 8], [6, 9], [7, 5], [7, 9], [8, 5], [9, 4]]
     9792            sage: C = Graph('DJ{')
     9793            sage: C.cliques_maximal()
     9794            [[4, 1, 2, 3], [4, 0]]
     9795
    97859796        """
    97869797        import networkx.cliques
    97879798        return networkx.cliques.find_cliques(self.networkx_graph(copy=False))
    97889799       
     9800    def cliques(self):
     9801        """
     9802        (Deprecated) alias for ``cliques_maximal``. See that function for more
     9803        details.
     9804       
     9805        EXAMPLE::
     9806       
     9807            sage: C = Graph('DJ{')
     9808            sage: C.cliques()
     9809            doctest:...: DeprecationWarning: The function 'cliques' has been deprecated. Use 'cliques_maximal' or 'cliques_maximum'.
     9810            [[4, 1, 2, 3], [4, 0]]
     9811
     9812        """
     9813        from sage.misc.misc import deprecation
     9814        deprecation("The function 'cliques' has been deprecated. Use " + \
     9815                    "'cliques_maximal' or 'cliques_maximum'.")
     9816        return self.cliques_maximal()
     9817       
     9818    def cliques_maximum(self):
     9819        """
     9820        Returns the list of all maximum cliques, with each clique represented
     9821        by a list of vertices. A clique is an induced complete subgraph, and a
     9822        maximum clique is one of maximal order.
     9823       
     9824        NOTES:
     9825       
     9826         - Currently only implemented for undirected graphs. Use to_undirected
     9827           to convert a digraph to an undirected graph.
     9828       
     9829        ALGORITHM:
     9830       
     9831         - This function is based on Cliquer, [1].
     9832           
     9833        REFERENCE:
     9834
     9835        - [1] Sampo Niskanen and Patric R. J. Östergård, "Cliquer User's Guide,
     9836          Version 1.0," Communications Laboratory, Helsinki University of
     9837          Technology, Espoo, Finland, Tech. Rep. T48, 2003.
     9838       
     9839        EXAMPLES::
     9840       
     9841            sage: graphs.ChvatalGraph().cliques_maximum()
     9842            [[0, 1], [0, 4], [0, 6], [0, 9], [1, 2], [1, 5], [1, 7], [2, 3], [2, 6], [2, 8], [3, 4], [3, 7], [3, 9], [4, 5], [4, 8], [5, 10], [5, 11], [6, 10], [6, 11], [7, 8], [7, 11], [8, 10], [9, 10], [9, 11]]
     9843            sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
     9844            sage: G.show(figsize=[2,2])
     9845            sage: G.cliques_maximum()
     9846            [[0, 1, 2], [0, 1, 3]]
     9847            sage: C=graphs.PetersenGraph()
     9848            sage: C.cliques_maximum()
     9849            [[0, 1], [0, 4], [0, 5], [1, 2], [1, 6], [2, 3], [2, 7], [3, 4], [3, 8], [4, 9], [5, 7], [5, 8], [6, 8], [6, 9], [7, 9]]
     9850            sage: C = Graph('DJ{')
     9851            sage: C.cliques_maximum()
     9852            [[1, 2, 3, 4]]
     9853
     9854        """
     9855        from sage.graphs.cliquer import all_max_clique
     9856        return sorted(all_max_clique(self))
     9857
     9858    def clique_maximum(self):
     9859        """
     9860        Returns the vertex set of a maximal order complete subgraph.
     9861       
     9862        NOTE:
     9863       
     9864         - Currently only implemented for undirected graphs. Use to_undirected
     9865           to convert a digraph to an undirected graph.
     9866       
     9867        ALGORITHM:
     9868       
     9869         - This function is based on Cliquer, [1].
     9870           
     9871        REFERENCE:
     9872
     9873        - [1] Sampo Niskanen and Patric R. J. Östergård, "Cliquer User's Guide,
     9874          Version 1.0," Communications Laboratory, Helsinki University of
     9875          Technology, Espoo, Finland, Tech. Rep. T48, 2003.
     9876       
     9877        EXAMPLES::
     9878       
     9879            sage: C=graphs.PetersenGraph()
     9880            sage: C.clique_maximum()
     9881            [7, 9]
     9882            sage: C = Graph('DJ{')
     9883            sage: C.clique_maximum()
     9884            [1, 2, 3, 4]
     9885
     9886        """
     9887        from sage.graphs.cliquer import max_clique
     9888        return max_clique(self)
     9889
     9890    def clique_number(self, algorithm="cliquer", cliques=None):
     9891        """
     9892        Returns the order of the largest clique of the graph (the clique
     9893        number).
     9894
     9895        NOTE:
     9896       
     9897         - Currently only implemented for undirected graphs. Use to_undirected
     9898           to convert a digraph to an undirected graph.
     9899
     9900        INPUT:
     9901       
     9902         - ``algorithm`` - either ``cliquer`` or ``networkx``
     9903       
     9904           - ``cliquer`` - This wraps the C program Cliquer, [1].
     9905       
     9906           - ``networkx`` - This function is based on Networkx's implementation
     9907                of the Bron and Kerbosch Algorithm, [2].
     9908           
     9909         - ``cliques'' - an optional list of cliques that can be input if
     9910              already computed. Ignored unless ``algorithm=='networkx'``.
     9911       
     9912        REFERENCE:
     9913
     9914        - [1] Sampo Niskanen and Patric R. J. Östergård, "Cliquer User's Guide,
     9915          Version 1.0," Communications Laboratory, Helsinki University of
     9916          Technology, Espoo, Finland, Tech. Rep. T48, 2003.
     9917
     9918        - [2] Coen Bron and Joep Kerbosch. (1973). Algorithm 457:
     9919          Finding All Cliques of an Undirected Graph. Commun. ACM. v
     9920          16. n 9.  pages 575-577. ACM Press. [Online] Available:
     9921          http://www.ram.org/computing/rambin/rambin.html
     9922       
     9923        EXAMPLES::
     9924       
     9925            sage: C = Graph('DJ{')
     9926            sage: C.clique_number()
     9927            4
     9928            sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
     9929            sage: G.show(figsize=[2,2])
     9930            sage: G.clique_number()
     9931            3
     9932
     9933        """
     9934        if algorithm=="cliquer":
     9935            from sage.graphs.cliquer import clique_number
     9936            return clique_number(self)       
     9937        elif algorithm=="networkx":
     9938            import networkx.cliques
     9939            return networkx.cliques.graph_clique_number(self.networkx_graph(copy=False),cliques)
     9940        else:
     9941            raise NotImplementedError("Only 'networkx' and 'cliquer' are supported.")
     9942
     9943    def cliques_number_of(self, vertices=None, cliques=None, with_labels=False):
     9944        """
     9945        Returns a list of the number of maximal cliques containing each
     9946        vertex. (Returns a single value if only one input vertex).
     9947       
     9948        NOTES:
     9949       
     9950         - Currently only implemented for undirected graphs. Use to_undirected
     9951           to convert a digraph to an undirected graph.
     9952       
     9953        INPUT:
     9954       
     9955        -  ``vertices`` - the vertices to inspect (default is
     9956           entire graph)
     9957       
     9958        -  ``with_labels`` - (boolean) default False returns
     9959           list as above True returns a dictionary keyed by vertex labels
     9960       
     9961        -  ``cliques`` - list of cliques (if already
     9962           computed)
     9963       
     9964       
     9965        EXAMPLES::
     9966       
     9967            sage: C = Graph('DJ{')
     9968            sage: C.cliques_number_of()
     9969            [1, 1, 1, 1, 2]
     9970            sage: E = C.cliques_maximal()
     9971            sage: E
     9972            [[4, 1, 2, 3], [4, 0]]
     9973            sage: C.cliques_number_of(cliques=E)
     9974            [1, 1, 1, 1, 2]
     9975            sage: F = graphs.Grid2dGraph(2,3)
     9976            sage: X = F.cliques_number_of(with_labels=True)
     9977            sage: for v in sorted(X.iterkeys()):
     9978            ...    print v, X[v]
     9979            (0, 0) 2
     9980            (0, 1) 3
     9981            (0, 2) 2
     9982            (1, 0) 2
     9983            (1, 1) 3
     9984            (1, 2) 2
     9985            sage: F.cliques_number_of(vertices=[(0, 1), (1, 2)])
     9986            [3, 2]
     9987            sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
     9988            sage: G.show(figsize=[2,2])
     9989            sage: G.cliques_number_of()
     9990            [2, 2, 1, 1]
     9991        """
     9992        import networkx.cliques
     9993        return networkx.cliques.number_of_cliques(self.networkx_graph(copy=False), vertices, cliques, with_labels)
     9994       
    97899995    def cliques_get_max_clique_graph(self, name=''):
    97909996        """
    97919997        Returns a graph constructed with maximal cliques as vertices, and
    97929998        edges between maximal cliques with common members in the original
    97939999        graph.
    979410000       
    9795         Currently only implemented for undirected graphs. Use
    9796         to_undirected to convert a digraph to an undirected graph.
    9797        
    9798         INPUT:
    9799        
     10001        NOTES:
     10002       
     10003         - Currently only implemented for undirected graphs. Use to_undirected
     10004           to convert a digraph to an undirected graph.
     10005       
     10006        INPUT:
    980010007       
    980110008        -  ``name`` - The name of the new graph.
    980210009       
    9803        
    980410010        EXAMPLES::
    980510011       
    980610012            sage: (graphs.ChvatalGraph()).cliques_get_max_clique_graph()
     
    981710023
    981810024    def cliques_get_clique_bipartite(self, **kwds):
    981910025        """
    9820         Returns a bipartite graph constructed such that cliques are the
     10026        Returns a bipartite graph constructed such that maximal cliques are the
    982110027        right vertices and the left vertices are retained from the given
    982210028        graph. Right and left vertices are connected if the bottom vertex
    982310029        belongs to the clique represented by a top vertex.
    982410030       
    9825         Currently only implemented for undirected graphs. Use
    9826         to_undirected to convert a digraph to an undirected graph.
     10031        NOTES:
     10032       
     10033         - Currently only implemented for undirected graphs. Use to_undirected
     10034           to convert a digraph to an undirected graph.
    982710035       
    982810036        EXAMPLES::
    982910037       
     
    984010048        from bipartite_graph import BipartiteGraph
    984110049        return BipartiteGraph(networkx.cliques.make_clique_bipartite(self.networkx_graph(copy=False), **kwds))
    984210050
    9843 
    9844     def clique_number(self,algorithm="cliquer",cliques=None):
    9845         """
    9846         Returns the size of the largest clique of the graph (clique
    9847         number). By default, the Cliquer algorithm is used
    9848         ( algorithm="cliquer" ) but you can also chose the networkx
    9849         algorithm instead ( algorithm="networkx" )
    9850 
    9851         INPUT :
    9852 
    9853         - ``cliques'' : This parameter is an optional list of cliques that can be input if already computed.         
    9854                         ONLY USED BY NetworkX !!!
    9855        
    9856         Currently only implemented for undirected graphs. Use
    9857         to_undirected to convert a digraph to an undirected graph.
    9858        
    9859         EXAMPLES::
    9860        
    9861             sage: C = Graph('DJ{')
    9862             sage: C.clique_number()
    9863             4
    9864             sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
    9865             sage: G.show(figsize=[2,2])
    9866             sage: G.clique_number()
    9867             3
    9868         """
    9869         if algorithm=="cliquer":
    9870             from sage.graphs.cliquer import clique_number
    9871             return clique_number(self)       
    9872         elif algorithm=="networkx":
    9873             import networkx.cliques
    9874             return networkx.cliques.graph_clique_number(self.networkx_graph(copy=False),cliques)
    9875         else:
    9876             raise NotImplementedError("Only 'networkx' and 'cliquer' are supported.")
    9877 
    9878 
    9879     def maximum_clique(self):
    9880         """
    9881         Returns the vertex set of a maximum complete subgraph.
    9882        
    9883         Currently only implemented for undirected graphs. Use
    9884         to_undirected to convert a digraph to an undirected graph.
     10051    def independent_set(self):
     10052        """
     10053        Returns a maximal independent set, which is a set of vertices which
     10054        induces an empty subgraph. Uses Cliquer.
     10055       
     10056        NOTES:
     10057       
     10058         - Currently only implemented for undirected graphs. Use to_undirected
     10059           to convert a digraph to an undirected graph.
    988510060       
    988610061        EXAMPLES::
    988710062       
    988810063        sage: C=graphs.PetersenGraph()
    9889         sage: C.maximum_clique()
    9890         [7, 9]
    9891         """
    9892         from sage.graphs.cliquer import max_clique
    9893         return max_clique(self)
    9894 
    9895     def maximum_independent_set(self):
    9896         """
    9897         Returns the vertex set of a independent (stable) subgraph.
    9898        
    9899         Currently only implemented for undirected graphs. Use
    9900         to_undirected to convert a digraph to an undirected graph.
    9901        
    9902         EXAMPLES::
    9903        
    9904         sage: C=graphs.PetersenGraph()
    9905         sage: C.maximum_independent_set()
     10064        sage: C.independent_set()
    990610065        [0, 3, 6, 7]
    990710066
    990810067        """
    990910068        from sage.graphs.cliquer import max_clique
    991010069        return max_clique(self.complement())
    991110070
    9912     def maximum_cliques(self):
    9913         """
    9914         Returns the vertex sets of *ALL* the maximum complete subgraphs.
    9915        
    9916         Currently only implemented for undirected graphs. Use
    9917         to_undirected to convert a digraph to an undirected graph.
    9918        
    9919         EXAMPLES::
    9920        
    9921         sage: C=graphs.PetersenGraph()
    9922         sage: C.maximum_cliques()
    9923         [[2, 7], [7, 9], [6, 8], [6, 9], [0, 4], [4, 9], [5, 7], [0, 5], [5, 8], [3, 4], [2, 3], [3, 8], [1, 6], [0, 1], [1, 2]]
    9924         """
    9925 
    9926         from sage.graphs.cliquer import all_max_clique
    9927         return all_max_clique(self)
    9928 
    9929     def cliques_vertex_clique_number(self, algorithm="cliquer",vertices=None, with_labels=False, cliques=None):
     10071    def cliques_vertex_clique_number(self, algorithm="cliquer", vertices=None,
     10072                                     with_labels=False, cliques=None):
    993010073        r"""
    993110074        Returns a list of sizes of the largest maximal cliques containing
    993210075        each vertex. (Returns a single value if only one input vertex).
    993310076       
    9934         Currently only implemented for undirected graphs. Use
    9935         to_undirected to convert a digraph to an undirected graph.
    9936        
    9937         INPUT:
    9938        
    9939         -  ``algorithm'' - "cliquer" or "networkx"
    9940 
    9941         -  ``vertices`` - the vertices to inspect (default is
    9942            entire graph)
    9943                         ONLY USED BY NetworkX !!!           
    9944        
    9945         -  ``with_labels`` - (boolean) default False returns
    9946            list as above True returns a dictionary keyed by vertex labels
    9947                         ONLY USED BY NetworkX !!!
    9948        
    9949         -  ``cliques`` - list of cliques (if already
    9950            computed)
    9951                         ONLY USED BY NetworkX !!!       
     10077        NOTES:
     10078       
     10079         - Currently only implemented for undirected graphs. Use to_undirected
     10080           to convert a digraph to an undirected graph.
     10081       
     10082        INPUT:
     10083       
     10084         - ``algorithm`` - either ``cliquer`` or ``networkx``
     10085       
     10086           - ``cliquer`` - This wraps the C program Cliquer, [1].
     10087       
     10088           - ``networkx`` - This function is based on Networkx's implementation
     10089                of the Bron and Kerbosch Algorithm, [2].
     10090
     10091        -  ``vertices`` - the vertices to inspect (default is entire graph).
     10092           Ignored unless ``algorithm=='networkx'``.
     10093       
     10094        -  ``with_labels`` - (boolean) default False returns list as above
     10095           True returns a dictionary keyed by vertex labels. Ignored unless
     10096           ``algorithm=='networkx'``.
     10097       
     10098        -  ``cliques`` - list of cliques (if already computed).  Ignored unless
     10099           ``algorithm=='networkx'``.
    995210100       
    995310101        EXAMPLES::
    995410102       
    995510103            sage: C = Graph('DJ{')
    995610104            sage: C.cliques_vertex_clique_number()
    995710105            [2, 4, 4, 4, 4]
    9958             sage: E = C.cliques()
     10106            sage: E = C.cliques_maximal()
    995910107            sage: E
    996010108            [[4, 1, 2, 3], [4, 0]]
    996110109            sage: C.cliques_vertex_clique_number(cliques=E,algorithm="networkx")
     
    997610124            sage: G.show(figsize=[2,2])
    997710125            sage: G.cliques_vertex_clique_number()
    997810126            [3, 3, 3, 3]
     10127
    997910128        """
    998010129
    998110130        if algorithm=="cliquer":
     
    999310142        else:
    999410143            raise NotImplementedError("Only 'networkx' and 'cliquer' are supported.")
    999510144
    9996        
    9997     def cliques_number_of(self, vertices=None, cliques=None, with_labels=False):
    9998         """
    9999         Returns a list of the number of maximal cliques containing each
    10000         vertex. (Returns a single value if only one input vertex).
    10001        
    10002         Currently only implemented for undirected graphs. Use
    10003         to_undirected to convert a digraph to an undirected graph.
    10004        
    10005         INPUT:
    10006        
     10145    def cliques_containing_vertex(self, vertices=None, cliques=None, with_labels=False):
     10146        """
     10147        Returns the cliques containing each vertex, represented as a list
     10148        of lists. (Returns a single list if only one input vertex).
     10149       
     10150        NOTE:
     10151       
     10152         - Currently only implemented for undirected graphs. Use to_undirected
     10153           to convert a digraph to an undirected graph.
     10154       
     10155        INPUT:
    1000710156       
    1000810157        -  ``vertices`` - the vertices to inspect (default is
    1000910158           entire graph)
     
    1001410163        -  ``cliques`` - list of cliques (if already
    1001510164           computed)
    1001610165       
    10017        
    10018         EXAMPLES::
    10019        
    10020             sage: C = Graph('DJ{')
    10021             sage: C.cliques_number_of()
    10022             [1, 1, 1, 1, 2]
    10023             sage: E = C.cliques()
    10024             sage: E
    10025             [[4, 1, 2, 3], [4, 0]]
    10026             sage: C.cliques_number_of(cliques=E)
    10027             [1, 1, 1, 1, 2]
    10028             sage: F = graphs.Grid2dGraph(2,3)
    10029             sage: X = F.cliques_number_of(with_labels=True)
    10030             sage: for v in sorted(X.iterkeys()):
    10031             ...    print v, X[v]
    10032             (0, 0) 2
    10033             (0, 1) 3
    10034             (0, 2) 2
    10035             (1, 0) 2
    10036             (1, 1) 3
    10037             (1, 2) 2
    10038             sage: F.cliques_number_of(vertices=[(0, 1), (1, 2)])
    10039             [3, 2]
    10040             sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
    10041             sage: G.show(figsize=[2,2])
    10042             sage: G.cliques_number_of()
    10043             [2, 2, 1, 1]
    10044         """
    10045         import networkx.cliques
    10046         return networkx.cliques.number_of_cliques(self.networkx_graph(copy=False), vertices, cliques, with_labels)
    10047        
    10048     def cliques_containing_vertex(self, vertices=None, cliques=None, with_labels=False):
    10049         """
    10050         Returns the cliques containing each vertex, represented as a list
    10051         of lists. (Returns a single list if only one input vertex).
    10052        
    10053         Currently only implemented for undirected graphs. Use
    10054         to_undirected to convert a digraph to an undirected graph.
    10055        
    10056         INPUT:
    10057        
    10058        
    10059         -  ``vertices`` - the vertices to inspect (default is
    10060            entire graph)
    10061        
    10062         -  ``with_labels`` - (boolean) default False returns
    10063            list as above True returns a dictionary keyed by vertex labels
    10064        
    10065         -  ``cliques`` - list of cliques (if already
    10066            computed)
    10067        
    10068        
    1006910166        EXAMPLES::
    1007010167       
    1007110168            sage: C = Graph('DJ{')
    1007210169            sage: C.cliques_containing_vertex()
    1007310170            [[[4, 0]], [[4, 1, 2, 3]], [[4, 1, 2, 3]], [[4, 1, 2, 3]], [[4, 1, 2, 3], [4, 0]]]
    10074             sage: E = C.cliques()
     10171            sage: E = C.cliques_maximal()
    1007510172            sage: E
    1007610173            [[4, 1, 2, 3], [4, 0]]
    1007710174            sage: C.cliques_containing_vertex(cliques=E)
     
    1009210189            sage: G.show(figsize=[2,2])
    1009310190            sage: G.cliques_containing_vertex()
    1009410191            [[[0, 1, 2], [0, 1, 3]], [[0, 1, 2], [0, 1, 3]], [[0, 1, 2]], [[0, 1, 3]]]
     10192
    1009510193        """
    1009610194        import networkx.cliques
    1009710195        return networkx.cliques.cliques_containing_node(self.networkx_graph(copy=False), vertices, cliques, with_labels)