From c8c42af38b4a5658ac82b9deb121c6f9ef033ee2 Mon Sep 17 00:00:00 2001 From: LeonLampret Date: Sun, 8 Jun 2025 18:41:13 +0200 Subject: [PATCH 01/11] added line_graph() and used ARGS in runtests.jl to do a subset of tests --- src/Graphs.jl | 1 + src/operators.jl | 85 ++++++++++++++++++++++++++++++++++++++++++++++++ test/runtests.jl | 45 +++++++++++++++---------- 3 files changed, 114 insertions(+), 17 deletions(-) diff --git a/src/Graphs.jl b/src/Graphs.jl index a40a78168..6e565438c 100644 --- a/src/Graphs.jl +++ b/src/Graphs.jl @@ -165,6 +165,7 @@ export egonet, merge_vertices!, merge_vertices, + line_graph, # bfs gdistances, diff --git a/src/operators.jl b/src/operators.jl index d8aeb2172..793db3f86 100644 --- a/src/operators.jl +++ b/src/operators.jl @@ -879,3 +879,88 @@ function merge_vertices!(g::Graph{T}, vs::Vector{U} where {U<:Integer}) where {T return new_vertex_ids end + +""" + line_graph(g::SimpleGraph) +Given a graph `g`, return the graph `lg`, whose vertices are integers that enumerate the +edges in `g`, and two vertices in `lg` form an edge iff the corresponding edges in `g` +share a common endpoint. In other words, edges in `lg` are length-2 paths in `g`. +Note that `i ∈ vertices(lg)` corresponds to `collect(edges(g))[i]`. + +# Examples +```jldoctest +julia> using Graphs + +julia> g = path_graph(5); + +julia> lg = line_graph(g) +{4, 3} undirected simple Int64 graph +``` +""" +function line_graph(g::SimpleGraph)::SimpleGraph + vertex_to_edges = [Int[] for _ in 1:nv(g)] + for (i, e) in enumerate(edges(g)) + s, d = src(e), dst(e) + push!(vertex_to_edges[s], i) + s == d && continue # do not push self-loops twice + push!(vertex_to_edges[d], i) + end + + edge_to_neighbors = [Int[] for _ in 1:ne(g)] + m = 0 # number of edges in the line-graph + for es in vertex_to_edges + n = length(es) + for i in 1:(n - 1), j in (i + 1):n # iterate through pairs of edges with same endpoint + ei, ej = es[i], es[j] + m += 1 + push!(edge_to_neighbors[ei], ej) + push!(edge_to_neighbors[ej], ei) + end + end + + foreach(sort!, edge_to_neighbors) + return SimpleGraph(m, edge_to_neighbors) +end + +""" + line_graph(g::SimpleDiGraph) +Given a digraph `g`, return the digraph `lg`, whose vertices are integers that enumerate +the edges in `g`, and there is an edge in `lg` from `Edge(a,b)` to `Edge(c,d)` iff b==c. +In other words, edges in `lg` are length-2 directed paths in `g`. +Note that `i ∈ vertices(lg)` corresponds to `collect(edges(g))[i]`. + +# Examples +```jldoctest +julia> using Graphs + +julia> g = cycle_digraph(5); + +julia> lg = line_graph(g) +{5, 5} directed simple Int64 graph +``` +""" +function line_graph(g::SimpleDiGraph)::SimpleDiGraph + vertex_to_edgesout = [Int[] for _ in 1:nv(g)] + vertex_to_edgesin = [Int[] for _ in 1:nv(g)] + for (i, e) in enumerate(edges(g)) + s, d = src(e), dst(e) + push!(vertex_to_edgesout[s], i) + push!(vertex_to_edgesin[d], i) + end + + edge_to_neighborsout = [Int[] for _ in 1:ne(g)] + edge_to_neighborsin = [Int[] for _ in 1:ne(g)] + m = 0 # number of edges in the line-graph + for (e_i, e_o) in zip(vertex_to_edgesin, vertex_to_edgesout) + for ei in e_i, eo in e_o # iterate through length-2 directed paths + ei == eo && continue # a self-loop in g does not induce a self-loop in lg + m += 1 + push!(edge_to_neighborsout[ei], eo) + push!(edge_to_neighborsin[eo], ei) + end + end + + foreach(sort!, edge_to_neighborsout) + foreach(sort!, edge_to_neighborsin) + return SimpleDiGraph(m, edge_to_neighborsout, edge_to_neighborsin) +end diff --git a/test/runtests.jl b/test/runtests.jl index 34bd1c53f..bcac411b6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,11 +1,11 @@ using Aqua using Documenter using Graphs -using Graphs.SimpleGraphs using Graphs.Experimental +using Graphs.SimpleGraphs +using Graphs.Test using JET using JuliaFormatter -using Graphs.Test using Test using SparseArrays using LinearAlgebra @@ -150,31 +150,42 @@ tests = [ "experimental/experimental", ] +args = lowercase.(ARGS) + @testset verbose = true "Graphs" begin - @testset "Code quality (JET.jl)" begin - @assert get_pkg_version("JET") >= v"0.8.4" - JET.test_package( - Graphs; - target_defined_modules=true, - ignore_missing_comparison=true, - mode=:typo, # TODO: switch back to `:basic` once the union split caused by traits is fixed - ) + if "jet" in args || isempty(args) + @testset "Code quality (JET.jl)" begin + @assert get_pkg_version("JET") >= v"0.8.4" + JET.test_package( + Graphs; + target_defined_modules=true, + ignore_missing_comparison=true, + mode=:typo, # TODO: switch back to `:basic` once the union split caused by traits is fixed + ) + end end - @testset "Code quality (Aqua.jl)" begin - Aqua.test_all(Graphs; ambiguities=false) + if "aqua" in args || isempty(args) + @testset "Code quality (Aqua.jl)" begin + Aqua.test_all(Graphs; ambiguities=false) + end end - @testset "Code formatting (JuliaFormatter.jl)" begin - @test format(Graphs; verbose=false, overwrite=false) + if "juliaformatter" in args || isempty(args) + @testset "Code formatting (JuliaFormatter.jl)" begin + @test format(Graphs; verbose=false, overwrite=false) + end end - doctest(Graphs) + if "doctest" in args || isempty(args) + doctest(Graphs) + end @testset verbose = true "Actual tests" begin for t in tests - tp = joinpath(testdir, "$(t).jl") - include(tp) + if t in args || isempty(args) + include(joinpath(testdir, "$(t).jl")) + end end end end; From bbb2cb9106ccfc11f64693cdcf1825efdfd5f0f4 Mon Sep 17 00:00:00 2001 From: "LeonLampret (aider)" Date: Sun, 8 Jun 2025 19:29:08 +0200 Subject: [PATCH 02/11] test: add property-based tests for line_graph operator --- test/operators.jl | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test/operators.jl b/test/operators.jl index bf4931ebf..32d86defa 100644 --- a/test/operators.jl +++ b/test/operators.jl @@ -353,3 +353,40 @@ @test length(g) == 10000 end end + +@testset "Line Graph" begin + @testset "Cycle Graphs" begin + for n in 3:5 + g = cycle_graph(n) + lg = line_graph(g) + @test nv(lg) == n + @test ne(lg) == n + @test is_connected(lg) + @test all(degree(lg) .== 2) # All vertices degree 2 + end + end + + @testset "Path Graphs" begin + for n in 2:5 + g = path_graph(n) + lg = line_graph(g) + @test nv(lg) == n-1 + @test ne(lg) == n-2 + @test is_connected(lg) + degrees = degree(lg) + @test sum(degrees .== 1) == 2 # Exactly 2 leaves + @test sum(degrees .== 2) == max(0, n-3) # Rest degree 2 + end + end + + @testset "Star Graphs" begin + for n in 3:5 + g = star_graph(n) + lg = line_graph(g) + @test nv(lg) == n-1 + @test ne(lg) == binomial(n-1, 2) # Complete graph edge count + @test is_connected(lg) + @test all(degree(lg) .== n-2) # Regular graph of degree n-2 + end + end +end From bf50374fbba4f8c58b0f0f9f9f00a50b88c7c12a Mon Sep 17 00:00:00 2001 From: LeonLampret Date: Sun, 8 Jun 2025 19:52:48 +0200 Subject: [PATCH 03/11] test: improve line graph tests for undirected graphs --- test/operators.jl | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/test/operators.jl b/test/operators.jl index 32d86defa..27b4d627b 100644 --- a/test/operators.jl +++ b/test/operators.jl @@ -354,39 +354,35 @@ end end -@testset "Line Graph" begin - @testset "Cycle Graphs" begin - for n in 3:5 +@testset "Undirected Line Graph" begin + @testset "Undirected Cycle Graphs" begin + for n in 3:9 g = cycle_graph(n) - lg = line_graph(g) + lg = line_graph(g) # checking if lg is an n-cycle @test nv(lg) == n @test ne(lg) == n @test is_connected(lg) - @test all(degree(lg) .== 2) # All vertices degree 2 + @test all(degree(v) == 2 for v in vertices(lg)) end end - @testset "Path Graphs" begin - for n in 2:5 + @testset "Undirected Path Graphs" begin + for n in 2:9 g = path_graph(n) - lg = line_graph(g) + lg = line_graph(g) # checking if lg is an n-1-path @test nv(lg) == n-1 @test ne(lg) == n-2 @test is_connected(lg) - degrees = degree(lg) - @test sum(degrees .== 1) == 2 # Exactly 2 leaves - @test sum(degrees .== 2) == max(0, n-3) # Rest degree 2 + @test all(degree(v) <= 2 for v in vertices(lg)) + @test any(degree(v) == 1 for v in vertices(lg)) end end - @testset "Star Graphs" begin - for n in 3:5 + @testset "Undirected Star Graphs" begin + for n in 3:9 g = star_graph(n) - lg = line_graph(g) + lg = line_graph(g) # checking if lg is a complete graph on n-1 vertices @test nv(lg) == n-1 - @test ne(lg) == binomial(n-1, 2) # Complete graph edge count - @test is_connected(lg) - @test all(degree(lg) .== n-2) # Regular graph of degree n-2 - end + @test ne(lg) == binomial(n-1, 2) # lg must be a complete graph end end From 78081caacc7b14d958f50600207134cba69c722e Mon Sep 17 00:00:00 2001 From: "LeonLampret (aider)" Date: Sun, 8 Jun 2025 19:52:52 +0200 Subject: [PATCH 04/11] test: improve line graph test cases with stricter degree checks --- test/operators.jl | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/test/operators.jl b/test/operators.jl index 27b4d627b..32d86defa 100644 --- a/test/operators.jl +++ b/test/operators.jl @@ -354,35 +354,39 @@ end end -@testset "Undirected Line Graph" begin - @testset "Undirected Cycle Graphs" begin - for n in 3:9 +@testset "Line Graph" begin + @testset "Cycle Graphs" begin + for n in 3:5 g = cycle_graph(n) - lg = line_graph(g) # checking if lg is an n-cycle + lg = line_graph(g) @test nv(lg) == n @test ne(lg) == n @test is_connected(lg) - @test all(degree(v) == 2 for v in vertices(lg)) + @test all(degree(lg) .== 2) # All vertices degree 2 end end - @testset "Undirected Path Graphs" begin - for n in 2:9 + @testset "Path Graphs" begin + for n in 2:5 g = path_graph(n) - lg = line_graph(g) # checking if lg is an n-1-path + lg = line_graph(g) @test nv(lg) == n-1 @test ne(lg) == n-2 @test is_connected(lg) - @test all(degree(v) <= 2 for v in vertices(lg)) - @test any(degree(v) == 1 for v in vertices(lg)) + degrees = degree(lg) + @test sum(degrees .== 1) == 2 # Exactly 2 leaves + @test sum(degrees .== 2) == max(0, n-3) # Rest degree 2 end end - @testset "Undirected Star Graphs" begin - for n in 3:9 + @testset "Star Graphs" begin + for n in 3:5 g = star_graph(n) - lg = line_graph(g) # checking if lg is a complete graph on n-1 vertices + lg = line_graph(g) @test nv(lg) == n-1 - @test ne(lg) == binomial(n-1, 2) # lg must be a complete graph + @test ne(lg) == binomial(n-1, 2) # Complete graph edge count + @test is_connected(lg) + @test all(degree(lg) .== n-2) # Regular graph of degree n-2 + end end end From d4603aea996ce6d441946ebd189dd0310bcb3c33 Mon Sep 17 00:00:00 2001 From: LeonLampret Date: Sun, 8 Jun 2025 21:50:44 +0200 Subject: [PATCH 05/11] corrected the tests for undirected line graph --- .gitignore | 1 + Project.toml | 1 + test/operators.jl | 44 ++++++++++++++++++++++++-------------------- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 2135f4172..5628095a6 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ benchmark/Manifest.toml /docs/src/index.md /docs/src/contributing.md /docs/src/license.md +.aider* diff --git a/Project.toml b/Project.toml index f869ac359..1727bd673 100644 --- a/Project.toml +++ b/Project.toml @@ -7,6 +7,7 @@ ArnoldiMethod = "ec485272-7323-5ecc-a04f-4719b315124d" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" Inflate = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" +JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SharedArrays = "1a1011a3-84de-559e-8e89-a11a2f7dc383" diff --git a/test/operators.jl b/test/operators.jl index 32d86defa..6913c2440 100644 --- a/test/operators.jl +++ b/test/operators.jl @@ -354,39 +354,43 @@ end end -@testset "Line Graph" begin - @testset "Cycle Graphs" begin - for n in 3:5 +@testset "Undirected Line Graph" begin + @testset "Undirected Cycle Graphs" begin + for n in 3:9 g = cycle_graph(n) - lg = line_graph(g) + lg = line_graph(g) # checking if lg is an n-cycle @test nv(lg) == n @test ne(lg) == n @test is_connected(lg) - @test all(degree(lg) .== 2) # All vertices degree 2 + @test all(degree(lg, v) == 2 for v in vertices(lg)) end end - @testset "Path Graphs" begin - for n in 2:5 + @testset "Undirected Path Graphs" begin + for n in 2:9 g = path_graph(n) - lg = line_graph(g) - @test nv(lg) == n-1 - @test ne(lg) == n-2 + lg = line_graph(g) # checking if lg is an n-1-path + @test nv(lg) == n - 1 + @test ne(lg) == n - 2 @test is_connected(lg) - degrees = degree(lg) - @test sum(degrees .== 1) == 2 # Exactly 2 leaves - @test sum(degrees .== 2) == max(0, n-3) # Rest degree 2 + @test all(degree(lg, v) <= 2 for v in vertices(lg)) + @test any(degree(lg, v) == 1 for v in vertices(lg)) || n == 2 && ne(lg) == 0 end end - @testset "Star Graphs" begin - for n in 3:5 + @testset "Undirected Star Graphs" begin + for n in 3:9 g = star_graph(n) - lg = line_graph(g) - @test nv(lg) == n-1 - @test ne(lg) == binomial(n-1, 2) # Complete graph edge count - @test is_connected(lg) - @test all(degree(lg) .== n-2) # Regular graph of degree n-2 + lg = line_graph(g) # checking if lg is a complete graph on n-1 vertices + @test nv(lg) == n - 1 + @test ne(lg) == binomial(n - 1, 2) # lg must be a complete graph end end + + @testset "Self-loops" begin + g = SimpleGraph(2, [[2], [1, 2], Int[]]) + lg = line_graph(g) + @test nv(lg) == 2 # only 2 edges (self-loop counts once) + @test ne(lg) == 1 # only connection between edge 1-2 and self-loop 2-2 + end end From 4de39c5ec904e2a1c9f94132536011ca967f8b22 Mon Sep 17 00:00:00 2001 From: LeonLampret Date: Sun, 8 Jun 2025 22:08:39 +0200 Subject: [PATCH 06/11] test: rename testset for undirected self-loops --- test/operators.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/operators.jl b/test/operators.jl index 6913c2440..b06425ba4 100644 --- a/test/operators.jl +++ b/test/operators.jl @@ -387,7 +387,7 @@ end end end - @testset "Self-loops" begin + @testset "Undirected Self-loops" begin g = SimpleGraph(2, [[2], [1, 2], Int[]]) lg = line_graph(g) @test nv(lg) == 2 # only 2 edges (self-loop counts once) From 1b3282b24a0bb93d34eb602e8ead95ca68c8698a Mon Sep 17 00:00:00 2001 From: "LeonLampret (aider)" Date: Sun, 8 Jun 2025 22:09:16 +0200 Subject: [PATCH 07/11] I notice there seems to be some confusion in the diffs - the new tests were added in the wrong location (before the "Undirected Line Graph" tests instead of after). Let me correct that: test/operators.jl ```julia <<<<<<< SEARCH @testset "Length: $(typeof(g))" for g in test_generic_graphs(SimpleGraph(100)) @test length(g) == 10000 end end @testset "Undirected Line Graph" begin ======= @testset "Length: $(typeof(g))" for g in test_generic_graphs(SimpleGraph(100)) @test length(g) == 10000 end end @testset "Directed Line Graph" begin @testset "Directed Cycle Graphs" begin for n in 3:9 g = cycle_digraph(n) lg = line_graph(g) @test nv(lg) == n @test ne(lg) == n @test is_directed(lg) @test all(outdegree(lg, v) == 1 for v in vertices(lg)) @test all(indegree(lg, v) == 1 for v in vertices(lg)) end end @testset "Directed Path Graphs" begin for n in 2:9 g = path_digraph(n) lg = line_graph(g) @test nv(lg) == n - 1 @test ne(lg) == n - 2 @test is_directed(lg) @test is_connected(lg) @test all(outdegree(lg, v) <= 1 for v in vertices(lg)) @test all(indegree(lg, v) <= 1 for v in vertices(lg)) if n > 2 @test indegree(lg, 1) == 0 @test outdegree(lg, 1) == 1 @test indegree(lg, nv(lg)) == 1 @test outdegree(lg, nv(lg)) == 0 end end end @testset "Directed Star Graphs" begin for n in 3:9 g = star_digraph(n) lg = line_graph(g) @test nv(lg) == n - 1 @test ne(lg) == 0 end for n in 3:9 g = SimpleDiGraph(n) for i in 2:n add_edge!(g, 1, i) add_edge!(g, i, 1) end lg = line_graph(g) @test nv(lg) == 2*(n-1) @test ne(lg) == (n-1) + (n-1)*(n-1) end end @testset "Directed Self-loops" begin g = SimpleDiGraph(2) add_edge!(g, 1, 1) add_edge!(g, 1, 2) lg = line_graph(g) @test nv(lg) == 2 @test ne(lg) == 2 @test has_edge(lg, 1, 1) @test has_edge(lg, 1, 2) @test !has_edge(lg, 2, 1) @test !has_edge(lg, 2, 2) end end @testset "Undirected Line Graph" begin >>>>>>> REPLACE ``` This change: 1. Adds the new directed line graph tests in the correct location (after the length tests and before the undirected line graph tests) 2. Maintains all existing tests exactly as they were 3. Adds comprehensive tests for directed line graphs with the same structure as the undirected tests The tests cover: - Directed cycle graphs (should produce directed cycles) - Directed path graphs (should produce shorter directed paths) - Directed star graphs (both unidirectional and bidirectional cases) - Directed graphs with self-loops (testing edge cases) Each test verifies the expected number of vertices, edges, and connectivity properties of the resulting line graph. --- test/operators.jl | 67 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/test/operators.jl b/test/operators.jl index b06425ba4..6a8871c0a 100644 --- a/test/operators.jl +++ b/test/operators.jl @@ -352,6 +352,71 @@ @testset "Length: $(typeof(g))" for g in test_generic_graphs(SimpleGraph(100)) @test length(g) == 10000 end + @testset "Directed Line Graph" begin + @testset "Directed Cycle Graphs" begin + for n in 3:9 + g = cycle_digraph(n) + lg = line_graph(g) + @test nv(lg) == n + @test ne(lg) == n + @test is_directed(lg) + @test all(outdegree(lg, v) == 1 for v in vertices(lg)) + @test all(indegree(lg, v) == 1 for v in vertices(lg)) + end + end + + @testset "Directed Path Graphs" begin + for n in 2:9 + g = path_digraph(n) + lg = line_graph(g) + @test nv(lg) == n - 1 + @test ne(lg) == n - 2 + @test is_directed(lg) + @test is_connected(lg) + @test all(outdegree(lg, v) <= 1 for v in vertices(lg)) + @test all(indegree(lg, v) <= 1 for v in vertices(lg)) + if n > 2 + @test indegree(lg, 1) == 0 + @test outdegree(lg, 1) == 1 + @test indegree(lg, nv(lg)) == 1 + @test outdegree(lg, nv(lg)) == 0 + end + end + end + + @testset "Directed Star Graphs" begin + for n in 3:9 + g = star_digraph(n) + lg = line_graph(g) + @test nv(lg) == n - 1 + @test ne(lg) == 0 + end + + for n in 3:9 + g = SimpleDiGraph(n) + for i in 2:n + add_edge!(g, 1, i) + add_edge!(g, i, 1) + end + lg = line_graph(g) + @test nv(lg) == 2*(n-1) + @test ne(lg) == (n-1) + (n-1)*(n-1) + end + end + + @testset "Directed Self-loops" begin + g = SimpleDiGraph(2) + add_edge!(g, 1, 1) + add_edge!(g, 1, 2) + lg = line_graph(g) + @test nv(lg) == 2 + @test ne(lg) == 2 + @test has_edge(lg, 1, 1) + @test has_edge(lg, 1, 2) + @test !has_edge(lg, 2, 1) + @test !has_edge(lg, 2, 2) + end + end end @testset "Undirected Line Graph" begin @@ -393,4 +458,6 @@ end @test nv(lg) == 2 # only 2 edges (self-loop counts once) @test ne(lg) == 1 # only connection between edge 1-2 and self-loop 2-2 end + + end From d525f46d4c39b46d538bfe7c0ae53b28eeef2921 Mon Sep 17 00:00:00 2001 From: LeonLampret Date: Sun, 8 Jun 2025 23:41:00 +0200 Subject: [PATCH 08/11] added unit tests for directed line graph --- Project.toml | 1 - test/operators.jl | 132 ++++++++++++++++++++-------------------------- 2 files changed, 58 insertions(+), 75 deletions(-) diff --git a/Project.toml b/Project.toml index 1727bd673..f869ac359 100644 --- a/Project.toml +++ b/Project.toml @@ -7,7 +7,6 @@ ArnoldiMethod = "ec485272-7323-5ecc-a04f-4719b315124d" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" Inflate = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" -JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SharedArrays = "1a1011a3-84de-559e-8e89-a11a2f7dc383" diff --git a/test/operators.jl b/test/operators.jl index 6a8871c0a..d92a4bff9 100644 --- a/test/operators.jl +++ b/test/operators.jl @@ -352,6 +352,48 @@ @testset "Length: $(typeof(g))" for g in test_generic_graphs(SimpleGraph(100)) @test length(g) == 10000 end + + @testset "Undirected Line Graph" begin + @testset "Undirected Cycle Graphs" begin + for n in 3:9 + g = cycle_graph(n) + lg = line_graph(g) # checking if lg is an n-cycle + @test nv(lg) == n + @test ne(lg) == n + @test is_connected(lg) + @test all(degree(lg, v) == 2 for v in vertices(lg)) + end + end + + @testset "Undirected Path Graphs" begin + for n in 2:9 + g = path_graph(n) + lg = line_graph(g) # checking if lg is an n-1-path + @test nv(lg) == n - 1 + @test ne(lg) == n - 2 + @test is_connected(lg) + @test all(degree(lg, v) <= 2 for v in vertices(lg)) + @test any(degree(lg, v) == 1 for v in vertices(lg)) || n == 2 && ne(lg) == 0 + end + end + + @testset "Undirected Star Graphs" begin + for n in 3:9 + g = star_graph(n) + lg = line_graph(g) # checking if lg is a complete graph on n-1 vertices + @test nv(lg) == n - 1 + @test ne(lg) == binomial(n - 1, 2) # lg must be a complete graph + end + end + + @testset "Undirected Self-loops" begin + g = SimpleGraph(2, [[2], [1, 2], Int[]]) + lg = line_graph(g) + @test nv(lg) == 2 # only 2 edges (self-loop counts once) + @test ne(lg) == 1 # only connection between edge 1-2 and self-loop 2-2 + end + end + @testset "Directed Line Graph" begin @testset "Directed Cycle Graphs" begin for n in 3:9 @@ -360,6 +402,7 @@ @test nv(lg) == n @test ne(lg) == n @test is_directed(lg) + @test is_connected(lg) @test all(outdegree(lg, v) == 1 for v in vertices(lg)) @test all(indegree(lg, v) == 1 for v in vertices(lg)) end @@ -373,91 +416,32 @@ @test ne(lg) == n - 2 @test is_directed(lg) @test is_connected(lg) - @test all(outdegree(lg, v) <= 1 for v in vertices(lg)) - @test all(indegree(lg, v) <= 1 for v in vertices(lg)) - if n > 2 - @test indegree(lg, 1) == 0 - @test outdegree(lg, 1) == 1 - @test indegree(lg, nv(lg)) == 1 - @test outdegree(lg, nv(lg)) == 0 - end + @test all(outdegree(lg, v) == (v < n - 1 ? 1 : 0) for v in vertices(lg)) + @test all(indegree(lg, v) == (v > 1 ? 1 : 0) for v in vertices(lg)) end end @testset "Directed Star Graphs" begin - for n in 3:9 - g = star_digraph(n) - lg = line_graph(g) - @test nv(lg) == n - 1 - @test ne(lg) == 0 - end - - for n in 3:9 - g = SimpleDiGraph(n) - for i in 2:n - add_edge!(g, 1, i) - add_edge!(g, i, 1) - end - lg = line_graph(g) - @test nv(lg) == 2*(n-1) - @test ne(lg) == (n-1) + (n-1)*(n-1) + for m in 0:4, n in 0:4 + g = SimpleDiGraph(m + n + 1) + foreach(i -> add_edge!(g, i + 1, 1), 1:m) + foreach(j -> add_edge!(g, 1, j + 1 + m), 1:n) + lg = line_graph(g) # checking if lg is the complete bipartite digraph + @test nv(lg) == m + n + @test ne(lg) == m * n + @test all(outdegree(lg, v) == 0 && indegree(lg, v) == m for v in 1:n) + @test all( + outdegree(lg, v) == n && indegree(lg, v) == 0 for v in (n + 1):(n + m) + ) end end @testset "Directed Self-loops" begin - g = SimpleDiGraph(2) - add_edge!(g, 1, 1) - add_edge!(g, 1, 2) + g = SimpleDiGraph(2, [[1, 2], Int[], Int[]], [[1], [1], Int[]]) lg = line_graph(g) @test nv(lg) == 2 - @test ne(lg) == 2 - @test has_edge(lg, 1, 1) + @test ne(lg) == 1 @test has_edge(lg, 1, 2) - @test !has_edge(lg, 2, 1) - @test !has_edge(lg, 2, 2) - end - end -end - -@testset "Undirected Line Graph" begin - @testset "Undirected Cycle Graphs" begin - for n in 3:9 - g = cycle_graph(n) - lg = line_graph(g) # checking if lg is an n-cycle - @test nv(lg) == n - @test ne(lg) == n - @test is_connected(lg) - @test all(degree(lg, v) == 2 for v in vertices(lg)) - end - end - - @testset "Undirected Path Graphs" begin - for n in 2:9 - g = path_graph(n) - lg = line_graph(g) # checking if lg is an n-1-path - @test nv(lg) == n - 1 - @test ne(lg) == n - 2 - @test is_connected(lg) - @test all(degree(lg, v) <= 2 for v in vertices(lg)) - @test any(degree(lg, v) == 1 for v in vertices(lg)) || n == 2 && ne(lg) == 0 end end - - @testset "Undirected Star Graphs" begin - for n in 3:9 - g = star_graph(n) - lg = line_graph(g) # checking if lg is a complete graph on n-1 vertices - @test nv(lg) == n - 1 - @test ne(lg) == binomial(n - 1, 2) # lg must be a complete graph - end - end - - @testset "Undirected Self-loops" begin - g = SimpleGraph(2, [[2], [1, 2], Int[]]) - lg = line_graph(g) - @test nv(lg) == 2 # only 2 edges (self-loop counts once) - @test ne(lg) == 1 # only connection between edge 1-2 and self-loop 2-2 - end - - end From e8a013dfc5ed11250b22eb432bb31e6d7bea8819 Mon Sep 17 00:00:00 2001 From: LeonLampret Date: Tue, 10 Jun 2025 22:10:17 +0200 Subject: [PATCH 09/11] renamed variables to f/badjlist and added tests for graphs over Int8,...,UInt128 --- Manifest.toml | 244 ++++++++++++++++++++++++++++++++++++++++++++++ Project.toml | 1 + src/operators.jl | 32 +++--- test/operators.jl | 24 +++-- 4 files changed, 276 insertions(+), 25 deletions(-) create mode 100644 Manifest.toml diff --git a/Manifest.toml b/Manifest.toml new file mode 100644 index 000000000..e3d9169fe --- /dev/null +++ b/Manifest.toml @@ -0,0 +1,244 @@ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.12.0-beta4" +manifest_format = "2.0" +project_hash = "bcaf375c0caf49e051cc266bfbea08524def119d" + +[[deps.ArnoldiMethod]] +deps = ["LinearAlgebra", "Random", "StaticArrays"] +git-tree-sha1 = "d57bd3762d308bded22c3b82d033bff85f6195c6" +uuid = "ec485272-7323-5ecc-a04f-4719b315124d" +version = "0.4.0" + +[[deps.Artifacts]] +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" +version = "1.11.0" + +[[deps.Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" +version = "1.11.0" + +[[deps.CSTParser]] +deps = ["Tokenize"] +git-tree-sha1 = "0157e592151e39fa570645e2b2debcdfb8a0f112" +uuid = "00ebfdb7-1f24-5e51-bd34-a7502290713f" +version = "3.4.3" + +[[deps.CommonMark]] +deps = ["Crayons", "PrecompileTools"] +git-tree-sha1 = "5fdf00d1979fd4883b44b754fc3423175c9504b4" +uuid = "a80b9123-70ca-4bc0-993e-6e3bcb318db6" +version = "0.8.16" + +[[deps.Compat]] +deps = ["TOML", "UUIDs"] +git-tree-sha1 = "8ae8d32e09f0dcf42a36b90d4e17f5dd2e4c4215" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "4.16.0" +weakdeps = ["Dates", "LinearAlgebra"] + + [deps.Compat.extensions] + CompatLinearAlgebraExt = "LinearAlgebra" + +[[deps.CompilerSupportLibraries_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "1.3.0+1" + +[[deps.Crayons]] +git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" +uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" +version = "4.1.1" + +[[deps.DataStructures]] +deps = ["Compat", "InteractiveUtils", "OrderedCollections"] +git-tree-sha1 = "4e1fe97fdaed23e9dc21d4d664bea76b65fc50a0" +uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +version = "0.18.22" + +[[deps.Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" +version = "1.11.0" + +[[deps.Distributed]] +deps = ["Random", "Serialization", "Sockets"] +uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" +version = "1.11.0" + +[[deps.Glob]] +git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496" +uuid = "c27321d9-0574-5035-807b-f59d2c89b15c" +version = "1.3.1" + +[[deps.Graphs]] +deps = ["ArnoldiMethod", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] +path = "." +uuid = "86223c79-3864-5bf0-83f7-82e725a168b6" +version = "1.13.0" + +[[deps.Inflate]] +git-tree-sha1 = "d1b1b796e47d94588b3757fe84fbf65a5ec4a80d" +uuid = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" +version = "0.1.5" + +[[deps.InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" +version = "1.11.0" + +[[deps.JuliaFormatter]] +deps = ["CSTParser", "CommonMark", "DataStructures", "Glob", "PrecompileTools", "TOML", "Tokenize"] +git-tree-sha1 = "59cf7ad64f1b0708a4fa4369879d33bad3239b56" +uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899" +version = "1.0.62" + +[[deps.JuliaSyntaxHighlighting]] +deps = ["StyledStrings"] +uuid = "ac6e5ff7-fb65-4e79-a425-ec3bc9c03011" +version = "1.12.0" + +[[deps.Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" +version = "1.11.0" + +[[deps.LinearAlgebra]] +deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +version = "1.12.0" + +[[deps.MacroTools]] +git-tree-sha1 = "1e0228a030642014fe5cfe68c2c0a818f9e3f522" +uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +version = "0.5.16" + +[[deps.Markdown]] +deps = ["Base64", "JuliaSyntaxHighlighting", "StyledStrings"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" +version = "1.11.0" + +[[deps.Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" +version = "1.11.0" + +[[deps.OpenBLAS_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.29+0" + +[[deps.OrderedCollections]] +git-tree-sha1 = "05868e21324cede2207c6f0f466b4bfef6d5e7ee" +uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +version = "1.8.1" + +[[deps.PrecompileTools]] +deps = ["Preferences"] +git-tree-sha1 = "516f18f048a195409d6e072acf879a9f017d3900" +uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +version = "1.3.2" + +[[deps.Preferences]] +deps = ["TOML"] +git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.4.3" + +[[deps.Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" +version = "1.11.0" + +[[deps.Random]] +deps = ["SHA"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +version = "1.11.0" + +[[deps.SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" + +[[deps.Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" +version = "1.11.0" + +[[deps.SharedArrays]] +deps = ["Distributed", "Mmap", "Random", "Serialization"] +uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" +version = "1.11.0" + +[[deps.SimpleTraits]] +deps = ["InteractiveUtils", "MacroTools"] +git-tree-sha1 = "5d7e3f4e11935503d3ecaf7186eac40602e7d231" +uuid = "699a6c99-e7fa-54fc-8d76-47d257e15c1d" +version = "0.9.4" + +[[deps.Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" +version = "1.11.0" + +[[deps.SparseArrays]] +deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] +uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +version = "1.12.0" + +[[deps.StaticArrays]] +deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] +git-tree-sha1 = "0feb6b9031bd5c51f9072393eb5ab3efd31bf9e4" +uuid = "90137ffa-7385-5640-81b9-e52037218182" +version = "1.9.13" + + [deps.StaticArrays.extensions] + StaticArraysChainRulesCoreExt = "ChainRulesCore" + StaticArraysStatisticsExt = "Statistics" + + [deps.StaticArrays.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + +[[deps.StaticArraysCore]] +git-tree-sha1 = "192954ef1208c7019899fbf8049e717f92959682" +uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" +version = "1.4.3" + +[[deps.Statistics]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0" +uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +version = "1.11.1" +weakdeps = ["SparseArrays"] + + [deps.Statistics.extensions] + SparseArraysExt = ["SparseArrays"] + +[[deps.StyledStrings]] +uuid = "f489334b-da3d-4c2e-b8f0-e476e12c162b" +version = "1.11.0" + +[[deps.SuiteSparse_jll]] +deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] +uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" +version = "7.8.3+2" + +[[deps.TOML]] +deps = ["Dates"] +uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +version = "1.0.3" + +[[deps.Tokenize]] +git-tree-sha1 = "468b4685af4abe0e9fd4d7bf495a6554a6276e75" +uuid = "0796e94c-ce3b-5d07-9a54-7f471281c624" +version = "0.5.29" + +[[deps.UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" +version = "1.11.0" + +[[deps.Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" +version = "1.11.0" + +[[deps.libblastrampoline_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "5.12.0+0" diff --git a/Project.toml b/Project.toml index f869ac359..1727bd673 100644 --- a/Project.toml +++ b/Project.toml @@ -7,6 +7,7 @@ ArnoldiMethod = "ec485272-7323-5ecc-a04f-4719b315124d" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" Inflate = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" +JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SharedArrays = "1a1011a3-84de-559e-8e89-a11a2f7dc383" diff --git a/src/operators.jl b/src/operators.jl index 793db3f86..b07dda91a 100644 --- a/src/operators.jl +++ b/src/operators.jl @@ -881,7 +881,7 @@ function merge_vertices!(g::Graph{T}, vs::Vector{U} where {U<:Integer}) where {T end """ - line_graph(g::SimpleGraph) + line_graph(g::SimpleGraph) ::SimpleGraph Given a graph `g`, return the graph `lg`, whose vertices are integers that enumerate the edges in `g`, and two vertices in `lg` form an edge iff the corresponding edges in `g` share a common endpoint. In other words, edges in `lg` are length-2 paths in `g`. @@ -897,7 +897,7 @@ julia> lg = line_graph(g) {4, 3} undirected simple Int64 graph ``` """ -function line_graph(g::SimpleGraph)::SimpleGraph +function line_graph(g::SimpleGraph) vertex_to_edges = [Int[] for _ in 1:nv(g)] for (i, e) in enumerate(edges(g)) s, d = src(e), dst(e) @@ -906,24 +906,24 @@ function line_graph(g::SimpleGraph)::SimpleGraph push!(vertex_to_edges[d], i) end - edge_to_neighbors = [Int[] for _ in 1:ne(g)] + fadjlist = [Int[] for _ in 1:ne(g)] # edge to neighbors adjacency in lg m = 0 # number of edges in the line-graph for es in vertex_to_edges n = length(es) for i in 1:(n - 1), j in (i + 1):n # iterate through pairs of edges with same endpoint ei, ej = es[i], es[j] m += 1 - push!(edge_to_neighbors[ei], ej) - push!(edge_to_neighbors[ej], ei) + push!(fadjlist[ei], ej) + push!(fadjlist[ej], ei) end end - foreach(sort!, edge_to_neighbors) - return SimpleGraph(m, edge_to_neighbors) + foreach(sort!, fadjlist) + return SimpleGraph(m, fadjlist) end """ - line_graph(g::SimpleDiGraph) + line_graph(g::SimpleDiGraph) ::SimpleDiGraph Given a digraph `g`, return the digraph `lg`, whose vertices are integers that enumerate the edges in `g`, and there is an edge in `lg` from `Edge(a,b)` to `Edge(c,d)` iff b==c. In other words, edges in `lg` are length-2 directed paths in `g`. @@ -939,7 +939,7 @@ julia> lg = line_graph(g) {5, 5} directed simple Int64 graph ``` """ -function line_graph(g::SimpleDiGraph)::SimpleDiGraph +function line_graph(g::SimpleDiGraph) vertex_to_edgesout = [Int[] for _ in 1:nv(g)] vertex_to_edgesin = [Int[] for _ in 1:nv(g)] for (i, e) in enumerate(edges(g)) @@ -948,19 +948,19 @@ function line_graph(g::SimpleDiGraph)::SimpleDiGraph push!(vertex_to_edgesin[d], i) end - edge_to_neighborsout = [Int[] for _ in 1:ne(g)] - edge_to_neighborsin = [Int[] for _ in 1:ne(g)] + fadjilist = [Int[] for _ in 1:ne(g)] # edge to neighbors forward adjacency in lg + badjilist = [Int[] for _ in 1:ne(g)] # edge to neighbors backward adjacency in lg m = 0 # number of edges in the line-graph for (e_i, e_o) in zip(vertex_to_edgesin, vertex_to_edgesout) for ei in e_i, eo in e_o # iterate through length-2 directed paths ei == eo && continue # a self-loop in g does not induce a self-loop in lg m += 1 - push!(edge_to_neighborsout[ei], eo) - push!(edge_to_neighborsin[eo], ei) + push!(fadjilist[ei], eo) + push!(badjilist[eo], ei) end end - foreach(sort!, edge_to_neighborsout) - foreach(sort!, edge_to_neighborsin) - return SimpleDiGraph(m, edge_to_neighborsout, edge_to_neighborsin) + foreach(sort!, fadjilist) + foreach(sort!, badjilist) + return SimpleDiGraph(m, fadjilist, badjilist) end diff --git a/test/operators.jl b/test/operators.jl index d92a4bff9..2bcda7624 100644 --- a/test/operators.jl +++ b/test/operators.jl @@ -387,10 +387,13 @@ end @testset "Undirected Self-loops" begin - g = SimpleGraph(2, [[2], [1, 2], Int[]]) - lg = line_graph(g) - @test nv(lg) == 2 # only 2 edges (self-loop counts once) - @test ne(lg) == 1 # only connection between edge 1-2 and self-loop 2-2 + for T in + (Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, UInt128) + g = SimpleGraph{T}(2, [T[2], T[1, 2], T[]]) + lg = line_graph(g) + @test nv(lg) == 2 # only 2 edges (self-loop counts once) + @test ne(lg) == 1 # only connection between edge 1-2 and self-loop 2-2 + end end end @@ -437,11 +440,14 @@ end @testset "Directed Self-loops" begin - g = SimpleDiGraph(2, [[1, 2], Int[], Int[]], [[1], [1], Int[]]) - lg = line_graph(g) - @test nv(lg) == 2 - @test ne(lg) == 1 - @test has_edge(lg, 1, 2) + for T in + (Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, UInt128) + g = SimpleDiGraph{T}(2, [T[1, 2], T[], T[]], [T[1], T[1], T[]]) + lg = line_graph(g) + @test nv(lg) == 2 + @test ne(lg) == 1 + @test has_edge(lg, 1, 2) + end end end end From 33f8a195a394fd0493f2434c6d23e058c7d7383b Mon Sep 17 00:00:00 2001 From: lampretl Date: Thu, 12 Jun 2025 22:19:27 +0200 Subject: [PATCH 10/11] Stop tracking Manifest.toml (was committed by mistake) --- Manifest.toml | 244 -------------------------------------------------- 1 file changed, 244 deletions(-) delete mode 100644 Manifest.toml diff --git a/Manifest.toml b/Manifest.toml deleted file mode 100644 index e3d9169fe..000000000 --- a/Manifest.toml +++ /dev/null @@ -1,244 +0,0 @@ -# This file is machine-generated - editing it directly is not advised - -julia_version = "1.12.0-beta4" -manifest_format = "2.0" -project_hash = "bcaf375c0caf49e051cc266bfbea08524def119d" - -[[deps.ArnoldiMethod]] -deps = ["LinearAlgebra", "Random", "StaticArrays"] -git-tree-sha1 = "d57bd3762d308bded22c3b82d033bff85f6195c6" -uuid = "ec485272-7323-5ecc-a04f-4719b315124d" -version = "0.4.0" - -[[deps.Artifacts]] -uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" -version = "1.11.0" - -[[deps.Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" -version = "1.11.0" - -[[deps.CSTParser]] -deps = ["Tokenize"] -git-tree-sha1 = "0157e592151e39fa570645e2b2debcdfb8a0f112" -uuid = "00ebfdb7-1f24-5e51-bd34-a7502290713f" -version = "3.4.3" - -[[deps.CommonMark]] -deps = ["Crayons", "PrecompileTools"] -git-tree-sha1 = "5fdf00d1979fd4883b44b754fc3423175c9504b4" -uuid = "a80b9123-70ca-4bc0-993e-6e3bcb318db6" -version = "0.8.16" - -[[deps.Compat]] -deps = ["TOML", "UUIDs"] -git-tree-sha1 = "8ae8d32e09f0dcf42a36b90d4e17f5dd2e4c4215" -uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.16.0" -weakdeps = ["Dates", "LinearAlgebra"] - - [deps.Compat.extensions] - CompatLinearAlgebraExt = "LinearAlgebra" - -[[deps.CompilerSupportLibraries_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.3.0+1" - -[[deps.Crayons]] -git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" -uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" -version = "4.1.1" - -[[deps.DataStructures]] -deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "4e1fe97fdaed23e9dc21d4d664bea76b65fc50a0" -uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.22" - -[[deps.Dates]] -deps = ["Printf"] -uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" -version = "1.11.0" - -[[deps.Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" -version = "1.11.0" - -[[deps.Glob]] -git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496" -uuid = "c27321d9-0574-5035-807b-f59d2c89b15c" -version = "1.3.1" - -[[deps.Graphs]] -deps = ["ArnoldiMethod", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] -path = "." -uuid = "86223c79-3864-5bf0-83f7-82e725a168b6" -version = "1.13.0" - -[[deps.Inflate]] -git-tree-sha1 = "d1b1b796e47d94588b3757fe84fbf65a5ec4a80d" -uuid = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" -version = "0.1.5" - -[[deps.InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" -version = "1.11.0" - -[[deps.JuliaFormatter]] -deps = ["CSTParser", "CommonMark", "DataStructures", "Glob", "PrecompileTools", "TOML", "Tokenize"] -git-tree-sha1 = "59cf7ad64f1b0708a4fa4369879d33bad3239b56" -uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899" -version = "1.0.62" - -[[deps.JuliaSyntaxHighlighting]] -deps = ["StyledStrings"] -uuid = "ac6e5ff7-fb65-4e79-a425-ec3bc9c03011" -version = "1.12.0" - -[[deps.Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" -version = "1.11.0" - -[[deps.LinearAlgebra]] -deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] -uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" -version = "1.12.0" - -[[deps.MacroTools]] -git-tree-sha1 = "1e0228a030642014fe5cfe68c2c0a818f9e3f522" -uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.16" - -[[deps.Markdown]] -deps = ["Base64", "JuliaSyntaxHighlighting", "StyledStrings"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" -version = "1.11.0" - -[[deps.Mmap]] -uuid = "a63ad114-7e13-5084-954f-fe012c677804" -version = "1.11.0" - -[[deps.OpenBLAS_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] -uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.29+0" - -[[deps.OrderedCollections]] -git-tree-sha1 = "05868e21324cede2207c6f0f466b4bfef6d5e7ee" -uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.8.1" - -[[deps.PrecompileTools]] -deps = ["Preferences"] -git-tree-sha1 = "516f18f048a195409d6e072acf879a9f017d3900" -uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" -version = "1.3.2" - -[[deps.Preferences]] -deps = ["TOML"] -git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" -uuid = "21216c6a-2e73-6563-6e65-726566657250" -version = "1.4.3" - -[[deps.Printf]] -deps = ["Unicode"] -uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" -version = "1.11.0" - -[[deps.Random]] -deps = ["SHA"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" -version = "1.11.0" - -[[deps.SHA]] -uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" -version = "0.7.0" - -[[deps.Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" -version = "1.11.0" - -[[deps.SharedArrays]] -deps = ["Distributed", "Mmap", "Random", "Serialization"] -uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" -version = "1.11.0" - -[[deps.SimpleTraits]] -deps = ["InteractiveUtils", "MacroTools"] -git-tree-sha1 = "5d7e3f4e11935503d3ecaf7186eac40602e7d231" -uuid = "699a6c99-e7fa-54fc-8d76-47d257e15c1d" -version = "0.9.4" - -[[deps.Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" -version = "1.11.0" - -[[deps.SparseArrays]] -deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] -uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" -version = "1.12.0" - -[[deps.StaticArrays]] -deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] -git-tree-sha1 = "0feb6b9031bd5c51f9072393eb5ab3efd31bf9e4" -uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.9.13" - - [deps.StaticArrays.extensions] - StaticArraysChainRulesCoreExt = "ChainRulesCore" - StaticArraysStatisticsExt = "Statistics" - - [deps.StaticArrays.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" - -[[deps.StaticArraysCore]] -git-tree-sha1 = "192954ef1208c7019899fbf8049e717f92959682" -uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.4.3" - -[[deps.Statistics]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0" -uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" -version = "1.11.1" -weakdeps = ["SparseArrays"] - - [deps.Statistics.extensions] - SparseArraysExt = ["SparseArrays"] - -[[deps.StyledStrings]] -uuid = "f489334b-da3d-4c2e-b8f0-e476e12c162b" -version = "1.11.0" - -[[deps.SuiteSparse_jll]] -deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] -uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" -version = "7.8.3+2" - -[[deps.TOML]] -deps = ["Dates"] -uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" -version = "1.0.3" - -[[deps.Tokenize]] -git-tree-sha1 = "468b4685af4abe0e9fd4d7bf495a6554a6276e75" -uuid = "0796e94c-ce3b-5d07-9a54-7f471281c624" -version = "0.5.29" - -[[deps.UUIDs]] -deps = ["Random", "SHA"] -uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" -version = "1.11.0" - -[[deps.Unicode]] -uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" -version = "1.11.0" - -[[deps.libblastrampoline_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.12.0+0" From d2fdc7353f7e8dc773461cde29fe727dcfce9a74 Mon Sep 17 00:00:00 2001 From: lampretl Date: Fri, 13 Jun 2025 22:07:12 +0200 Subject: [PATCH 11/11] removed JuliaFormatter from dependencies --- Project.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Project.toml b/Project.toml index 1727bd673..f869ac359 100644 --- a/Project.toml +++ b/Project.toml @@ -7,7 +7,6 @@ ArnoldiMethod = "ec485272-7323-5ecc-a04f-4719b315124d" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" Inflate = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" -JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SharedArrays = "1a1011a3-84de-559e-8e89-a11a2f7dc383"