Skip to content

Commit

Permalink
Fix greedy_coloring docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
ysitu committed Jun 7, 2014
1 parent f4f3129 commit 236f6a4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
25 changes: 13 additions & 12 deletions networkx/algorithms/coloring/greedy_coloring.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,20 @@ def greedy_color(G, strategy=strategy_largest_first, interchange=False):
* strategy_random_sequential
* strategy_smallest_last
* strategy_independent_set
* strategy_connected_sequential (an alias of the BFS version)
* strategy_connected_sequential_bfs
* strategy_connected_sequential_dfs
* strategy_saturation_largest_first (also know as DSATUR)
interchange: boolean
Will use the color interchange algorithm described by [2] if set
* strategy_connected_sequential_bfs
* strategy_connected_sequential_dfs
* strategy_connected_sequential
(alias of strategy_connected_sequential_bfs)
* strategy_saturation_largest_first (also known as DSATUR)
interchange: bool
Will use the color interchange algorithm described by [2]_ if set
to true.
Note that saturation largest first and independent set do not
work with interchange. Furthermore, if you use interchange with
your own strategy function, you cannot rely on the values in the
colors argument
colors argument.
Returns
-------
Expand All @@ -253,11 +254,11 @@ def greedy_color(G, strategy=strategy_largest_first, interchange=False):
References
----------
.. [1] Adrian Kosowski, and Krzysztof Manuszewski,
Classical Coloring of Graphs, Graph Colorings, 2-19, 2004,
Classical Coloring of Graphs, Graph Colorings, 2-19, 2004.
ISBN 0-8218-3458-4.
[2] Maciej M. Syslo, Marsingh Deo, Janusz S. Kowalik,
Discrete Optimization Algorithms with Pascal Programs, 415-424, 1983
ISBN 0-486-45353-7
.. [2] Maciej M. Syslo, Marsingh Deo, Janusz S. Kowalik,
Discrete Optimization Algorithms with Pascal Programs, 415-424, 1983.
ISBN 0-486-45353-7.
"""
colors = {} # dictionary to keep track of the colors of the nodes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def greedy_coloring_with_interchange(original_graph, nodes):
References
----------
... [1] Maciej M. Syslo, Marsingh Deo, Janusz S. Kowalik,
Discrete Optimization Algorithms with Pascal Programs, 415-424, 1983
ISBN 0-486-45353-7
.. [1] Maciej M. Syslo, Marsingh Deo, Janusz S. Kowalik,
Discrete Optimization Algorithms with Pascal Programs, 415-424, 1983.
ISBN 0-486-45353-7.
"""
n = len(original_graph)

Expand Down

0 comments on commit 236f6a4

Please sign in to comment.