This sounds very like the number theory analogue, is 1 prime or composite -- to which the answer is "neither". That's like counting te number of connected components: 0 for the empty graph, 1 for a connected graph (nonempty!) and 2 or more for disconnected graphs.
You really don't want to spoil theorems like uniqueness of decomposition into connected components. For the empty graph, that's ok, tere are 0 connected components, just as 1 is the product 0 primes. In Sage Integers have as is_prime method (and 1.is_prime() is of course False but no is_composite() method. I suggest that you follow the lead and have G.is_connected() False for empty G, noting that this is not backwards compatible, and then you will not have the silly situation that (in 5.11) sage: G = Graph([]); G Graph on 0 vertices sage: G.is_connected() True sage: G.connected_components() [] as to me it seems contradictory to have a graph claiming to be connected but having no connected components. John On 19 August 2013 16:51, Nathann Cohen <nathann.co...@gmail.com> wrote: > Helloooooooo everybody !! > > There is a discussion on theology going on at #15060, about whether we > should consider whether the empty graph is connected or not. We > already had one about deciding whether the empty graph is a tree or > not, and Karl-Dieter supposed that other discussions of this kind > already happened in Sage. > > Here's the thing : we have two definitions which conflict on a trivial > case only, and we have functions that are expected to answer whether > -- yes or no -- the property holds. > > I personally voted for not answering anything, and raising a "We Have > No Idea And We Don't Want To Be Forced To Give An Answer Exception" in > this case, for there is no way to give an answer that would not lead > anybody to very weird bugs. > > What do you think ? Darij agreed with this idea, and Karl-Dieter > believes that we should make a decision and answer something :-) > > Help us ! :-P > > Nathann > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-devel+unsubscr...@googlegroups.com. > To post to this group, send email to sage-devel@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.