From 016d0d08bbbe55f000a064ac616f1fdd2c983b41 Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Tue, 10 Feb 2026 12:33:01 +0100 Subject: [PATCH 1/2] add graph iso tests --- Project.toml | 2 +- test/graphs.jl | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index cd960cec..e20ebbfe 100644 --- a/Project.toml +++ b/Project.toml @@ -47,6 +47,6 @@ SparseArrays = "^1.10" TOPCOM_jll = "~0.17.8" julia = "^1.10" lib4ti2_jll = "^1.6.10" -libpolymake_julia_jll = "~0.14.0" +libpolymake_julia_jll = "~0.14.5" polymake_jll = "^400.1400.0" polymake_oscarnumber_jll = "~0.3.9" diff --git a/test/graphs.jl b/test/graphs.jl index 59ac22c0..01ce36ba 100644 --- a/test/graphs.jl +++ b/test/graphs.jl @@ -104,5 +104,43 @@ @test Polymake._shortest_path_dijkstra(g, em, 0, 1, true) == [0,1] @test Polymake._shortest_path_dijkstra(g, em, 0, 1, false) == [0,4,3,2,1] end + @testset verbose=true "graph isomorphism" begin + g = Polymake.Graph{Polymake.Directed}(7) + for i in 0:3 + Polymake._add_edge(g, i, i+1) + end + Polymake._add_edge(g, 2, 5) + Polymake._add_edge(g, 2, 6) + + gcf = Polymake._canonical_form(g) + @test Polymake._is_isomorphic(g, gcf) + + perm = Polymake._canonical_perm(g, Polymake.Array{Int}(fill(1,7))) + gp = Polymake._permute_nodes(g, perm) + Polymake._permute_nodes!(g, perm) + for i in 0:6 + for j in 0:6 + @test Polymake._has_edge(gp, i, j) == Polymake._has_edge(gcf, i, j) + @test Polymake._has_edge(g, i, j) == Polymake._has_edge(gcf, i, j) + end + end + + gs1 = Polymake.Graph{Polymake.Undirected}(3) + gs2 = Polymake.Graph{Polymake.Undirected}(3) + Polymake._add_edge(gs1, 0, 1) + Polymake._add_edge(gs2, 1, 2) + + @test Polymake._is_isomorphic(gs1, gs2) + @test !Polymake._is_isomorphic_with_colors(gs1, Polymake.Array{Int}([1,2,3]), gs2, Polymake.Array{Int}([1,2,3])) + @test Polymake._is_isomorphic_with_colors(gs1, Polymake.Array{Int}([1,1,2]), gs2, Polymake.Array{Int}([2,1,1])) + @test Polymake._automorphisms(gs1) == [[1,0,2]] + @test Polymake._automorphisms(gs1, Polymake.Array{Int}([1,2,3])) == [] + + cubeg = Polymake.polytope.cross(2).GRAPH.ADJACENCY + crossg = Polymake.polytope.cube(2).GRAPH.ADJACENCY + @test Polymake._canonical_hash(cubeg, 42) == Polymake._canonical_hash(crossg, 42) + @test Polymake._canonical_hash(cubeg, Polymake.Array{Int}([1,1,1,1]), 42) == Polymake._canonical_hash(crossg, Polymake.Array{Int}([1,1,1,1]), 42) + @test Polymake._canonical_hash(cubeg, 42) != Polymake._canonical_hash(g, 42) + end end From 98b71275fc309969c54ffd5c9c50d4041840802d Mon Sep 17 00:00:00 2001 From: Benjamin Lorenz Date: Tue, 10 Feb 2026 12:37:31 +0100 Subject: [PATCH 2/2] bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index e20ebbfe..e8b0661b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Polymake" uuid = "d720cf60-89b5-51f5-aff5-213f193123e7" repo = "https://github.com/oscar-system/Polymake.jl.git" -version = "0.13.7" +version = "0.13.8" [deps] AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"