Ticket #11739 (closed enhancement: fixed)
add_vertex w/o params should return the new vertex
|Reported by:||ddestrada||Owned by:||jason, ncohen, rlm|
|Component:||graph theory||Keywords:||add_vertex sd35.5|
|Report Upstream:||N/A||Reviewers:||Paul Zimmermann|
|Authors:||Lukáš Lánský||Merged in:||sage-5.0.beta3|
Description (last modified by zimmerma) (diff)
It's nice to have a way to add a new vertex no matter what the graph is. That is the purpose of executing add_vertex() without parameters: to add a vertex numbered with the least nonnegative integer not already in the graph.
But the problem is that it doesn't return the number, so you can't add edges to it. Therefore add_vertex() w/o params currently is only useful for adding isolated vertices.
Apply trac_11739_add_vertex_returns_name.2.patch only.
- Status changed from needs_review to positive_review
- Reviewers set to Paul Zimmermann
- Authors set to Lukáš Lánský