Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

Update connected_components.jl #188

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/connected_components.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ function discover_vertex!(vis::TarjanVisitor, v)
end

function examine_neighbor!(vis::TarjanVisitor, v, w, w_color::Int, e_color::Int)
if w_color == 1 # 1 means added seen, but not explored
while vis.index[vertex_index(w, vis.graph)] < vis.lowlink[end]
if w_color > 0 # if we've seen this vertex already
vi = vis.index[vertex_index(w, vis.graph)]
while vi > 0 && vi < vis.lowlink[end]
pop!(vis.lowlink)
end
end
Expand Down