Re: [networkx-discuss] max_clique() function error: networkx.algorithms has no attribute 'approximation'

814 views
Skip to first unread message
Message has been deleted

Daniel Schult

unread,
Apr 9, 2014, 11:10:28 PM4/9/14
to networkx...@googlegroups.com
The first thing to check is the networkx version (and python version too).  The docs are for the latest version but you may be accessing an older version.


On Wed, Apr 9, 2014 at 1:46 PM, liu lily <polito...@gmail.com> wrote:

I want to use max_clique() function on a graph G


http://networkx.github.io/documentation/latest/_modules/networkx/algorithms/approximation/clique.html#max_clique

I called

networkx.algorithms.approximation.clique.max_clique(G) and get  an error:


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'approximation'

what is wrong with it?


thanks!

--
You received this message because you are subscribed to the Google Groups "networkx-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to networkx-discu...@googlegroups.com.
To post to this group, send email to networkx...@googlegroups.com.
Visit this group at http://groups.google.com/group/networkx-discuss.
For more options, visit https://groups.google.com/d/optout.

liu lily

unread,
Apr 10, 2014, 9:33:33 AM4/10/14
to networkx...@googlegroups.com
the version is:

Python 2.7.3
networkx: 1.8.1

Aric Hagberg

unread,
Apr 10, 2014, 9:52:23 AM4/10/14
to networkx...@googlegroups.com
It should work with that version:

In [1]: import networkx as nx

In [2]: G = nx.complete_graph(4)

In [3]: from networkx.algorithms.approximation import clique

In [4]: clique.max_clique(G)
Out[4]: set([0, 1, 2, 3])

Aric
Reply all
Reply to author
Forward
0 new messages