Skip to content

Commit

Permalink
Rename get_all_cliques to enumerate_all_cliques
Browse files Browse the repository at this point in the history
  • Loading branch information
ysitu committed Jun 8, 2014
1 parent d6975ed commit 52a6abd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions networkx/algorithms/clique.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
'make_clique_bipartite' ,'graph_clique_number',
'graph_number_of_cliques', 'node_clique_number',
'number_of_cliques', 'cliques_containing_node',
'project_down', 'project_up']
'project_down', 'project_up', 'enumerate_all_cliques']

@not_implemented_for('directed')
def get_all_cliques(G):
def enumerate_all_cliques(G):
"""Returns all cliques in an undirected graph.
This method returns cliques of size (cardinality)
Expand All @@ -45,7 +45,7 @@ def get_all_cliques(G):
Notes
-----
To obtain a list of all cliques, use list(get_all_cliques(G)).
To obtain a list of all cliques, use list(enumerate_all_cliques(G)).
Based on the algorithm published by Zhang et al. (2005) [1]_
and adapted to output all cliques discovered.
Expand Down Expand Up @@ -73,7 +73,7 @@ def get_all_cliques(G):
"""

def greater_neighbors(G, a_node):
"""Helper method used in get_all_cliques"""
"""Helper method used in enumerate_all_cliques"""
nodes_sorted = sorted(G.nodes())
a_node_index = nodes_sorted.index(a_node)

Expand Down
2 changes: 1 addition & 1 deletion networkx/algorithms/tests/test_clique.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_paper_figure_4(self):
('g', 'f'), ('g', 'c'), ('g', 'd'), ('g', 'e')]
G.add_edges_from(edges_fig_4)

cliques = list(nx.get_all_cliques(G))
cliques = list(nx.enumerate_all_cliques(G))
expected_cliques = [['a'],
['b'],
['c'],
Expand Down

0 comments on commit 52a6abd

Please sign in to comment.