A comprehensive benchmark suite testing ISONGraph's graph traversal and analysis capabilities against other serialization formats.
This benchmark evaluates how well Large Language Models (LLMs) can perform graph operations (traversal, path finding, analysis) when graph data is presented in different serialization formats. Unlike the Knowledge Graph Benchmark which tests comprehension across 10 formats, this benchmark focuses on core graph operations with 5 formats.
| Metric | ISONGraph | Best Alternative | Improvement |
|---|---|---|---|
| Token Efficiency | 639 tokens | ISON (685) | 7% fewer |
| Accuracy | 92.0% | ISON (88.0%) | +4% |
| Efficiency Score | 143.97 Acc/1K | ISON (128.47) | 12% better |
This benchmark specifically tests:
- Multi-hop Traversal - Friends of friends, N-hop reachability
- Path Finding - Shortest path, path existence, hop counting
- Graph Analysis - Connectivity, cycles, node/edge counts
- Relationship Patterns - follows, knows, works_at, reports_to
| Format | Description | Token Count | Accuracy |
|---|---|---|---|
| ISONGraph | Graph-native ISON format | 639 | 92.0% |
| ISON | Base ISON tabular format | 685 | 88.0% |
| TOON | Token-Optimized Object Notation | 856 | 80.0% |
| JSON Compact | Minified JSON | 1,072 | 82.0% |
| JSON | Standard indented JSON | 2,039 | 84.0% |
pip install tiktoken requests toon
pip install -e ../ison-py
pip install -e ../ison-graph# Token counting + unit tests (no API calls)
python benchmark_graph.py
# Unit tests only
python benchmark_graph.py --unit-tests
# Full benchmark with LLM accuracy testing
python benchmark_graph.py --full| Option | Description |
|---|---|
--skip-llm |
Skip LLM API calls, only count tokens |
--full |
Run complete benchmark with LLM accuracy testing |
--unit-tests |
Run ISONGraph unit tests only |
| Dataset | Questions | Description |
|---|---|---|
| Social Network | 15 | Users with follows relationships, cycles |
| Knowledge Graph | 15 | Companies, people, products with various relations |
| Organization Chart | 10 | Hierarchical structure (DAG - no cycles) |
| Flight Routes | 10 | Cities connected by flights with distances |
| Category | Count | Description |
|---|---|---|
| Single-hop | 15 | Direct neighbor queries |
| Multi-hop | 10 | Friends of friends, reachability |
| Analysis | 20 | Connectivity, cycles, degrees, counts |
| Path Finding | 5 | Shortest path, path existence |
The benchmark includes comprehensive unit tests for ISONGraph functionality:
- Basic Operations - Node/edge CRUD
- Multi-hop Traversal - 1-hop, 2-hop, N-hop queries
- Shortest Path - BFS-based path finding
- Cycle Detection - Graph cycle detection
- Connectivity - Connected component checking
- Serialization - ISON roundtrip
- Query Patterns - Mini-query language
- Fluent API - Chained traversal calls
See BENCHMARK.md for detailed results and analysis.
| Rank | Format | Tokens | Accuracy | Acc/1K |
|---|---|---|---|---|
| 1 | ISONGraph | 639 | 92.0% | 143.97 |
| 2 | ISON | 685 | 88.0% | 128.47 |
| 3 | TOON | 856 | 80.0% | 93.46 |
| 4 | JSON Compact | 1,072 | 82.0% | 76.49 |
| 5 | JSON | 2,039 | 84.0% | 41.20 |
The benchmark uses the DeepSeek API. Set the DEEPSEEK_API_KEY environment variable before running:
export DEEPSEEK_API_KEY="your-api-key" # Windows PowerShell: $env:DEEPSEEK_API_KEY = "your-api-key"Uses tiktoken with the o200k_base encoding (GPT-4o/GPT-5 tokenizer).
After running, the benchmark generates:
benchmark_graph_YYYYMMDD_HHMMSS.log- Timestamped detailed logbenchmark_graph_latest.log- Latest run log (overwritten each run)
- Explicit Edge Sections:
edges.FOLLOWS,edges.REPORTS_TOmake relationship types clear - Reference Syntax:
:person:1notation enables precise node identification - Graph-Native Structure: Unlike flat JSON, ISONGraph preserves graph topology
- LLM-Friendly: Tabular format is easier for LLMs to parse and reason about
ISONGraph (119 tokens):
edges.FOLLOWS
since source target
2019 :person:2 :person:3
2020 :person:1 :person:2
2021 :person:1 :person:3
nodes.person
id age name verified
1 28 Alice true
2 34 Bob false
3 29 Carol true
JSON (411 tokens):
{
"nodes": [
{"id": 1, "type": "person", "name": "Alice", "age": 28, "verified": true},
...
],
"edges": [
{"source": 1, "target": 2, "relation": "follows", "since": 2020},
...
]
}Token Savings: 71%
| Aspect | DataTraversal Benchmark | KnowledgeGraph Benchmark |
|---|---|---|
| Focus | Graph operations | Format comprehension |
| Questions | 50 | 100 |
| Formats | 5 (core) | 10 (comprehensive) |
| Best Accuracy | 92.0% (ISONGraph) | 90.0% (ISONGraph) |
| Best Efficiency | 143.97 Acc/1K | 53.00 Acc/1K |
- Knowledge Graph Benchmark - 100 questions, 10 formats
MIT License - See LICENSE file for details.
Mahesh Vaikri
