graphbox 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/cli.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ GraphBox provides a toolkit for graph manipulation, analysis, and generation, sp
|
|
|
11
11
|
|
|
12
12
|
## Overview
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
GraphBox consolidates three previously separate BibGraph packages into a single, focused package:
|
|
15
15
|
|
|
16
16
|
- **graph-core**: Core graph interfaces and adapters
|
|
17
17
|
- **graph-expansion**: Graph expansion, traversal algorithms, and neighborhood exploration
|
|
@@ -20,7 +20,7 @@ Graph-Box consolidates three previously separate BibGraph packages into a single
|
|
|
20
20
|
## Installation
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
pnpm install
|
|
23
|
+
pnpm install graphbox
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
## Key Features
|
|
@@ -30,7 +30,7 @@ pnpm install graph-box
|
|
|
30
30
|
`GraphAdapter` provides a bridge between different graph implementations, allowing you to use generic algorithms with your specific graph data structures.
|
|
31
31
|
|
|
32
32
|
```typescript
|
|
33
|
-
import { GraphAdapter } from '
|
|
33
|
+
import { GraphAdapter } from 'graphbox';
|
|
34
34
|
|
|
35
35
|
const adapter = new GraphAdapter(graph);
|
|
36
36
|
```
|
|
@@ -46,7 +46,7 @@ Multiple traversal algorithms for exploring graph neighborhoods:
|
|
|
46
46
|
- **Priority Queue** - Custom priority-based expansion
|
|
47
47
|
|
|
48
48
|
```typescript
|
|
49
|
-
import { bfs, dfs, extractEgoNetwork } from '
|
|
49
|
+
import { bfs, dfs, extractEgoNetwork } from 'graphbox';
|
|
50
50
|
|
|
51
51
|
const bfsResult = bfs(adapter, 'startNodeId');
|
|
52
52
|
const dfsResult = dfs(adapter, 'startNodeId');
|
|
@@ -68,7 +68,7 @@ const egoNetwork = extractEgoNetwork(adapter, {
|
|
|
68
68
|
Type-safe graph generation with mathematical constraint validation:
|
|
69
69
|
|
|
70
70
|
```typescript
|
|
71
|
-
import { generateGraph, validateGraph } from '
|
|
71
|
+
import { generateGraph, validateGraph } from 'graphbox';
|
|
72
72
|
|
|
73
73
|
const spec = {
|
|
74
74
|
type: 'complete',
|
|
@@ -90,7 +90,7 @@ const valid = validateGraph(graph, spec.constraints);
|
|
|
90
90
|
Mathematical constraint validation for graph properties:
|
|
91
91
|
|
|
92
92
|
```typescript
|
|
93
|
-
import { validateGraph, checkConstraints } from '
|
|
93
|
+
import { validateGraph, checkConstraints } from 'graphbox';
|
|
94
94
|
|
|
95
95
|
const isValid = validateGraph(graph, constraints);
|
|
96
96
|
```
|
|
@@ -100,7 +100,7 @@ const isValid = validateGraph(graph, constraints);
|
|
|
100
100
|
### Basic Traversal
|
|
101
101
|
|
|
102
102
|
```typescript
|
|
103
|
-
import { GraphAdapter, bfs } from '
|
|
103
|
+
import { GraphAdapter, bfs } from 'graphbox';
|
|
104
104
|
|
|
105
105
|
const graph = { /* your graph */ };
|
|
106
106
|
const adapter = new GraphAdapter(graph);
|
|
@@ -112,7 +112,7 @@ console.log(result.visited); // Array of visited node IDs
|
|
|
112
112
|
### Ego Network Extraction
|
|
113
113
|
|
|
114
114
|
```typescript
|
|
115
|
-
import { extractEgoNetwork } from '
|
|
115
|
+
import { extractEgoNetwork } from 'graphbox';
|
|
116
116
|
|
|
117
117
|
const adapter = new GraphAdapter(graph);
|
|
118
118
|
|
|
@@ -128,7 +128,7 @@ console.log(egoNetwork);
|
|
|
128
128
|
### Graph Generation
|
|
129
129
|
|
|
130
130
|
```typescript
|
|
131
|
-
import { generateGraph, GraphSpec } from '
|
|
131
|
+
import { generateGraph, GraphSpec } from 'graphbox';
|
|
132
132
|
|
|
133
133
|
const spec: GraphSpec = {
|
|
134
134
|
type: 'complete',
|
|
@@ -142,7 +142,7 @@ const graph = generateGraph(spec);
|
|
|
142
142
|
### Graph Validation
|
|
143
143
|
|
|
144
144
|
```typescript
|
|
145
|
-
import { validateGraph } from '
|
|
145
|
+
import { validateGraph } from 'graphbox';
|
|
146
146
|
|
|
147
147
|
const graph = { /* graph object */ };
|
|
148
148
|
const isValid = validateGraph(graph);
|
package/dist/cli.js
CHANGED
package/package.json
CHANGED