HopcroftKarp

org.appliedtopology.tda4j.HopcroftKarp
object HopcroftKarp

Maximum-cardinality bipartite matching (Hopcroft-Karp). Used by BarcodeDistance.bottleneckDistance as the feasibility check inside a binary search over candidate distances: "does a perfect matching exist using only edges of cost <= threshold".

Attributes

Experimental
true
Source
BipartiteMatching.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def maximumMatching(nLeft: Int, nRight: Int, adjacency: Int => Seq[Int]): Array[Int]

nLeft/nRight left/right vertices, numbered 0 until nLeft/0 until nRight. adjacency(u) lists u's right-neighbours. Returns matchLeft where matchLeft(u) is u's matched right-vertex, or -1 if u is unmatched.

nLeft/nRight left/right vertices, numbered 0 until nLeft/0 until nRight. adjacency(u) lists u's right-neighbours. Returns matchLeft where matchLeft(u) is u's matched right-vertex, or -1 if u is unmatched.

Attributes

Source
BipartiteMatching.scala