Skip to main content

Module algorithm

Module algorithm 

Source
Expand description

Route-finding algorithms. Includes MostLiquidAlgorithm, algorithm::BellmanFordAlgorithm, PathFrankWolfeAlgorithm, algorithm::WaterFillAlgorithm, and the pluggable Algorithm trait. 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;
pub use path_frank_wolfe::PathFrankWolfeAlgorithm;
pub use water_fill::WaterFillAlgorithm;

Modules§

bellman_ford
Bellman-Ford algorithm with SPFA optimization for simulation-driven routing.
most_liquid
Most Liquid algorithm implementation.
path_frank_wolfe
Path-based Frank-Wolfe split-routing algorithm.
water_fill
Water-fill split-routing algorithm (water_fill).

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.