All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[1.2.0] — 2026-02-24
goal: V => Booleanearly-termination predicate on all traversal methods (bfs,dfs,bestFirst,bestFirstMax,traverseTree). The goal node is always recorded in the journal before traversal halts; its neighbours are never expanded. If the start node satisfies the goal, traversal stops immediately.
traverseTreeno longer requires aFrontier[F]type parameter orgiveninstances forFrontier[F]andF[V]. It now uses the sameEither-tagged stack asdfs, which also gives it native support forDfsOrder.traverseTreegainsorder: DfsOrder = DfsOrder.Preparameter, supporting both pre-order and post-order traversal.
DfsOrderenum (Pre,Post) controlling whether DFS records a node before or after processing its children.DfsOrder.Preis the default;DfsOrder.Postis useful for topological sort and dependency ordering.bestFirstMax— best-first traversal dequeuing the largest element first (backed byPrioQueue.emptyMax).- American English type aliases
Neighbors[H, V]andGraphNeighbors[V].
dfsnow uses anEither[V, V]-tagged stack internally rather than delegating totraverse, enabling pre- and post-order recording without recursion.
- Complete redesign of the library as a purely functional, typeclass-driven architecture.
- Five orthogonal typeclasses:
Evaluable[V, R],Neighbours[H, V],VisitedSet[V],Frontier[F[_]], andVisitor[V, R, J]. Frontier[F[_]]abstraction with threegiveninstances:Frontier[Queue]— breadth-first (BFS)Frontier[Stack]— depth-first (DFS)Frontier[PrioQueue]— best-first / Dijkstra-style
PrioQueue[T]backed by an immutable binary min-heap (BinaryHeap), capturingOrdering[T]at construction time.PrioQueue.empty[T]for min-priority,PrioQueue.emptyMax[T]for max-priority.JournaledVisitor— canonicalVisitorimplementation accumulating(node, Option[result])pairs into aJournal.ListJournalandQueueJournal— immutable journal implementations.traverseTreefor heterogeneous tree traversal where the root typeHdiffers from the node typeV.VisitedSet[V]with a defaultgiveninstance backed by an immutableSet, preventing node revisitation in cyclic graphs.- Scala 3 throughout:
given/using,enum, type aliases, context functions.
- Previous generation visitor classes (
BfsVisitor,DfsVisitor,DfsVisitorMapped,DfsOriginVisitor) replaced by the unifiedTraversalengine. Pre/Post/In/SelfVisitmessage dispatch pattern replaced byDfsOrderand theFrontierabstraction.MinPQ/MaxPQ/PQLikereplaced byPrioQueuebacked byBinaryHeap.
FunctionMapJournal— a journal backed by a map and a key-value computing function.
AutoCloseabletoAppendableandVisitor.
- Initial version:
BfsVisitor,DfsVisitor,Journal,Appendable,MapJournal,ListJournal,QueueJournal,NonAppendable,AppendableWriter.