route-engine-rs 0.1.0

Routing engine for directed graphs with extensible strategies and constraints
Documentation
  • Coverage
  • 31.08%
    23 out of 74 items documented0 out of 33 items with examples
  • Size
  • Source code size: 39.32 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.03 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ibatanov/route-engine-rs
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ibatanov

route-engine-rs

Version Repository License

Легковесная библиотека для поиска маршрутов в ориентированном графе с расширяемыми стратегиями и бизнес-ограничениями.

Что внутри

  • graph — базовый граф Graph<N, E> и NodeId.
  • algorithms — Dijkstra:
    • shortest_path(...)
    • shortest_path_with_constraint(...)
  • strategies — как считать стоимость пути:
    • ByCost (1 критерий)
    • ByTwoCosts (2 критерия, лексикографический приоритет)
  • constraints — правила прохождения ребер:
    • PathConstraint
    • AllowAll
  • errors — ошибки библиотеки.

Быстрый старт

Запуск примера:

cargo run --example transit_cost

Как расширять

  1. Добавить новую стратегию: реализовать PathStrategy<E> и определить State + Key.

  2. Добавить новое бизнес-правило: реализовать PathConstraint<N, E> и проверять ребро через EdgeContext.

  3. Запустить поиск:

  • без ограничений: shortest_path(...)
  • с ограничениями: shortest_path_with_constraint(...)

Тесты

cargo test