Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How do I print a graph after I find all_graph_colorings?

Code is as follows:

from sage.graphs.graph_coloring import chromatic_number from sage.graphs.independent_sets import IndependentSets from sage.graphs.graph_coloring import number_of_n_colorings from sage.graphs.graph_coloring import first_coloring from sage.graphs.graph_coloring import all_graph_colorings g=Graph([[1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [1, 13], [1, 14], [1, 22], [1, 23], [1, 25], [1, 27], [1, 30], [1, 32], [2, 3], [2, 4], [2, 5], [2, 6], [2, 17], [2, 18], [2, 21], [2, 24], [2, 26], [2, 28], [2, 29], [2, 31], [3, 4], [3, 9], [3, 10], [3, 17], [3, 18], [3, 22], [3, 23], [3, 25], [3, 27], [3, 30], [3, 32], [4, 9], [4, 10], [4, 13], [4, 14], [4, 21], [4, 24], [4, 26], [4, 28], [4, 29], [4, 31], [5, 9], [5, 14], [5, 17], [5, 21], [5, 23], [6, 10], [6, 13], [6, 18], [6, 22], [6, 24], [9, 13], [9, 18], [9, 21], [9, 23], [10, 14], [10, 17], [10, 22], [10, 24], [13, 17], [13, 21], [13, 22], [14, 18], [14, 23], [14, 24], [17, 21], [17, 22], [18, 23], [18, 24], [25, 28], [25, 29], [26, 27], [26, 30], [27, 31], [28, 32], [29, 32], [30, 31]]) all=all_graph_colorings(g,4) show(all)

This prints: <generator object="" all_graph_colorings="" at="" 0x7f1bd8e9c370="">

How do I print a graph after I find all_graph_colorings?

Code is as follows:

from sage.graphs.graph_coloring import chromatic_number
from sage.graphs.independent_sets import IndependentSets
from sage.graphs.graph_coloring import number_of_n_colorings
from sage.graphs.graph_coloring import first_coloring
from sage.graphs.graph_coloring import all_graph_colorings 
g=Graph([[1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [1, 13], [1, 14], [1, 22], [1, 23], [1, 25], [1, 27], [1, 30], [1, 32], [2, 3], [2, 4], [2, 5], [2, 6], [2, 17], [2, 18], [2, 21], [2, 24], [2, 26], [2, 28], [2, 29], [2, 31], [3, 4], [3, 9], [3, 10], [3, 17], [3, 18], [3, 22], [3, 23], [3, 25], [3, 27], [3, 30], [3, 32], [4, 9], [4, 10], [4, 13], [4, 14], [4, 21], [4, 24], [4, 26], [4, 28], [4, 29], [4, 31], [5, 9], [5, 14], [5, 17], [5, 21], [5, 23], [6, 10], [6, 13], [6, 18], [6, 22], [6, 24], [9, 13], [9, 18], [9, 21], [9, 23], [10, 14], [10, 17], [10, 22], [10, 24], [13, 17], [13, 21], [13, 22], [14, 18], [14, 23], [14, 24], [17, 21], [17, 22], [18, 23], [18, 24], [25, 28], [25, 29], [26, 27], [26, 30], [27, 31], [28, 32], [29, 32], [30, 31]])
all=all_graph_colorings(g,4)
show(all)

show(all)

This prints: prints:

<generator object="" all_graph_colorings="" at="" 0x7f1bd8e9c370="">

object all_graph_colorings at 0x7f1bd8e9c370>
click to hide/show revision 3
retagged

How do I print a graph after I find all_graph_colorings?

Code is as follows:

from sage.graphs.graph_coloring import chromatic_number
from sage.graphs.independent_sets import IndependentSets
from sage.graphs.graph_coloring import number_of_n_colorings
from sage.graphs.graph_coloring import first_coloring
from sage.graphs.graph_coloring import all_graph_colorings 
g=Graph([[1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [1, 13], [1, 14], [1, 22], [1, 23], [1, 25], [1, 27], [1, 30], [1, 32], [2, 3], [2, 4], [2, 5], [2, 6], [2, 17], [2, 18], [2, 21], [2, 24], [2, 26], [2, 28], [2, 29], [2, 31], [3, 4], [3, 9], [3, 10], [3, 17], [3, 18], [3, 22], [3, 23], [3, 25], [3, 27], [3, 30], [3, 32], [4, 9], [4, 10], [4, 13], [4, 14], [4, 21], [4, 24], [4, 26], [4, 28], [4, 29], [4, 31], [5, 9], [5, 14], [5, 17], [5, 21], [5, 23], [6, 10], [6, 13], [6, 18], [6, 22], [6, 24], [9, 13], [9, 18], [9, 21], [9, 23], [10, 14], [10, 17], [10, 22], [10, 24], [13, 17], [13, 21], [13, 22], [14, 18], [14, 23], [14, 24], [17, 21], [17, 22], [18, 23], [18, 24], [25, 28], [25, 29], [26, 27], [26, 30], [27, 31], [28, 32], [29, 32], [30, 31]])
all=all_graph_colorings(g,4)
show(all)

This prints:

<generator object all_graph_colorings at 0x7f1bd8e9c370>