Skip to content

Commit 92929fa

Browse files
authored
init (#2)
1 parent cfbcd93 commit 92929fa

File tree

2 files changed

+104
-1
lines changed

2 files changed

+104
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88
[![Coverage](https://codecov.io/gh/JuliaGraphs/GraphProperties.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaGraphs/GraphProperties.jl)
99
[![PkgEval](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/G/GraphProperties.svg)](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/G/GraphProperties.html)
1010
[![Aqua](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
11+
12+
Julia package for describing graph properties.

src/GraphProperties.jl

Lines changed: 102 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,106 @@
11
module GraphProperties
22

3-
# Write your package code here.
3+
export
4+
GraphProperty,
5+
PropertyComparison
6+
7+
abstract type GraphProperty{T} end
8+
9+
struct PropertyComparison{
10+
Comparison <: Union{typeof(==), typeof(≤), typeof(≥)},
11+
Property <: GraphProperty{<:Real},
12+
Value,
13+
} <: GraphProperty{Bool}
14+
comparison::Comparison
15+
property::Property
16+
value::Value
17+
end
18+
19+
let
20+
properties_abstractvector = Symbol[
21+
:DegreeSequence,
22+
]
23+
properties_real = Symbol[
24+
:FractionalChromaticNumber,
25+
:FractionalMatchingNumber,
26+
]
27+
properties_integer = Symbol[
28+
:NumberOfVertices,
29+
:NumberOfEdges,
30+
:NumberOfArcs,
31+
:NumberOfConnectedComponents,
32+
:MinimumDegree,
33+
:MaximumDegree,
34+
:Girth,
35+
:VertexConnectivity,
36+
:EdgeConnectivity,
37+
:CliqueNumber,
38+
:ChromaticNumber,
39+
:ChromaticIndex,
40+
:MatchingNumber,
41+
:DominationNumber,
42+
:IndependenceNumber,
43+
:Choosability,
44+
:FeedbackVertexSetNumber,
45+
:VertexCoverNumber,
46+
:EdgeCoverNumber,
47+
:IntersectionNumber,
48+
:BipartiteDimension,
49+
:HadwigerNumber,
50+
:TwinWidth,
51+
:CliqueWidth,
52+
:Treewidth,
53+
:Pathwidth,
54+
:Boxicity,
55+
:Degeneracy,
56+
:Arboricity,
57+
:Splittance,
58+
]
59+
properties_bool = Symbol[
60+
:IsUndirectedGraph,
61+
:IsDirectedGraph,
62+
:DigraphIsDAG,
63+
:DigraphIsOrientation,
64+
:GraphIsConnected,
65+
:DigraphIsWeaklyConnected,
66+
:DigraphIsStronglyConnected,
67+
:GraphIsBipartite,
68+
:GraphIsPath,
69+
:GraphIsCycle,
70+
:GraphIsPlanar,
71+
:DigraphIsPlanar,
72+
:GraphIsTriangleFree,
73+
:GraphIsComplete,
74+
:GraphIsRegular,
75+
:GraphIsPerfect,
76+
:GraphIsTriviallyPerfect,
77+
:GraphIsForest,
78+
:GraphIsTree,
79+
:GraphIsIndifferenceGraph,
80+
:GraphIsIntervalGraph,
81+
:GraphIsPtolemaic,
82+
:GraphIsChordal,
83+
:GraphIsMeynielGraph,
84+
:GraphIsCircleGraph,
85+
:GraphIsPermutationGraph,
86+
:GraphIsCograph,
87+
:GraphIsComparabilityGraph,
88+
:GraphIsDistanceHereditary,
89+
:GraphIsSplitGraph,
90+
]
91+
for (typ, properties) (
92+
(AbstractVector, properties_abstractvector),
93+
(Real, properties_real),
94+
(Integer, properties_integer),
95+
(Bool, properties_bool),
96+
)
97+
for p properties
98+
@eval export $p
99+
@eval struct $p <: GraphProperty{$typ} end
100+
end
101+
end
102+
end
103+
104+
# TODO: doc strings
4105

5106
end

0 commit comments

Comments
 (0)