diff --git a/README.md b/README.md index abc2c95..e68fb92 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,5 @@ [![Coverage](https://codecov.io/gh/JuliaGraphs/GraphProperties.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaGraphs/GraphProperties.jl) [![PkgEval](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/G/GraphProperties.svg)](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/G/GraphProperties.html) [![Aqua](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) + +Julia package for describing graph properties. diff --git a/src/GraphProperties.jl b/src/GraphProperties.jl index 8464daa..1bf12a2 100644 --- a/src/GraphProperties.jl +++ b/src/GraphProperties.jl @@ -1,5 +1,106 @@ module GraphProperties -# Write your package code here. +export + GraphProperty, + PropertyComparison + +abstract type GraphProperty{T} end + +struct PropertyComparison{ + Comparison <: Union{typeof(==), typeof(≤), typeof(≥)}, + Property <: GraphProperty{<:Real}, + Value, +} <: GraphProperty{Bool} + comparison::Comparison + property::Property + value::Value +end + +let + properties_abstractvector = Symbol[ + :DegreeSequence, + ] + properties_real = Symbol[ + :FractionalChromaticNumber, + :FractionalMatchingNumber, + ] + properties_integer = Symbol[ + :NumberOfVertices, + :NumberOfEdges, + :NumberOfArcs, + :NumberOfConnectedComponents, + :MinimumDegree, + :MaximumDegree, + :Girth, + :VertexConnectivity, + :EdgeConnectivity, + :CliqueNumber, + :ChromaticNumber, + :ChromaticIndex, + :MatchingNumber, + :DominationNumber, + :IndependenceNumber, + :Choosability, + :FeedbackVertexSetNumber, + :VertexCoverNumber, + :EdgeCoverNumber, + :IntersectionNumber, + :BipartiteDimension, + :HadwigerNumber, + :TwinWidth, + :CliqueWidth, + :Treewidth, + :Pathwidth, + :Boxicity, + :Degeneracy, + :Arboricity, + :Splittance, + ] + properties_bool = Symbol[ + :IsUndirectedGraph, + :IsDirectedGraph, + :DigraphIsDAG, + :DigraphIsOrientation, + :GraphIsConnected, + :DigraphIsWeaklyConnected, + :DigraphIsStronglyConnected, + :GraphIsBipartite, + :GraphIsPath, + :GraphIsCycle, + :GraphIsPlanar, + :DigraphIsPlanar, + :GraphIsTriangleFree, + :GraphIsComplete, + :GraphIsRegular, + :GraphIsPerfect, + :GraphIsTriviallyPerfect, + :GraphIsForest, + :GraphIsTree, + :GraphIsIndifferenceGraph, + :GraphIsIntervalGraph, + :GraphIsPtolemaic, + :GraphIsChordal, + :GraphIsMeynielGraph, + :GraphIsCircleGraph, + :GraphIsPermutationGraph, + :GraphIsCograph, + :GraphIsComparabilityGraph, + :GraphIsDistanceHereditary, + :GraphIsSplitGraph, + ] + for (typ, properties) ∈ ( + (AbstractVector, properties_abstractvector), + (Real, properties_real), + (Integer, properties_integer), + (Bool, properties_bool), + ) + for p ∈ properties + @eval export $p + @eval struct $p <: GraphProperty{$typ} end + end + end +end + +# TODO: doc strings end