Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Induced bipartite #147

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
added support for DiGraphs
  • Loading branch information
Codsilla committed Jun 20, 2022
commit dc3b24cf59ec29a5e7a85765af485317f7b62856
4 changes: 2 additions & 2 deletions src/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -728,13 +728,13 @@ function induced_bipartite_subgraph(g::T,X::AbstractVector{U},Y::AbstractVector{
newIndex = Dict(reverse.(collect(enumerate([X;Y]))))

for x in X
for y in neighbors(g,x) ∩ Y
for y in outneighbors(g,x) ∩ Y
gdalle marked this conversation as resolved.
Show resolved Hide resolved
add_edge!(G,newIndex[x],newIndex[y])
end
end

for y in Y
for x in neighbors(g,y) ∩ X
for x in outneighbors(g,y) ∩ X
add_edge!(G,newIndex[y],newIndex[x])
end
end
Expand Down