Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
47598e3
Fix ambiguity on steiner_tree
JoeyT1994 Nov 7, 2024
8da3920
Merge remote-tracking branch 'origin/main'
JoeyT1994 Nov 7, 2024
dda7376
Merge remote-tracking branch 'origin/main'
JoeyT1994 Dec 18, 2024
c9eca8b
Merge remote-tracking branch 'origin/main'
JoeyT1994 Mar 26, 2025
6d09f22
Cycle functionality
JoeyT1994 Mar 27, 2025
1ef54b1
Function name
JoeyT1994 Mar 27, 2025
e752b67
Update src/simplecycles.jl
JoeyT1994 Mar 31, 2025
ea33311
Update src/simplecycles.jl
JoeyT1994 Mar 31, 2025
29e6f12
Update src/simplecycles.jl
JoeyT1994 Mar 31, 2025
4f5e29f
Update src/simplecycles.jl
JoeyT1994 Mar 31, 2025
a523800
Remove redundant arg
JoeyT1994 Mar 31, 2025
bd8a133
Merge remote-tracking branch 'origin/main'
JoeyT1994 Apr 25, 2025
4a632c6
Merge remote-tracking branch 'origin/main'
JoeyT1994 Sep 24, 2025
03f4de9
PartitionedGraphView
JoeyT1994 Sep 24, 2025
51c71f9
Version bump
JoeyT1994 Sep 24, 2025
2386b44
Abstruct subtype. Fix toml
JoeyT1994 Sep 24, 2025
668e6dc
Fix toml again
JoeyT1994 Sep 24, 2025
b7e71aa
Fix toml again
JoeyT1994 Sep 24, 2025
4d37a3c
Update src/lib/PartitionedGraphs/src/partitionedgraphview.jl
JoeyT1994 Sep 26, 2025
7083dcb
Refactor
JoeyT1994 Sep 26, 2025
500e919
Define partitions_graph(g::AbstractGraph)
JoeyT1994 Sep 26, 2025
def431d
PartitionsGraphView
mtfishman Sep 26, 2025
2ea8cb6
Merge branch 'main' into main
mtfishman Sep 26, 2025
1bf06d5
Merge branch 'main' into mf/partitionsgraphview
mtfishman Sep 26, 2025
9b805b0
Create conflict
mtfishman Sep 26, 2025
cc6638c
Merge branch 'mf/partitionsgraphview' of github.com:mtfishman/NamedGr…
mtfishman Sep 26, 2025
3aeffc3
Mark as breaking
mtfishman Sep 26, 2025
c9a6c7a
Merge pull request #1 from ITensor/mf/partitionsgraphview
JoeyT1994 Sep 26, 2025
28dc06f
Bump subdir versions
mtfishman Sep 26, 2025
ee14afe
Bump subdir versions
mtfishman Sep 26, 2025
5ab5ff2
Bump subdir versions
mtfishman Sep 26, 2025
986acb6
Merge
JoeyT1994 Sep 26, 2025
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
8 changes: 5 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
name = "NamedGraphs"
uuid = "678767b0-92e7-4007-89e4-4527a8725b19"
authors = ["Matthew Fishman <mfishman@flatironinstitute.org>, Joseph Tindall <jtindall@flatironinstitute.org> and contributors"]
version = "0.6.9"
version = "0.6.10"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
KaHyPar = "2a6221f6-aa48-11e9-3542-2d9e0ef01880"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Metis = "2679e427-3c69-5b7f-982b-ece356f1e94b"
PackageExtensionCompat = "65ce6f38-6b18-4e1d-a461-8949797d7930"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SimpleGraphAlgorithms = "41400c72-0c58-5c16-8579-4ecbce768449"
Expand All @@ -20,8 +23,6 @@ Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"

[weakdeps]
GraphsFlows = "06909019-6f44-4949-96fc-b9d9aaa02889"
KaHyPar = "2a6221f6-aa48-11e9-3542-2d9e0ef01880"
Metis = "2679e427-3c69-5b7f-982b-ece356f1e94b"
SymRCM = "286e6d88-80af-4590-acc9-0001b223b9bd"

[extensions]
Expand All @@ -37,6 +38,7 @@ Combinatorics = "1.0.2"
Dictionaries = "0.4"
Graphs = "1.8"
GraphsFlows = "0.1.1"
JuliaFormatter = "2.1.6"
KaHyPar = "0.3.1"
LinearAlgebra = "1.7"
Metis = "1.4"
Expand Down
1 change: 1 addition & 0 deletions src/lib/PartitionedGraphs/src/PartitionedGraphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ include("abstractpartitionedgraph.jl")
include("partitionvertex.jl")
include("partitionedge.jl")
include("partitionedgraph.jl")
include("partitionedgraphview.jl")
end
36 changes: 36 additions & 0 deletions src/lib/PartitionedGraphs/src/partitionedgraphview.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
struct PartitionedGraphView{PG}
value::PG
end

value(pgv::PartitionedGraphView) = pgv.value
Base.copy(pgv::PartitionedGraphView) = PartitionedGraphView(copy(value(pgv)))
PartitionedGraph(pgv::PartitionedGraphView) = value(pgv)

#Functionality that behaves differently
for f in [
:(Graphs.vertices),
:(Graphs.edges),
:(Graphs.induced_subgraph),
:(Graphs.neighbors),
:(Graphs.degree),
:(Graphs.is_tree),
:(Graphs.is_connected),
:(Graphs.connected_components),
:(Graphs.is_cyclic),
:(NamedGraphs.GraphsExtensions.boundary_edges),
]
@eval begin
function $f(pgv::PartitionedGraphView, args...; kwargs...)
return $f(partitioned_graph(PartitionedGraph(pgv)), args...; kwargs...)
end
end
end

#Functionality that behaves the same
for f in [:unpartitioned_graph]
@eval begin
function $f(pgv::PartitionedGraphView, args...; kwargs...)
return $f(PartitionedGraph(pgv), args...; kwargs...)
end
end
end
6 changes: 6 additions & 0 deletions test/test_partitionedgraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ using NamedGraphs.OrderedDictionaries: OrderedDictionary
using NamedGraphs.PartitionedGraphs:
PartitionEdge,
PartitionedGraph,
PartitionedGraphView,
PartitionVertex,
boundary_partitionedges,
partitioned_graph,
Expand Down Expand Up @@ -61,6 +62,11 @@ using Test: @test, @testset
pg_c = copy(pg)
@test pg_c == pg

#PartionedGraphView test
pgv = PartitionedGraphView(pg)
@test vertices(pgv) == parent.(partitionvertices(pg))
@test edges(pgv) == parent.(partitionedges(pg))

#Same partitioning but with a dictionary constructor
partition_dict = Dictionary([first(partition) for partition in partitions], partitions)
pg = PartitionedGraph(g, partition_dict)
Expand Down
Loading