Skip to content

Latest commit

 

History

History
148 lines (111 loc) · 2.95 KB

File metadata and controls

148 lines (111 loc) · 2.95 KB
title Intelligent Pathfinding Guide
description Semantic pathfinding finds paths that are not just shortest, but most relevant to your query and graph semantics.
type guide
status stable

Intelligent Pathfinding Guide

Overview

Semantic pathfinding finds paths that are not just shortest, but most relevant to your query and graph semantics.

Algorithms

1. Semantic Path (Enhanced A*)

Finds shortest path weighted by:

  • Edge weights
  • Node type compatibility
  • Query relevance
POST /api/pathfinding/semantic-path
Content-Type: application/json

{
  "startId": 123,
  "endId": 456,
  "query": "machine learning projects"
}

Response:

{
  "path": [123, 234, 345, 456],
  "cost": 3.2,
  "relevance": 0.87,
  "explanation": "Found path with 3 hops"
}

2. Query-Guided Traversal

Explores graph prioritizing nodes matching your query:

POST /api/pathfinding/query-traversal
Content-Type: application/json

{
  "startId": 123,
  "query": "artificial intelligence",
  "maxNodes": 50
}

Returns most relevant nodes, sorted by query match.

3. Chunk Traversal

Explores local neighborhood without query context:

POST /api/pathfinding/chunk-traversal
Content-Type: application/json

{
  "startId": 123,
  "maxNodes": 50
}

Finds similar nodes based on:

  • Node type similarity
  • Local structure
  • Attribute similarity

Configuration

Pathfinding Parameters

{
  "maxLength": 10,
  "maxExplored": 1000,
  "edgeWeightFactor": 0.4,
  "semanticWeightFactor": 0.4,
  "typeWeightFactor": 0.2
}
  • edgeWeightFactor: How much edge weights matter (0.0-1.0)
  • semanticWeightFactor: How much query relevance matters
  • typeWeightFactor: How much type compatibility matters

Use Cases

Research Navigation

Find research papers related to query:

query: "neural networks"
→ Traverses to ML papers, AI researchers, related projects

Dependency Analysis

Find critical dependencies:

query: "authentication security"
→ Paths weighted by security relevance

Knowledge Discovery

Explore related concepts:

query: "quantum computing"
→ Discovers related papers, researchers, applications

Performance

  • Semantic Path: O(V log V) with semantic weighting
  • Query Traversal: O(V + E) with relevance pruning
  • Chunk Traversal: O(k * degree) for k nodes

Typical performance:

  • 10K nodes: <100ms
  • 100K nodes: <1s
  • 1M nodes: <5s (with limits)

Best Practices

  1. Set appropriate limits: maxLength and maxExplored prevent long searches
  2. Use query context: More specific queries = better results
  3. Choose right algorithm:
    • Semantic Path: When you know start and end
    • Query Traversal: When exploring by topic
    • Chunk Traversal: When exploring local structure
  4. Combine with filters: Use schema to filter node types first
  5. Cache results: Common paths can be cached

Examples

See API documentation for complete examples and frontend integration.