-
Notifications
You must be signed in to change notification settings - Fork 5
feat : Implement full Graphs.jl API and VNAlgorithm dispatch #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
1f74825
4c5ae7b
87a746a
0a3ce2d
0f64532
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same issues in this file as above. Also, do not remove the doc build. This repo might not have docs defined yet, but the failing workflow should remain, otherwise we will never remember to get around to making the docs folder. Overall, if something is broken, we should not hide the messenger that reminds us that it is broken. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # .typos.toml | ||
| [default] | ||
| extend-ignore-re = [ | ||
| "(?i)very_nauty_jll", | ||
| "(?i)vngraph", | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to `VNGraphs.jl` will be documented in this file. | ||
|
|
||
| ## [Unreleased] | ||
| - Implementing `Graphs.jl` interface including stubs for graph coloring algorithms. | ||
| - Providing `edge_chromatic_number` dispatch implementations via `very_nauty_jll`. |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,36 @@ | ||
| name = "VNGraphs" | ||
| uuid = "82074f20-eae8-4dc7-b23b-c0e0f9981814" | ||
| authors = ["Stefan Krastanov <stefan@krastanov.org>"] | ||
| version = "1.0.0" | ||
| authors = ["Stefan Krastanov <stefan@krastanov.org>"] | ||
|
|
||
| [deps] | ||
| CBinding = "d43a6710-96b8-4a2d-833c-c424785e5374" | ||
| Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" | ||
| very_nauty_jll = "be6384bf-868f-57ad-9feb-9e32886bc996" | ||
|
|
||
| [extras] | ||
| Aqua = "4c88cf16-3921-4891-9df3-0caf3b129712" | ||
| GraphsInterfaceChecker = "3bef136c-15ff-4091-acbb-1a4aafe67608" | ||
| Interfaces = "85a1e053-48ee-444a-9ef8-e160a0b2cc1c" | ||
| JET = "c3a54625-ed41-48e0-a4ff-191f74bb3f5d" | ||
| StableRNGs = "860ef19b-820b-49d6-a0d0-8fbd23ad0ade" | ||
| Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
| TestItemRunner = "f8b46487-219e-4ad5-845a-35d30081ef61" | ||
| BenchmarkTools = "6e4b44f1-6d23-5a04-9844-338276f71052" | ||
|
|
||
| [targets] | ||
| test = ["Aqua", "GraphsInterfaceChecker", "Interfaces", "JET", "StableRNGs", "Test", "TestItemRunner", "BenchmarkTools"] | ||
|
|
||
| [compat] | ||
| Aqua = "0.8" | ||
| CBinding = "1.1.0" | ||
| Graphs = "1.12.0" | ||
| GraphsInterfaceChecker = "0.1" | ||
| Interfaces = "0.3" | ||
| JET = "0.9, 0.10, 0.11" | ||
| StableRNGs = "1" | ||
| Test = "1" | ||
| TestItemRunner = "1" | ||
| julia = "1.10" | ||
| very_nauty_jll = "1.1.2" | ||
| BenchmarkTools = "1.5.0" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,31 @@ | ||
| A thin wrapper around the C graphs library [`very_nauty`](https://github.com/JuliaGraphs/very_nauty/). | ||
| # VNGraphs.jl | ||
|
|
||
| A thin wrapper around the C graphs library [`very_nauty`](https://github.com/JuliaGraphs/very_nauty/), providing high-performance graph algorithms for the `Graphs.jl` ecosystem. | ||
|
|
||
| ## Features | ||
|
|
||
| - **High Performance**: Direct C-bindings for core graph operations. | ||
| - **Graphs.jl Integration**: Fully implements the `AbstractGraph` interface. | ||
| - **Specialized Dispatch**: Use `VNAlgorithm()` to dispatch existing `Graphs.jl` functions to the `very_nauty` implementation. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```julia | ||
| using Graphs, VNGraphs | ||
|
|
||
| # Create a VNGraph | ||
| g = VNGraph(5) | ||
| add_edge!(g, 1, 2) | ||
|
|
||
| # Use standard Graphs.jl algorithms | ||
| c = chromatic_number(g) | ||
|
|
||
| # Dispatch explicitly using VNAlgorithm | ||
| c = chromatic_number(g, VNAlgorithm()) | ||
| ``` | ||
|
|
||
| ## Installation | ||
|
|
||
| ```julia | ||
| import Pkg; Pkg.add("VNGraphs") | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| using BenchmarkTools | ||
| using VNGraphs | ||
| using Graphs | ||
|
|
||
| const SUITE = BenchmarkGroup() | ||
|
|
||
| # Clique number benchmark | ||
| SUITE["clique"] = BenchmarkGroup() | ||
| for n in [10, 50, 100] | ||
| g = complete_graph(n) | ||
| vng = VNGraph(g) | ||
| SUITE["clique"][n] = @benchmarkable clique_number($vng) | ||
| end | ||
|
|
||
| # Chromatic number benchmark | ||
| SUITE["chromatic"] = BenchmarkGroup() | ||
| for n in [5, 10, 15] | ||
| g = cycle_graph(n) | ||
| vng = VNGraph(g) | ||
| SUITE["chromatic"][n] = @benchmarkable chromatic_number($vng) | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file seems to have started depending on external repos. This should be reverted and workflow files should generally be as "default" as possible to ease development.