> Given a graph G with one vertex v having a self-loop at v, I would > expect the total degree of G to be 2, since the total degree is twice > the number of edges. But this is not the case as shown below for the > case of undirected (multi)graphs:
I never use looped graphs or multigraphs, but I agree I would expect a 2 in this situation. It fits with the fact that you can always orient a graph in such a way that all the degrees are divided by two (+1 if the degree is odd). This should be easy to fix in c_graph.pyx or directly in the backends for dense/sparse graphs. Anyway, this should not happen : sage: G = Graph({1:[1]}); G.degree(1) 1 sage: G = Graph({1:[1]}, implementation="networkx"); G.degree(1) 2 Nathann -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org