File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -92,17 +92,17 @@ def acyclic_orientations(G):
9292 To count the number of acyclic orientations for a graph with 0 vertices::
9393
9494 sage: list(Graph().acyclic_orientations())
95- [Graph on 0 vertices ]
95+ []
9696
9797 To count the number of acyclic orientations for a graph with 1 vertex::
9898
9999 sage: list(Graph(1).acyclic_orientations())
100- [Graph on 0 vertices ]
100+ []
101101
102102 To count the number of acyclic orientations for a graph with 2 vertices::
103103
104104 sage: list(Graph(2).acyclic_orientations())
105- [Graph on 0 vertices ]
105+ []
106106
107107 Acyclic orientations of a complete graph::
108108
@@ -127,6 +127,10 @@ def acyclic_orientations(G):
127127 6
128128
129129 """
130+ if not G .size ():
131+ # A graph without edge cannot be oriented
132+ return
133+
130134 from sage .rings .infinity import Infinity
131135 from sage .combinat .subset import Subsets
132136
You can’t perform that action at this time.
0 commit comments