shortestpath 0.10.0

Shortest Path is an experimental library finding the shortest path from A to B.
Documentation
// Copyright (C) 2025 Christian Mauduit <ufoot@ufoot.org>

//! Dynamic topology for meshes with conditional connectivity.
//!
//! This module provides tools for creating meshes with conditional or dynamic connectivity,
//! such as one-way passages, doors that can open/close, or connections that depend on
//! game state or external conditions.
//!
//! # Overview
//!
//! While standard meshes have fixed connectivity (e.g., a 2D grid always connects to
//! its 8 neighbors), topology allows you to conditionally enable or disable specific
//! connections at runtime. This is useful for:
//!
//! - **One-way passages**: Movement allowed only in one direction
//! - **Dynamic doors**: Connections that can be opened or closed
//! - **Conditional gates**: Movement allowed based on game state (keys, switches, etc.)
//! - **Asymmetric graphs**: Different paths available depending on direction
//!
//! # Main Types
//!
//! - [`Topology`] - Trait for defining which connections are allowed between nodes
//! - [`TopologyBool`] - Simple topology controlled by a boolean flag (all connections on/off)
//! - [`MeshWithTopology`] - Wrapper that combines a mesh with topology rules
//!
//! # Example
//!
//! ```
//! use shortestpath::{Mesh, Gradient, mesh_2d::Full2D, mesh_topo::{MeshWithTopology, TopologyBool}};
//!
//! // Create a base mesh
//! let base_mesh = Full2D::new(5, 5);
//!
//! // Create a topology that can enable/disable all connections
//! let mut topology = TopologyBool::new(true);
//!
//! // Wrap mesh with topology
//! let mesh = MeshWithTopology::new(&base_mesh, &topology);
//!
//! // Use for pathfinding - all connections enabled
//! let mut gradient = Gradient::from_mesh(&mesh);
//! gradient.set_distance(12, 0.0);
//! gradient.spread(&mesh);
//!
//! // Later, disable all connections by changing topology
//! topology.set(false);
//! // Now the mesh would have no connections when used again
//! ```

mod mesh_with_topology;
mod topology;
mod topology_bool;

pub use mesh_with_topology::*;
pub use topology::*;
pub use topology_bool::*;