Show / Hide Table of Contents

Class EdmondsKarpMaximumFlowAlgorithm<TVertex, TEdge>

Edmond and Karp maximum flow algorithm for directed graph with positive capacities and flows.

Inheritance
System.Object
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>
MaximumFlowAlgorithm<TVertex, TEdge>
EdmondsKarpMaximumFlowAlgorithm<TVertex, TEdge>
Implements
IAlgorithm<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>
IComputation
IAlgorithmComponent
IVertexColorizerAlgorithm<TVertex>
Inherited Members
MaximumFlowAlgorithm<TVertex, TEdge>.Predecessors
MaximumFlowAlgorithm<TVertex, TEdge>.Capacities
MaximumFlowAlgorithm<TVertex, TEdge>.ResidualCapacities
MaximumFlowAlgorithm<TVertex, TEdge>.EdgeFactory
MaximumFlowAlgorithm<TVertex, TEdge>.ReversedEdges
MaximumFlowAlgorithm<TVertex, TEdge>.Source
MaximumFlowAlgorithm<TVertex, TEdge>.Sink
MaximumFlowAlgorithm<TVertex, TEdge>.MaxFlow
MaximumFlowAlgorithm<TVertex, TEdge>.VerticesColors
MaximumFlowAlgorithm<TVertex, TEdge>.GetVertexColor(TVertex)
MaximumFlowAlgorithm<TVertex, TEdge>.Compute(TVertex, TVertex)
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.SyncRoot
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.State
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.Compute()
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.Abort()
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.StateChanged
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.OnStateChanged(EventArgs)
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.Started
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.OnStarted(EventArgs)
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.Finished
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.OnFinished(EventArgs)
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.Aborted
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.OnAborted(EventArgs)
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.VisitedGraph
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.Services
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.GetService<T>()
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.TryGetService<T>(T)
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.TryGetService(Type, Object)
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.ThrowIfCancellationRequested()
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.Initialize()
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.InternalCompute()
AlgorithmBase<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.Clean()
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.MaximumFlow
Assembly: QuikGraph.dll
Syntax
public sealed class EdmondsKarpMaximumFlowAlgorithm<TVertex, TEdge> : MaximumFlowAlgorithm<TVertex, TEdge>, IAlgorithm<IMutableVertexAndEdgeListGraph<TVertex, TEdge>>, IComputation, IAlgorithmComponent, IVertexColorizerAlgorithm<TVertex> where TEdge : IEdge<TVertex>
Type Parameters
Name Description
TVertex

Vertex type.

TEdge

Edge type.

Constructors

| Improve this Doc View Source

EdmondsKarpMaximumFlowAlgorithm(IAlgorithmComponent, IMutableVertexAndEdgeListGraph<TVertex, TEdge>, Func<TEdge, Double>, EdgeFactory<TVertex, TEdge>, ReversedEdgeAugmentorAlgorithm<TVertex, TEdge>)

Initializes a new instance of the EdmondsKarpMaximumFlowAlgorithm<TVertex, TEdge> class.

Declaration
public EdmondsKarpMaximumFlowAlgorithm(IAlgorithmComponent host, IMutableVertexAndEdgeListGraph<TVertex, TEdge> visitedGraph, Func<TEdge, double> capacities, EdgeFactory<TVertex, TEdge> edgeFactory, ReversedEdgeAugmentorAlgorithm<TVertex, TEdge> reverseEdgesAugmentorAlgorithm)
Parameters
Type Name Description
IAlgorithmComponent host

Host to use if set, otherwise use this reference.

IMutableVertexAndEdgeListGraph<TVertex, TEdge> visitedGraph

Graph to visit.

System.Func<TEdge, System.Double> capacities

Function that given an edge return the capacity of this edge.

EdgeFactory<TVertex, TEdge> edgeFactory

Edge factory method.

ReversedEdgeAugmentorAlgorithm<TVertex, TEdge> reverseEdgesAugmentorAlgorithm

Algorithm that is in of charge augmenting the graph (creating missing reversed edges).

Exceptions
Type Condition
System.ArgumentNullException

visitedGraph is null.

System.ArgumentNullException

capacities is null.

System.ArgumentNullException

edgeFactory is null.

System.ArgumentNullException

reverseEdgesAugmentorAlgorithm is null.

System.ArgumentException

reverseEdgesAugmentorAlgorithm targets a graph different from visitedGraph.

| Improve this Doc View Source

EdmondsKarpMaximumFlowAlgorithm(IMutableVertexAndEdgeListGraph<TVertex, TEdge>, Func<TEdge, Double>, EdgeFactory<TVertex, TEdge>, ReversedEdgeAugmentorAlgorithm<TVertex, TEdge>)

Initializes a new instance of the EdmondsKarpMaximumFlowAlgorithm<TVertex, TEdge> class.

Declaration
public EdmondsKarpMaximumFlowAlgorithm(IMutableVertexAndEdgeListGraph<TVertex, TEdge> visitedGraph, Func<TEdge, double> capacities, EdgeFactory<TVertex, TEdge> edgeFactory, ReversedEdgeAugmentorAlgorithm<TVertex, TEdge> reverseEdgesAugmentorAlgorithm)
Parameters
Type Name Description
IMutableVertexAndEdgeListGraph<TVertex, TEdge> visitedGraph

Graph to visit.

System.Func<TEdge, System.Double> capacities

Function that given an edge return the capacity of this edge.

EdgeFactory<TVertex, TEdge> edgeFactory

Edge factory method.

ReversedEdgeAugmentorAlgorithm<TVertex, TEdge> reverseEdgesAugmentorAlgorithm

Algorithm that is in of charge of augmenting the graph (creating missing reversed edges).

Exceptions
Type Condition
System.ArgumentNullException

visitedGraph is null.

System.ArgumentNullException

capacities is null.

System.ArgumentNullException

edgeFactory is null.

System.ArgumentNullException

reverseEdgesAugmentorAlgorithm is null.

System.ArgumentException

reverseEdgesAugmentorAlgorithm targets a graph different from visitedGraph.

Methods

| Improve this Doc View Source

Initialize()

Called on algorithm initialization step.

Declaration
protected override void Initialize()
Overrides
QuikGraph.Algorithms.AlgorithmBase<QuikGraph.IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.Initialize()
| Improve this Doc View Source

InternalCompute()

Computes the maximum flow between Source and Sink.

Declaration
protected override void InternalCompute()
Overrides
QuikGraph.Algorithms.AlgorithmBase<QuikGraph.IMutableVertexAndEdgeListGraph<TVertex, TEdge>>.InternalCompute()

Implements

IAlgorithm<TGraph>
IComputation
IAlgorithmComponent
IVertexColorizerAlgorithm<TVertex>

Extension Methods

GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, XmlReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, String, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeAndValidateFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String, Action<XmlWriter, TGraph>, Action<XmlWriter, TVertex>, Action<XmlWriter, TEdge>)
  • Improve this Doc
  • View Source
In This Article
Back to top QuikGraph