Ticket #10953: trac_10953_empty_graph_is_regular.4.patch

File trac_10953_empty_graph_is_regular.4.patch, 760 bytes (added by jdemeyer, 11 years ago)
  • sage/graphs/generic_graph.py

    # HG changeset patch
    # User Lukas Lansky <lansky@kam.mff.cuni.cz>
    # Date 1325633796 0
    # Node ID 3592d79b17017008ca7c057eeff01065f86acf3a
    # Parent  92c93226b64f933e0af00bbcbd1a8a79c444f43f
    An empty graph is regular
    
    diff --git a/sage/graphs/generic_graph.py b/sage/graphs/generic_graph.py
    a b  
    89068906
    89078907            sage: graphs.HouseGraph().is_regular()
    89088908            False
    8909         """
     8909
     8910        A graph without vertices is `k`-regular for every `k`::
     8911
     8912            sage: Graph().is_regular()
     8913            True
     8914        """
     8915        if self.order() == 0:
     8916            return True
     8917
    89108918        deg_it = self.degree_iterator()
    89118919        if k is None:
    89128920            k = deg_it.next()