Skip to content

Commit 77382a4

Browse files
fix: always sort variable SCCs
1 parent 795516f commit 77382a4

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/utils.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,14 @@ end
164164
Find strongly connected components of the variables defined by `g`. `assign`
165165
gives the undirected bipartite graph a direction. When `assign === nothing`, we
166166
assume that the ``i``-th variable is assigned to the ``i``-th equation.
167-
168-
If `topsort == true`, topologically sort the SCCs.
169167
"""
170-
function find_var_sccs(g::BipartiteGraph, assign = nothing; topsort = false)
168+
function find_var_sccs(g::BipartiteGraph, assign = nothing)
171169
cmog = DiCMOBiGraph{true}(g,
172170
Matching(assign === nothing ? Base.OneTo(nsrcs(g)) : assign))
173171
sccs = Graphs.strongly_connected_components(cmog)
174-
if topsort
175-
cgraph = MatchedCondensationGraph(cmog, sccs)
176-
toporder = topological_sort(cgraph)
177-
sccs = sccs[toporder]
178-
end
172+
cgraph = MatchedCondensationGraph(cmog, sccs)
173+
toporder = topological_sort(cgraph)
174+
sccs = sccs[toporder]
179175
foreach(sort!, sccs)
180176
return sccs
181177
end

0 commit comments

Comments
 (0)