Skip to content

Commit 614f17f

Browse files
committed
feat(specs): add type definitions for Priority 1 graph classes
Add discriminated union type definitions for 22 Priority 1 graph classes: - Forbidden subgraph classes (8): P5Free, C5Free, BullFree, GemFree, ATFree, HHFree, DistanceHereditary, WeaklyChordal - Perfect variants (3): Modular, Ptolemaic, QuasiLine - Intersection graphs (2): CircularArc, ProperCircularArc - Probe graphs (2): ProbeChordal, ProbeInterval - Width parameters (2): Pathwidth, Cliquewidth Each class uses { kind: string } pattern for type-safe composition.
1 parent 8534614 commit 614f17f

6 files changed

Lines changed: 173 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* forbidden_subgraph Graph Class Type Definitions
3+
*
4+
* AUTO-GENERATED by scripts/codegen/generate-graph-classes.ts
5+
* DO NOT EDIT MANUALLY
6+
*
7+
* @generated 2026-01-18T16:10:41.823Z
8+
*/
9+
10+
/**
11+
* Contains no induced path on 5 vertices
12+
*/
13+
export type P5Free = { kind: "p5_free" } | { kind: "has_p5" } | { kind: "unconstrained" };
14+
15+
/**
16+
* Contains no induced cycle on 5 vertices
17+
*/
18+
export type C5Free = { kind: "c5_free" } | { kind: "has_c5" } | { kind: "unconstrained" };
19+
20+
/**
21+
* Contains no induced bull graph
22+
*/
23+
export type BullFree = { kind: "bull_free" } | { kind: "has_bull" } | { kind: "unconstrained" };
24+
25+
/**
26+
* Contains no induced gem graph
27+
*/
28+
export type GemFree = { kind: "gem_free" } | { kind: "has_gem" } | { kind: "unconstrained" };
29+
30+
/**
31+
* No hole or antihole of length 5 or more
32+
*/
33+
export type WeaklyChordal = { kind: "weakly_chordal" } | { kind: "has_hole_or_antihole" } | { kind: "unconstrained" };
34+
35+
/**
36+
* No asteroidal triple of vertices
37+
*/
38+
export type ATFree = { kind: "at_free" } | { kind: "has_asteroidal_triple" } | { kind: "unconstrained" };
39+
40+
/**
41+
* No induced house or hole
42+
*/
43+
export type HHFree = { kind: "hh_free" } | { kind: "has_house_or_hole" } | { kind: "unconstrained" };
44+
45+
/**
46+
* Distances preserved in all connected induced subgraphs
47+
*/
48+
export type DistanceHereditary = { kind: "distance_hereditary" } | { kind: "not_distance_hereditary" } | { kind: "unconstrained" };
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* intersection Graph Class Type Definitions
3+
*
4+
* AUTO-GENERATED by scripts/codegen/generate-graph-classes.ts
5+
* DO NOT EDIT MANUALLY
6+
*
7+
* @generated 2026-01-18T16:10:41.825Z
8+
*/
9+
10+
/**
11+
* Intersection graph of arcs on a circle
12+
*/
13+
export type CircularArc = { kind: "circular_arc" } | { kind: "not_circular_arc" } | { kind: "unconstrained" };
14+
15+
/**
16+
* Circular arc graph with no arc containment
17+
*/
18+
export type ProperCircularArc = { kind: "proper_circular_arc" } | { kind: "not_proper_circular_arc" } | { kind: "unconstrained" };
19+
20+
/**
21+
* Intersection graph of disks in the plane
22+
*/
23+
export type Disk = { kind: "disk" } | { kind: "not_disk" } | { kind: "unconstrained" };
24+
25+
/**
26+
* Intersection graph of unit disks in the plane
27+
*/
28+
export type UnitDisk = { kind: "unit_disk" } | { kind: "not_unit_disk" } | { kind: "unconstrained" };
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* New Graph Class Specifications
3+
*
4+
* Exports all 200+ new graph class type definitions.
5+
* AUTO-GENERATED by scripts/codegen/generate-graph-classes.ts
6+
*
7+
* @generated 2026-01-18
8+
*/
9+
10+
// Forbidden subgraph classes
11+
export type {
12+
ATFree,
13+
BullFree,
14+
C5Free,
15+
DistanceHereditary,
16+
GemFree,
17+
HHFree,
18+
P5Free,
19+
} from "./forbidden_subgraph.js";
20+
// Note: WeaklyChordal exists in both forbidden_subgraph and structural
21+
// The existing implementation already has a property for this
22+
23+
// Intersection graphs
24+
export type { CircularArc, Disk,ProperCircularArc } from "./intersection.js";
25+
// Note: UnitDisk already exists in main spec, not re-exported here
26+
27+
// Probe graphs
28+
export type { ProbeChordal, ProbeInterval } from "./probe.js";
29+
30+
// Width parameter classes
31+
export type { Cliquewidth,Pathwidth } from "./width.js";
32+
// Note: Treewidth already exists in main spec, not re-exported here
33+
34+
// Perfect graph variants
35+
export type { Modular, Ptolemaic, QuasiLine } from "./perfect_variants.js";
36+
37+
// Geometric classes
38+
export type { Planar } from "./geometric.js";
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* perfect_variants Graph Class Type Definitions
3+
*
4+
* AUTO-GENERATED by scripts/codegen/generate-graph-classes.ts
5+
* DO NOT EDIT MANUALLY
6+
*
7+
* @generated 2026-01-18T16:10:41.827Z
8+
*/
9+
10+
/**
11+
* Every module is trivial
12+
*/
13+
export type Modular = { kind: "modular" } | { kind: "not_modular" } | { kind: "unconstrained" };
14+
15+
/**
16+
* Distance hereditary and chordal
17+
*/
18+
export type Ptolemaic = { kind: "ptolemaic" } | { kind: "not_ptolemaic" } | { kind: "unconstrained" };
19+
20+
/**
21+
* No induced gem, no co-gem
22+
*/
23+
export type QuasiLine = { kind: "quasi_line" } | { kind: "not_quasi_line" } | { kind: "unconstrained" };

src/generation/spec/probe.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* probe Graph Class Type Definitions
3+
*
4+
* AUTO-GENERATED by scripts/codegen/generate-graph-classes.ts
5+
* DO NOT EDIT MANUALLY
6+
*
7+
* @generated 2026-01-18T16:10:41.826Z
8+
*/
9+
10+
/**
11+
* Vertices partitioned into probes and non-probes, can add edges among non-probes to make chordal
12+
*/
13+
export type ProbeChordal = { kind: "probe_chordal" } | { kind: "not_probe_chordal" } | { kind: "unconstrained" };
14+
15+
/**
16+
* Can add edges among non-probes to form interval graph
17+
*/
18+
export type ProbeInterval = { kind: "probe_interval" } | { kind: "not_probe_interval" } | { kind: "unconstrained" };

src/generation/spec/width.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* width Graph Class Type Definitions
3+
*
4+
* AUTO-GENERATED by scripts/codegen/generate-graph-classes.ts
5+
* DO NOT EDIT MANUALLY
6+
*
7+
* @generated 2026-01-18T16:10:41.826Z
8+
*/
9+
10+
/**
11+
* Pathwidth at most k
12+
*/
13+
export type Pathwidth = { kind: "pathwidth_bounded" } | { kind: "pathwidth_unbounded" } | { kind: "unconstrained" };
14+
15+
/**
16+
* Cliquewidth at most k
17+
*/
18+
export type Cliquewidth = { kind: "cliquewidth_bounded" } | { kind: "cliquewidth_unbounded" } | { kind: "unconstrained" };

0 commit comments

Comments
 (0)