Skip to content

feat : reliable idiomatic wrapper for the C library igraphs#505

Closed
mahmudsudo wants to merge 5 commits intoJuliaGraphs:masterfrom
mahmudsudo:igraph
Closed

feat : reliable idiomatic wrapper for the C library igraphs#505
mahmudsudo wants to merge 5 commits intoJuliaGraphs:masterfrom
mahmudsudo:igraph

Conversation

@mahmudsudo
Copy link

closes #446

@github-actions
Copy link
Contributor

github-actions bot commented Mar 26, 2026

Benchmark Results (Julia v1)

Time benchmarks
master 898a3d2... master / 898a3d2...
centrality/digraphs/betweenness_centrality 16.4 ± 0.37 ms 15.9 ± 0.79 ms 1.03 ± 0.056
centrality/digraphs/closeness_centrality 11.7 ± 0.41 ms 11.4 ± 0.49 ms 1.03 ± 0.057
centrality/digraphs/degree_centrality 1.94 ± 0.15 μs 2.08 ± 1.5 μs 0.933 ± 0.67
centrality/digraphs/katz_centrality 0.874 ± 0.081 ms 0.88 ± 0.076 ms 0.993 ± 0.13
centrality/digraphs/pagerank 0.037 ± 0.0012 ms 0.0365 ± 0.0044 ms 1.01 ± 0.13
centrality/graphs/betweenness_centrality 28.8 ± 1.5 ms 28.7 ± 1.5 ms 1 ± 0.072
centrality/graphs/closeness_centrality 21.4 ± 0.46 ms 21.3 ± 0.36 ms 1 ± 0.027
centrality/graphs/degree_centrality 1.5 ± 0.13 μs 1.49 ± 0.14 μs 1.01 ± 0.13
centrality/graphs/katz_centrality 1.03 ± 0.056 ms 1.03 ± 0.075 ms 1 ± 0.091
connectivity/digraphs/strongly_connected_components 0.0432 ± 0.0013 ms 0.0431 ± 0.0019 ms 1 ± 0.054
connectivity/graphs/connected_components 24 ± 0.66 μs 27.5 ± 1.1 μs 0.873 ± 0.041
core/edges/digraphs 7.11 ± 0.011 μs 7.01 ± 0.01 μs 1.01 ± 0.0021
core/edges/graphs 17.1 ± 0.1 μs 17 ± 0.1 μs 1 ± 0.0083
core/has_edge/digraphs 5.22 ± 0.36 μs 5.2 ± 0.45 μs 1 ± 0.11
core/has_edge/graphs 5.5 ± 0.38 μs 5.75 ± 0.82 μs 0.957 ± 0.15
core/nv/digraphs 0.37 ± 0.01 μs 0.371 ± 0.01 μs 0.997 ± 0.038
core/nv/graphs 0.391 ± 0.01 μs 0.381 ± 0.011 μs 1.03 ± 0.04
edges/fille 8.28 ± 0.81 μs 8.09 ± 0.94 μs 1.02 ± 0.16
edges/fillp 6.53 ± 3.7 μs 6.23 ± 4 μs 1.05 ± 0.9
edges/tsume 2.6 ± 0.07 μs 2.64 ± 0.13 μs 0.985 ± 0.055
edges/tsump 2.65 ± 0.061 μs 2.52 ± 0.12 μs 1.05 ± 0.055
insertions/SG(n,e) Generation 25.4 ± 3.2 ms 25.7 ± 3.1 ms 0.986 ± 0.17
parallel/egonet/twohop 0.281 ± 0.0059 s 0.291 ± 0.012 s 0.967 ± 0.045
parallel/egonet/vertexfunction 2.22 ± 0.13 ms 2.24 ± 0.18 ms 0.991 ± 0.098
serial/egonet/twohop 0.282 ± 0.014 s 0.296 ± 0.014 s 0.953 ± 0.066
serial/egonet/vertexfunction 2.21 ± 0.14 ms 2.26 ± 0.32 ms 0.98 ± 0.15
traversals/digraphs/bfs_tree 0.0496 ± 0.011 ms 0.0494 ± 0.011 ms 1 ± 0.32
traversals/digraphs/dfs_tree 0.0641 ± 0.011 ms 0.0645 ± 0.011 ms 0.994 ± 0.25
traversals/graphs/bfs_tree 0.0536 ± 0.01 ms 0.053 ± 0.0023 ms 1.01 ± 0.2
traversals/graphs/dfs_tree 0.0656 ± 0.0038 ms 0.066 ± 0.0044 ms 0.993 ± 0.087
time_to_load 0.528 ± 0.0066 s 0.528 ± 0.003 s 1 ± 0.014
Memory benchmarks
master 898a3d2... master / 898a3d2...
centrality/digraphs/betweenness_centrality 0.29 M allocs: 24 MB 0.29 M allocs: 24 MB 1
centrality/digraphs/closeness_centrality 18.6 k allocs: 14.5 MB 18.6 k allocs: 14.5 MB 1
centrality/digraphs/degree_centrality 8 allocs: 5.01 kB 8 allocs: 5.01 kB 1
centrality/digraphs/katz_centrality 2.63 k allocs: 2.83 MB 2.63 k allocs: 2.83 MB 1
centrality/digraphs/pagerank 21 allocs: 14.9 kB 21 allocs: 14.9 kB 1
centrality/graphs/betweenness_centrality 0.545 M allocs: 0.0313 GB 0.545 M allocs: 0.0313 GB 1
centrality/graphs/closeness_centrality 19.3 k allocs: 14 MB 19.3 k allocs: 14 MB 1
centrality/graphs/degree_centrality 10 allocs: 5.43 kB 10 allocs: 5.43 kB 1
centrality/graphs/katz_centrality 2.96 k allocs: 3.1 MB 2.96 k allocs: 3.1 MB 1
connectivity/digraphs/strongly_connected_components 1.05 k allocs: 0.075 MB 1.05 k allocs: 0.075 MB 1
connectivity/graphs/connected_components 0.061 k allocs: 22.5 kB 0.061 k allocs: 22.5 kB 1
core/edges/digraphs 3 allocs: 0.0938 kB 3 allocs: 0.0938 kB 1
core/edges/graphs 3 allocs: 0.0938 kB 3 allocs: 0.0938 kB 1
core/has_edge/digraphs 20 allocs: 12.6 kB 20 allocs: 12.6 kB 1
core/has_edge/graphs 28 allocs: 13.8 kB 28 allocs: 13.8 kB 1
core/nv/digraphs 3 allocs: 0.0938 kB 3 allocs: 0.0938 kB 1
core/nv/graphs 3 allocs: 0.0938 kB 3 allocs: 0.0938 kB 1
edges/fille 3 allocs: 0.153 MB 3 allocs: 0.153 MB 1
edges/fillp 3 allocs: 0.153 MB 3 allocs: 0.153 MB 1
edges/tsume 0 allocs: 0 B 0 allocs: 0 B
edges/tsump 0 allocs: 0 B 0 allocs: 0 B
insertions/SG(n,e) Generation 0.0465 M allocs: 10.9 MB 0.0465 M allocs: 11 MB 0.999
parallel/egonet/twohop 10 allocs: 0.0768 MB 10 allocs: 0.0768 MB 1
parallel/egonet/vertexfunction 10 allocs: 0.0768 MB 10 allocs: 0.0768 MB 1
serial/egonet/twohop 3 allocs: 0.0764 MB 3 allocs: 0.0764 MB 1
serial/egonet/vertexfunction 3 allocs: 0.0764 MB 3 allocs: 0.0764 MB 1
traversals/digraphs/bfs_tree 2.34 k allocs: 0.113 MB 2.34 k allocs: 0.113 MB 1
traversals/digraphs/dfs_tree 2.44 k allocs: 0.118 MB 2.44 k allocs: 0.118 MB 1
traversals/graphs/bfs_tree 2.52 k allocs: 0.121 MB 2.52 k allocs: 0.121 MB 1
traversals/graphs/dfs_tree 2.63 k allocs: 0.127 MB 2.63 k allocs: 0.127 MB 1
time_to_load 0.145 k allocs: 11 kB 0.145 k allocs: 11 kB 1

@Krastanov
Copy link
Member

Hi, @mahmudsudo ! Thanks for setting this up, it is very useful work! However it is structured in a way we will not be able to merge here.

Julia is organized around the paradigm of multiple dispatch, so to extend Graphs.jl with capabilities related to IGraphs.jl you do not need to make IGraphs.jl a dependency of Graphs.jl. We actually really do not want that -- Graphs.jl is supposed to be lean.

Graphs.jl is already a dependency of IGraphs.jl. So all you need to do is extend Graphs.jl is to define in IGraphs.jl new methods for functions from Graphs.jl. No need for package extensions.

@Krastanov
Copy link
Member

I will close this PR, but do not hesitate to open something similar in IGraphs.jl and then open a purely documentation-focused PR here.

@Krastanov Krastanov closed this Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A reliable idiomatic wrapper for the C library igraphs [$400]

2 participants