@@ -3098,17 +3098,16 @@ def is_brick(self, coNP_certificate=False):
30983098 spqr_tree = self .spqr_tree ()
30993099 two_vertex_cut = []
31003100
3101- # Check for 2-vertex cuts in P and S nodes
3101+ # Check for 2-vertex cuts in a P node
3102+ # Since the graph is matching covered, it is free of cut vertices
3103+ # It can be shown using counting arguments that the spqr tree
3104+ # decomposition for a bicritical graph, that is 2-connected but not
3105+ # 3-connected, is free of 'S' nodes
31023106 for u in spqr_tree :
31033107 if u [0 ] == 'P' :
31043108 two_vertex_cut .extend (u [1 ])
31053109 break
31063110
3107- elif u [0 ] == 'S' and u [1 ].order () > 3 :
3108- s_vertex_set = set (u [1 ])
3109- s_vertex_set -= {next (u [1 ].vertex_iterator ())} | set (u [1 ].neighbors (next (u [1 ].vertex_iterator ())))
3110- two_vertex_cut .extend ([next (u [1 ].vertex_iterator ()), next (iter (s_vertex_set ))])
3111-
31123111 # If no 2-vertex cut found, look for R nodes
31133112 if not two_vertex_cut :
31143113 from collections import Counter
@@ -3117,6 +3116,9 @@ def is_brick(self, coNP_certificate=False):
31173116 for t , g in spqr_tree :
31183117 if t == 'R' :
31193118 R_frequency .update (g )
3119+
3120+ # R frequency must be at least 2,
3121+ # since the graph is 2-connected but not 3-connected
31203122 two_vertex_cut = [u for u , f in R_frequency .items () if f >= 2 ][:2 ]
31213123
31223124 # We obtain a 2-vertex cut (u, v)
0 commit comments