Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
trac #27160: Merged with 8.7.beta4
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoudert committed Feb 16, 2019
2 parents db4e4a6 + 4784cc2 commit 0cccb17
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/sage/graphs/graph_coloring.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,14 @@ def all_graph_colorings(G, n, count_only=False, hex_colors=False, vertex_color_d
....: print(c)
{0: 0, 1: 1, 2: 0}
{0: 1, 1: 0, 2: 1}
sage: for c in all_graph_colorings(G, 2, hex_colors=True):
....: print(c)
sage: for c in all_graph_colorings(G, 2, hex_colors=True): # py2
....: print(c) # py2
{'#00ffff': [1], '#ff0000': [0, 2]}
{'#ff0000': [1], '#00ffff': [0, 2]}
sage: for c in all_graph_colorings(G, 2, hex_colors=True): # py3
....: print(c) # py3
{'#ff0000': [0, 2], '#00ffff': [1]}
{'#00ffff': [0, 2], '#ff0000': [1]}
sage: for c in all_graph_colorings(G, 2, hex_colors=True, vertex_color_dict=True):
....: print(c)
{0: '#ff0000', 1: '#00ffff', 2: '#ff0000'}
Expand Down Expand Up @@ -270,8 +274,10 @@ def first_coloring(G, n=0, hex_colors=False):
sage: from sage.graphs.graph_coloring import first_coloring
sage: G = Graph({0: [1, 2, 3], 1: [2]})
sage: first_coloring(G, 3)
sage: first_coloring(G, 3) # py2
[[1, 3], [0], [2]]
sage: first_coloring(G, 3) # py3
[[0], [1, 3], [2]]
"""
G._scream_if_not_simple(allow_multiple_edges=True)
o = G.order()
Expand Down
4 changes: 3 additions & 1 deletion src/sage/graphs/hyperbolicity.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1188,8 +1188,10 @@ def hyperbolicity(G,
(1, [(0, 0), (0, 9), (1, 0), (1, 9)], 4)
sage: hyperbolicity(G, algorithm='CCL', additive_gap=2)
(1, [(0, 0), (0, 9), (1, 0), (1, 9)], 3)
sage: hyperbolicity(G, algorithm='dom')
sage: hyperbolicity(G, algorithm='dom') # py2
(1, [(0, 1), (0, 8), (1, 0), (1, 9)], 5)
sage: hyperbolicity(G, algorithm='dom') # py3
(1, [(0, 1), (0, 9), (1, 0), (1, 8)], 5)
Asking for an approximation in a cycle graph::
Expand Down

0 comments on commit 0cccb17

Please sign in to comment.