Skip to content

Commit

Permalink
fix!: error in detransitive!
Browse files Browse the repository at this point in the history
  • Loading branch information
mmolari committed Jul 14, 2022
1 parent 6d5249c commit a965132
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/graph.jl
Expand Up @@ -222,9 +222,9 @@ function detransitive!(G::Graph)

elseif j.left.block keys(chain)
c₀ = chain[j.left.block]
if left(j) == c₀[end]
if left(j) == last(c₀)
push!(c₀, right(j))
elseif rev(j.left.block) == c₀[1]
elseif rev(left(j)) == first(c₀)
pushfirst!(c₀, rev(right(j)))
else
error("chains should be linear")
Expand All @@ -233,9 +233,9 @@ function detransitive!(G::Graph)

elseif j.right.block keys(chain)
c₀ = chain[j.right.block]
if right(j) == c₀[end]
if rev(right(j)) == last(c₀)
push!(c₀, rev(left(j)))
elseif right(j) == c₀[1]
elseif right(j) == first(c₀)
pushfirst!(c₀, left(j))
else
error("chains should be linear")
Expand Down

0 comments on commit a965132

Please sign in to comment.