advent-0.1.0.0: Advent of Code common library
Copyright(c) Eric Mertens 2023
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Advent.MinCut

Description

Karger-Stein approximation of the minimum cut of a graph.

Synopsis

Documentation

minCutApprox :: (RandomGen gen, Semigroup node) => Gr node edge -> gen -> [Gr node edge] Source #

Generate a lazy list of minimun cut approximations. The nodes of the resulting graph will represent the merged components and the remaining edges are the cut.

The graph is treated as undirected and with uniform edge weight.