Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#7853 closed defect (fixed)

block_and_cut_vertices is inconsistent when graph has one vertex

Reported by: jason Owned by: rlm
Priority: major Milestone: sage-4.3.1
Component: graph theory Keywords:
Cc: hartke, rlm, ncohen Merged in: sage-4.3.1.alpha2
Authors: Nathann Cohen Reviewers: Robert Miller
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Currently, block_and_cut_vertices says that the vertex in a single-vertex graph is a cut vertex:

sage: Graph(1).blocks_and_cut_vertices()
([0], [0])

According to the definition of cut vertices given in the documentation of the function, a cut vertex, when removed, increases the connected components of the graph. Either that documentation should be changed to mention a corner case, or (preferably), the above computation should look like:

sage: Graph(1).blocks_and_cut_vertices()
([0], [])

Attachments (1)

trac_7853.patch (1.1 KB) - added by ncohen 11 years ago.
Apply on top of patches from #7634

Download all attachments as: .zip

Change History (5)

comment:1 Changed 11 years ago by ncohen

  • Status changed from new to needs_review

Here it is ! Actually the answer [0],[0] seemed deliberate in the code, but my tests with the patch applied did not show any error coming from the fix :-)

( Apply on top of patches from #7634 )


Changed 11 years ago by ncohen

Apply on top of patches from #7634

comment:2 Changed 11 years ago by rlm

  • Authors set to Nathann Cohen
  • Reviewers set to Robert Miller
  • Status changed from needs_review to positive_review

Looks good to me.

comment:3 Changed 11 years ago by rlm

  • Merged in set to 4.3.1.alpha2
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:4 Changed 11 years ago by mvngu

  • Merged in changed from 4.3.1.alpha2 to sage-4.3.1.alpha2
Note: See TracTickets for help on using tickets.