Table of Contents

Interface IMinimumSpanningTreeAlgorithm<TVertex, TEdge, TWeight>

Namespace
Graph1x.Algorithms
Assembly
Graph1x.dll

A minimum-spanning-tree strategy for undirected graphs. On disconnected graphs implementations return a minimum spanning forest (one tree per connected component). Kruskal and Prim are interchangeable behind this interface.

public interface IMinimumSpanningTreeAlgorithm<TVertex, TEdge, TWeight> where TVertex : notnull where TEdge : IEdge<TVertex> where TWeight : INumber<TWeight>

Type Parameters

TVertex

The vertex type.

TEdge

The edge type.

TWeight

The numeric weight type.

Methods

FindMinimumSpanningForest(IReadOnlyGraph<TVertex, TEdge>)

Computes a minimum spanning forest of the graph.

IReadOnlyList<TEdge> FindMinimumSpanningForest(IReadOnlyGraph<TVertex, TEdge> graph)

Parameters

graph IReadOnlyGraph<TVertex, TEdge>

The undirected graph to span.

Returns

IReadOnlyList<TEdge>

The chosen edges: |V| - #components of them, total weight minimal.

Exceptions

ArgumentException

graph is directed.