Ticket #10953: trac_10953_empty_graph_is_regular.3.patch

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

    # HG changeset patch
    # User Lukas Lansky <lansky@kam.mff.cuni.cz>
    # Date 1325633796 0
    # Node ID 43360a9173e6259fe4ea3a0bd9866edda6548ac7
    # 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            # trac #10953: the graph without vertices is k-regular for every k
     8849            sage: Graph().is_regular()
     8850            True
    88488851            sage: G = graphs.HoffmanSingletonGraph()
    88498852            sage: G.is_regular()
    88508853            True
     
    88638866            sage: graphs.HouseGraph().is_regular()
    88648867            False
    88658868        """
     8869        if self.order() == 0:
     8870            return True
     8871
    88668872        deg_it = self.degree_iterator()
    88678873        if k is None:
    88688874            k = deg_it.next()