Kruskal

org.appliedtopology.tda4j.streams.Kruskal
See theKruskal companion object
class Kruskal[T](elements: Seq[T], distance: (T, T) => Double, maxDistance: Double = ...)(using orderingT: Ordering[T])

This implementation of Kruskal's algorithm will return two iterators of vertex pairs: the first iterator is a Minimal Spanning Tree in increasing weight order, while the second iterator gives all the non-included

Attributes

Companion
object
Experimental
true
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def cycleToChain[CoefficientT](edge: (T, T)): Chain[Simplex[T], CoefficientT]

The fundamental cycle of a non-tree edge (s, t) (as returned by cyclesIterator): the edge itself plus the tree path connecting its endpoints, oriented so boundary(cycleToChain(edge)) = 0. s/t are guaranteed to lie in the same component: lrList's own partitionMap only routes an edge to cyclesIterator once find has confirmed its endpoints already share a root.

The fundamental cycle of a non-tree edge (s, t) (as returned by cyclesIterator): the edge itself plus the tree path connecting its endpoints, oriented so boundary(cycleToChain(edge)) = 0. s/t are guaranteed to lie in the same component: lrList's own partitionMap only routes an edge to cyclesIterator once find has confirmed its endpoints already share a root.

Attributes

def cyclesIterator: Iterator[(T, T)]
def mstIterator: Iterator[(T, T)]

Concrete fields

val lrList: (List[(T, T)], List[(T, T)])
val sortedEdges: List[(Double, unionFind.UFSet, unionFind.UFSet)]