Skip to content

Commit e355a11

Browse files
committed
connectivity.pyx
1 parent 9e1018a commit e355a11

File tree

1 file changed

+20
-25
lines changed

1 file changed

+20
-25
lines changed

src/sage/graphs/connectivity.pyx

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,8 +1177,7 @@ def edge_connectivity(G,
11771177
return 0
11781178
elif vertices:
11791179
return [0, [], [{}, {}]]
1180-
else:
1181-
return [0, []]
1180+
return [0, []]
11821181

11831182
if implementation == "boost":
11841183
from sage.graphs.base.boost_graph import edge_connectivity
@@ -1275,29 +1274,27 @@ def edge_connectivity(G,
12751274
if value_only:
12761275
return obj
12771276

1278-
else:
1279-
val = [obj]
1280-
1281-
in_set = p.get_values(in_set, convert=bool, tolerance=integrality_tolerance)
1277+
val = [obj]
1278+
in_set = p.get_values(in_set, convert=bool, tolerance=integrality_tolerance)
12821279

1283-
if g.is_directed():
1284-
edges = [(u, v, l) for u, v, l in g.edge_iterator() if in_cut[u, v]]
1285-
else:
1286-
edges = [(u, v, l) for u, v, l in g.edge_iterator() if in_cut[frozenset((u, v))]]
1280+
if g.is_directed():
1281+
edges = [(u, v, l) for u, v, l in g.edge_iterator() if in_cut[u, v]]
1282+
else:
1283+
edges = [(u, v, l) for u, v, l in g.edge_iterator() if in_cut[frozenset((u, v))]]
12871284

1288-
val.append(edges)
1285+
val.append(edges)
12891286

1290-
if vertices:
1291-
a = {}
1292-
b = {}
1293-
for v in g:
1294-
if in_set[0, v]:
1295-
a.add(v)
1296-
else:
1297-
b.add(v)
1298-
val.append([a, b])
1287+
if vertices:
1288+
a = {}
1289+
b = {}
1290+
for v in g:
1291+
if in_set[0, v]:
1292+
a.add(v)
1293+
else:
1294+
b.add(v)
1295+
val.append([a, b])
12991296

1300-
return val
1297+
return val
13011298

13021299

13031300
def vertex_connectivity(G, value_only=True, sets=False, k=None, solver=None, verbose=0,
@@ -1503,8 +1500,7 @@ def vertex_connectivity(G, value_only=True, sets=False, k=None, solver=None, ver
15031500
return max(g.order() - 1, 0)
15041501
elif not sets:
15051502
return max(g.order() - 1, 0), []
1506-
else:
1507-
return max(g.order() - 1, 0), [], [[], []]
1503+
return max(g.order() - 1, 0), [], [[], []]
15081504

15091505
if value_only:
15101506
if G.is_directed():
@@ -3298,8 +3294,7 @@ cdef class TriconnectivitySPQR:
32983294
cdef _LinkedListNode * head = _LinkedList_get_head(self.highpt[v])
32993295
if head:
33003296
return head.data
3301-
else:
3302-
return 0
3297+
return 0
33033298

33043299
cdef __del_high(self, int e_index):
33053300
"""

0 commit comments

Comments
 (0)