// ---
// tags: trop, source
// crystal-type: source
// crystal-domain: comp
// ---
//! Kleene star (shortest-path closure) for tropical matrices.
//!
//! Computes A* = I + A + A^2 + ... + A^(n-1) using the
//! Floyd-Warshall algorithm, which is exactly the Kleene star
//! in the (min, +) semiring. Runs in O(n^3).
use crateTropical;
use crate;
/// Compute the Kleene star of a tropical matrix.
///
/// A* = I (min) A (min) A^2 (min) ... (min) A^(n-1)
///
/// Equivalently, A*\[i\]\[j\] is the shortest-path distance from i to j
/// in the weighted digraph represented by A.
///
/// Uses Floyd-Warshall: O(n^3) time, O(n^2) space.
trop/rs/src/kleene.rs
ฯ 0.0%