feat(graph): Implement Dijkstra-based pathfinding engine for format transformations#247
Merged
Merged
Conversation
5 tasks
- Add TransformPath struct (steps, total_cost, total_quality) in graph/pathfinding.rs - Add find_path() using Dijkstra (A* with zero heuristic) for min-cost path - Add find_all_paths() using all_simple_paths sorted by total_cost ascending - Extract edges_from_node_path() helper to avoid duplication - Export TransformPath from graph module - Add 14 unit tests covering all pathfinding scenarios Agent-Logs-Url: https://github.com/egohygiene/renderflow/sessions/53244046-c233-4b71-a3d3-f8cd1e49fe28 Co-authored-by: szmyty <14865041+szmyty@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement pathfinding engine for format transformations
feat(graph): Implement Dijkstra-based pathfinding engine for format transformations
Apr 8, 2026
szmyty
approved these changes
Apr 8, 2026
Pull Request Summary by devActivityMetricsAchievements
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds graph pathfinding to
TransformGraphso callers can compute optimal transformation pipelines between document formats, with cost (additive) and quality (multiplicative) scoring.Changes
src/graph/pathfinding.rs— newTransformPathstruct:steps: Vec<TransformEdge>,total_cost: f32(sum),total_quality: f32(product)src/graph/mod.rs— extendedfind_path(from, to) -> Option<TransformPath>— Dijkstra (A* with zero heuristic via petgraph) returning the minimum-cost pathfind_all_paths(from, to) -> Vec<TransformPath>— enumerates all simple paths viaall_simple_paths, sorted bytotal_costascendingedges_from_node_path— private helper that reconstructs the cheapest directed edge per node-pair, shared between both public methodsUsage