Opened 6 years ago
Closed 6 years ago
#18335 closed defect (fixed)
Compute the degree of a vertex without using networkX
Reported by:  ncohen  Owned by:  

Priority:  major  Milestone:  sage6.7 
Component:  graph theory  Keywords:  
Cc:  Merged in:  
Authors:  Nathann Cohen  Reviewers:  Vincent Delecroix 
Report Upstream:  N/A  Work issues:  
Branch:  073e7c5 (Commits)  Commit:  073e7c5518d38e74a2d47a2e7cbaabfaf0a23ce5 
Dependencies:  Stopgaps: 
Description
Err. There is a function in Sage which is called .centrality_degree
, whose aim is more or less to compute the degree.
Right now, it is done by building a NetworkX
copy of the graph, then asking NetworkX
to give us the degree (divided by n1).
Turns out that we can do better.
Change History (13)
comment:1 Changed 6 years ago by
 Branch set to public/18335
 Commit set to a9f34ad605c82f44bb72143a8d45ee1aaf70809f
 Status changed from new to needs_review
comment:2 Changed 6 years ago by
What is n
?
comment:3 Changed 6 years ago by
The number of vertices
comment:4 Changed 6 years ago by
Where is it written?
comment:5 Changed 6 years ago by
You could also add SEEALSO
between all the *centrality*
methods.
comment:6 Changed 6 years ago by
In Graph theory, n
is the number of vertices and m
is the number of edges. No exceptions :P
comment:7 Changed 6 years ago by
Graph ...  ``vertex_labels``  only for implementation == 'c_graph'. Whether to allow any object as a vertex (slower), or only the integers 0, ..., n1, where n is the number of vertices. ... def is_overfull(self): ... A graph `G` on `n` vertices and `m` edges is said to be overfull if: ... def clique_polynomial(self): ... This is the polynomial where the coefficient of `t^n` is the number of cliques in the graph with `n` vertices. The constant term of the clique polynomial is always taken to be one. ...
So even if it is standard, everywhere it is used it seems that there is precision about it. And I like it.
comment:8 Changed 6 years ago by
 Commit changed from a9f34ad605c82f44bb72143a8d45ee1aaf70809f to 073e7c5518d38e74a2d47a2e7cbaabfaf0a23ce5
Branch pushed to git repo; I updated commit sha1. New commits:
073e7c5  trac #18335: Review

comment:9 Changed 6 years ago by
I would like people to have the same kind of strict expectations when they review my patches and when others write theirs. It takes weeks to add a stopgap somewhere but everything gets much more serious when I don't define 'n' in a docstring.
comment:10 Changed 6 years ago by
People always discuss useless things. And when important or technical decisions come, you are alone! That's life.
comment:11 Changed 6 years ago by
 Reviewers set to Vincent Delecroix
 Status changed from needs_review to positive_review
comment:12 Changed 6 years ago by
Thanks !
comment:13 Changed 6 years ago by
 Branch changed from public/18335 to 073e7c5518d38e74a2d47a2e7cbaabfaf0a23ce5
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
trac #18335: Compute the degree of a vertex without using networkX