Skip to content

Commit

Permalink
Issue #35168: fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoudert committed Feb 22, 2023
1 parent 05329f6 commit d5e6262
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/sage/graphs/generic_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -4115,12 +4115,18 @@ def is_eulerian(self, path=False):

sage: g = Graph({0:[], 1:[], 2:[], 3:[]}); g.is_eulerian()
True
"""

Issue :trac:`35168` is fixed::

sage: Graph([[0, 42, 'John'], [(42, 0)]]).is_eulerian()
False
sage: Graph([[0, 42, 'John'], [(42, 'John')]]).is_eulerian()
False
"""
# unconnected graph can still be Eulerian if all components
# up to one doesn't contain any edge
nontrivial_components = 0
for cc in self.connected_components():
for cc in self.connected_components(sort=False):
if len(cc) > 1:
nontrivial_components += 1
if nontrivial_components > 1:
Expand Down

0 comments on commit d5e6262

Please sign in to comment.