DijkstraTraversal

com.phasmidsoftware.gryphon.traverse.DijkstraTraversal
case class DijkstraTraversal[V, E]()(using evidence$1: Monoid[E], evidence$2: Ordering[E]) extends WeightedTraversal[V, E, AttributedDirectedEdge[V, E]]

Dijkstra's shortest-path traversal. See Dijkstra's Algorithm.

Uses cumulative path cost as the frontier priority. Only AttributedDirectedEdge instances are admitted — the result type is TraversalResult[V, AttributedDirectedEdge[V, E]], preserving full edge information without casts.

Requires E: {Monoid, Ordering} — Monoid extends Zero so the Zero requirement of WeightedTraversal is automatically satisfied, and combine is additionally available for cumulative path cost computation.

Type parameters

E

the edge-weight type; must have Monoid and Ordering.

V

the vertex type.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
def run(graph: Traversable[V])(start: V)(using random: Random = ...): TraversalResult[V, AttributedDirectedEdge[V, E]]

Runs the traversal from start on graph, returning a TraversalResult.

Runs the traversal from start on graph, returning a TraversalResult.

Value parameters

graph

the graph to traverse.

random

controls adjacency ordering.

start

the starting vertex.

Attributes

Returns

a TraversalResult[V, R] mapping each visited vertex to its result.

Inherited from:
WeightedTraversal