PrimTraversal
com.phasmidsoftware.gryphon.traverse.PrimTraversal
case class PrimTraversal[V, E]()(using evidence$1: Zero[E], evidence$2: Ordering[E]) extends WeightedTraversal[V, E, Edge[V, E]]
Prim's minimum spanning tree traversal. See Prim's Algorithm.
Uses individual edge weight (not cumulative) as the frontier priority, so the cheapest available edge to any unvisited vertex is always chosen next. All edge types are admitted — the result type is TraversalResult[V, Edge[V, E]].
Requires only E: {Zero, Ordering} — Prim never accumulates path costs so Monoid.combine is not needed. Zero.identity seeds the initial frontier cost for the start vertex, which is immediately replaced by actual edge weights.
Type parameters
- E
-
the edge-weight type; must have Zero and Ordering.
- V
-
the vertex type.
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Members list
In this article