Skip to content

Commit

Permalink
Bug Fix. Small Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyT1994 committed Jan 23, 2024
1 parent ccefa64 commit e9d0402
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Graphs/partitionedgraphs/partitionedge.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
struct PartitionEdge{V,E<:AbstractEdge{<:V}} <: AbstractPartitionEdge{V}
struct PartitionEdge{V,E<:AbstractEdge{V}} <: AbstractPartitionEdge{V}
edge::E
end

Expand Down
2 changes: 1 addition & 1 deletion src/Graphs/partitionedgraphs/partitionedgraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,5 @@ end
function induced_subgraph(
pg::PartitionedGraph, partitionverts::Vector{V}
) where {V<:PartitionVertex}
return induced_subgraph(pg, vertices(pg, partitionverts))
return induced_subgraph(unpartitioned_graph(pg), vertices(pg, partitionverts))
end
2 changes: 1 addition & 1 deletion src/Graphs/partitionedgraphs/partitioning.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function partitioned_vertices(
end

function partitioned_vertices(
g::AbstractNamedGraph; npartitions=nothing, nvertices_per_partition=nothing, kwargs...
g::AbstractGraph; npartitions=nothing, nvertices_per_partition=nothing, kwargs...
)
vertex_partitions = partitioned_vertices(
parent_graph(g); npartitions, nvertices_per_partition, kwargs...
Expand Down
4 changes: 2 additions & 2 deletions test/test_partitionedgraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ end
)

pg_1 = subgraph(pg, PartitionVertex.(subgraph_partitioned_vertices))
@test isa(pg_1, NamedGraph)
pg_2 = subgraph(pg, subgraph_vertices)
@test pg_1 == pg_2
@test isa(pg_2, PartitionedGraph)
@test nv(pg_1) == length(subgraph_vertices)
@test nv(partitioned_graph(pg_1)) == length(subgraph_partitioned_vertices)

subgraph_partitioned_vertex = 3
subgraph_vertices = partitions[subgraph_partitioned_vertex]
Expand Down

0 comments on commit e9d0402

Please sign in to comment.