Class ShortestPathResult<V,W>

java.lang.Object
org.episteme.core.mathematics.discrete.ShortestPathResult<V,W>

public class ShortestPathResult<V,W> extends Object
Result of a shortest path computation.
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Details

    • withPath

      public static <V,W> ShortestPathResult<V,W> withPath(V source, V target, W distance, List<V> path)
      Creates a successful path result.
    • noPath

      public static <V,W> ShortestPathResult<V,W> noPath(V source, V target)
      Creates a no-path result (unreachable).
    • negativeCycle

      public static <V,W> ShortestPathResult<V,W> negativeCycle(V source, V target)
      Creates a negative cycle result.
    • getSource

      public V getSource()
    • getTarget

      public V getTarget()
    • getDistance

      public Optional<W> getDistance()
    • getPath

      public Optional<List<V>> getPath()
    • hasPath

      public boolean hasPath()
    • hasNegativeCycle

      public boolean hasNegativeCycle()
    • toString

      public String toString()
      Overrides:
      toString in class Object