Class KernighanLinAlgorithm<TVertex, TEdge>
Algorithm that separate a graph into two disjoint subsets A and B of equal (or nearly equal) in size, in a way that minimizes the sum of the weights of the subset of edges that cross from A to B.
Inheritance
System.Object
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>
KernighanLinAlgorithm<TVertex, TEdge>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: QuikGraph.Algorithms.GraphPartition
Assembly: QuikGraph.dll
Syntax
public sealed class KernighanLinAlgorithm<TVertex, TEdge> : AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>, IAlgorithm<IUndirectedGraph<TVertex, TEdge>>, IComputation, IAlgorithmComponent where TEdge : IUndirectedEdge<TVertex>, ITagged<double>
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Constructors
| Improve this Doc View SourceKernighanLinAlgorithm(IUndirectedGraph<TVertex, TEdge>, Int32)
Initializes a new instance of the KernighanLinAlgorithm<TVertex, TEdge> class.
Declaration
public KernighanLinAlgorithm(IUndirectedGraph<TVertex, TEdge> visitedGraph, int nbIterations)
Parameters
Type | Name | Description |
---|---|---|
IUndirectedGraph<TVertex, TEdge> | visitedGraph | Graph to visit. |
System.Int32 | nbIterations | Number of iterations to perform. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
Properties
| Improve this Doc View SourcePartition
Partition created by the algorithm.
Declaration
public Partition<TVertex> Partition { get; }
Property Value
Type | Description |
---|---|
Partition<TVertex> |
Methods
| Improve this Doc View SourceInternalCompute()
Algorithm compute step.
Declaration
protected override void InternalCompute()
Overrides
QuikGraph.Algorithms.AlgorithmBase<QuikGraph.IUndirectedGraph<TVertex, TEdge>>.InternalCompute()