bipartitegraph

package
v1.36.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 5 Imported by: 367

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BipartiteGraph

type BipartiteGraph struct {
	Left  NodeOrderedSet
	Right NodeOrderedSet
	Edges EdgeSet
}

func NewBipartiteGraph

func NewBipartiteGraph(leftValues, rightValues []interface{}, neighbours func(interface{}, interface{}) (bool, error)) (*BipartiteGraph, error)

func (*BipartiteGraph) FreeLeftRight added in v1.9.0

func (bg *BipartiteGraph) FreeLeftRight(edges EdgeSet) (leftValues, rightValues []interface{})

FreeLeftRight returns left node values and right node values of the BipartiteGraph's nodes which are not part of the given edges.

func (*BipartiteGraph) LargestMatching

func (bg *BipartiteGraph) LargestMatching() (matching EdgeSet)

LargestMatching implements the Hopcroft–Karp algorithm taking as input a bipartite graph and outputting a maximum cardinality matching, i.e. a set of as many edges as possible with the property that no two edges share an endpoint.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL