Skip to main content

Module algorithm

Module algorithm 

Source
Expand description

Route-finding algorithms.

This module defines the Algorithm trait and built-in implementations. New algorithms can be added by implementing the trait.

Algorithms are generic over their preferred graph type, allowing them to use different graph crates (petgraph, custom, etc.) and leverage built-in algorithms.

§Adding a New Algorithm

External: Implement the Algorithm trait in your own crate and plug it into a WorkerPoolBuilder via with_algorithm. No changes to fynd-core required. See the custom_algorithm example.

Built-in: To add an algorithm to the built-in registry:

  1. Create a new module with your algorithm implementation
  2. Implement the Algorithm trait
  3. Register it in registry.rs

Re-exports§

pub use bellman_ford::BellmanFordAlgorithm;
pub use most_liquid::MostLiquidAlgorithm;

Modules§

bellman_ford
Bellman-Ford algorithm with SPFA optimization for simulation-driven routing.
most_liquid
Most Liquid algorithm implementation.

Structs§

AlgorithmConfig
Configuration for an Algorithm instance.

Enums§

AlgorithmError
Errors that can occur during route finding.
NoPathReason
Reason why no path was found between tokens.

Traits§

Algorithm
Trait for route-finding algorithms.