Ticket #10953: trac_10953_empty_graph_is_regular.2.patch

File trac_10953_empty_graph_is_regular.2.patch, 857 bytes (added by brunellus, 11 years ago)
  • sage/graphs/generic_graph.py

    # HG changeset patch
    # User Lukas Lansky <lansky@kam.mff.cuni.cz>
    # Date 1325525168 0
    # Node ID 05c9f113ccede59fbca9ae26587fa2c4578871c5
    # Parent  9e29a3d84c48c399daaf3920bcb8b17273a0e876
    Trac 10953: empty graph is regular
    
    diff --git a/sage/graphs/generic_graph.py b/sage/graphs/generic_graph.py
    a b  
    88458845
    88468846        EXAMPLES::
    88478847
     8848            sage: Graph().is_regular()      # (trac #10953)
     8849            True
    88488850            sage: G = graphs.HoffmanSingletonGraph()
    88498851            sage: G.is_regular()
    88508852            True
     
    88638865            sage: graphs.HouseGraph().is_regular()
    88648866            False
    88658867        """
     8868        if self.order() == 0:
     8869            return True
     8870
    88668871        deg_it = self.degree_iterator()
    88678872        if k is None:
    88688873            k = deg_it.next()