File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -454,7 +454,9 @@ export
454454
455455 # planarity
456456 is_planar,
457- planar_maximally_filtered_graph
457+ planar_maximally_filtered_graph,
458+ chromatic_number,
459+ edge_chromatic_number
458460"""
459461 Graphs
460462
@@ -575,6 +577,7 @@ include("independentset/degree_ind_set.jl")
575577include (" independentset/maximal_ind_set.jl" )
576578include (" vertexcover/degree_vertex_cover.jl" )
577579include (" vertexcover/random_vertex_cover.jl" )
580+ include (" vngraphs_stubs.jl" )
578581include (" Experimental/Experimental.jl" )
579582include (" Parallel/Parallel.jl" )
580583include (" Test/Test.jl" )
Original file line number Diff line number Diff line change 1+ # Algorithm stubs for VNGraphs.jl integration
2+
3+ """
4+ chromatic_number(g, timeout=0)
5+
6+ Return the chromatic number of the graph `g`.
7+ Note: This is a stub provided by `Graphs.jl`. For a concrete implementation,
8+ please use the `VNGraphs.jl` package which provides a fast C implementation
9+ via `very_nauty`.
10+
11+ ```julia
12+ using VNGraphs
13+ chromatic_number(g)
14+ ```
15+ """
16+ function chromatic_number (g:: AbstractGraph , args... ; kwargs... )
17+ error (" chromatic_number is not implemented in Graphs.jl. " *
18+ " Please load VNGraphs.jl to use the very_nauty implementation." )
19+ end
20+
21+ """
22+ edge_chromatic_number(g, timeout=0)
23+
24+ Return the edge chromatic number of the graph `g`.
25+ Note: This is a stub provided by `Graphs.jl`. For a concrete implementation,
26+ please use the `VNGraphs.jl` package which provides a fast C implementation
27+ via `very_nauty`.
28+
29+ ```julia
30+ using VNGraphs
31+ edge_chromatic_number(g)
32+ ```
33+ """
34+ function edge_chromatic_number (g:: AbstractGraph , args... ; kwargs... )
35+ error (" edge_chromatic_number is not implemented in Graphs.jl. " *
36+ " Please load VNGraphs.jl to use the very_nauty implementation." )
37+ end
38+
39+ export chromatic_number, edge_chromatic_number
Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ tests = [
155155 " trees/prufer" ,
156156 " experimental/experimental" ,
157157 " planarity" ,
158+ " vngraphs_stubs" ,
158159]
159160
160161@testset verbose = true " Graphs" begin
Original file line number Diff line number Diff line change 1+ using Graphs
2+ using Test
3+
4+ @testset " VNGraphs Stubs" begin
5+ g = path_graph (5 )
6+
7+ @test_throws ErrorException chromatic_number (g)
8+ @test_throws ErrorException edge_chromatic_number (g)
9+
10+ # Verify the error message contains the suggestion to load VNGraphs.jl
11+ try
12+ chromatic_number (g)
13+ catch e
14+ @test contains (e. msg, " VNGraphs.jl" )
15+ end
16+
17+ try
18+ edge_chromatic_number (g)
19+ catch e
20+ @test contains (e. msg, " VNGraphs.jl" )
21+ end
22+ end
You can’t perform that action at this time.
0 commit comments