Skip to content

Commit bcc881f

Browse files
committed
refactor(algorithms): move graph generation to graph-gen package
Move graph specification, analysis, and validation code from algorithms to the new graph-gen package for better separation of concerns: - graph-spec.ts: Type-safe graph property specifications - graph-spec-analyzer.ts: Graph property computation (29+ axes) - graph-spec-constraints.ts: Mathematical impossibility detection - graph-generator.ts: Test fixture generation - validation/: Graph validation logic and type checking Also update import paths and remove export from algorithms index.
1 parent c7d1e39 commit bcc881f

15 files changed

+17
-17
lines changed

packages/algorithms/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* Algorithms package main exports
33
*/
44

5-
// Graph property analysis
6-
export * from "./graph-spec-analyzer";
5+
// Graph property analysis (moved to @bibgraph/graph-gen)
6+
// export * from "./graph-spec-analyzer";
77

88
// Core analysis algorithms
99
export * from "./analysis/scc";
File renamed without changes.
File renamed without changes.

packages/algorithms/src/graph-spec-constraints.ts renamed to packages/graph-gen/src/graph-spec-constraints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { GraphSpec } from '../__tests__/fixtures/graph-spec';
1+
import type { GraphSpec } from './graph-spec';
22

33
/**
44
* Mathematical impossibility in a graph specification.
File renamed without changes.

packages/algorithms/src/validation/basic-validators.ts renamed to packages/graph-gen/src/validation/basic-validators.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { GraphSpec } from "../../__tests__/fixtures/graph-spec";
2-
import type { TestGraph, TestNode, TestEdge } from "../../__tests__/fixtures/graph-generator";
1+
import type { GraphSpec } from "../graph-spec";
2+
import type { TestGraph, TestNode, TestEdge } from "../graph-generator";
33
import { isConnected, buildAdjacencyList } from "./helper-functions";
44
import type { PropertyValidationResult } from "./types";
55

packages/algorithms/src/validation/coloring-validator.ts renamed to packages/graph-gen/src/validation/coloring-validator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { GraphSpec } from '../../__tests__/fixtures/graph-spec';
2-
import type { TestGraph, TestNode, TestEdge } from '../../__tests__/fixtures/graph-generator';
1+
import type { GraphSpec } from '../graph-spec';
2+
import type { TestGraph, TestNode, TestEdge } from '../graph-generator';
33
import type { PropertyValidationResult } from './types';
44
import { buildAdjacencyList } from './helper-functions';
55

packages/algorithms/src/validation/connectivity-validators.ts renamed to packages/graph-gen/src/validation/connectivity-validators.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { GraphSpec } from '../../__tests__/fixtures/graph-spec';
2-
import type { TestGraph, TestNode, TestEdge } from '../../__tests__/fixtures/graph-generator';
1+
import type { GraphSpec } from '../graph-spec';
2+
import type { TestGraph, TestNode, TestEdge } from '../graph-generator';
33
import { isConnected } from './helper-functions';
44

55
/**

packages/algorithms/src/validation/degree-validators.ts renamed to packages/graph-gen/src/validation/degree-validators.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { GraphSpec } from '../../__tests__/fixtures/graph-spec';
2-
import type { TestGraph, TestNode, TestEdge } from '../../__tests__/fixtures/graph-generator';
1+
import type { GraphSpec } from '../graph-spec';
2+
import type { TestGraph, TestNode, TestEdge } from '../graph-generator';
33

44
/**
55
* Validate regular graph properties (cubic or k-regular).

packages/algorithms/src/validation/flow-validator.ts renamed to packages/graph-gen/src/validation/flow-validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TestGraph, TestEdge } from '../../__tests__/fixtures/graph-generator';
1+
import type { TestGraph, TestEdge } from '../graph-generator';
22
import type { PropertyValidationResult } from './types';
33

44
/**

0 commit comments

Comments
 (0)