Click or drag to resize
FlowEdge Class
The FlowEdge class represents a capacitated edge with a flow in a . Each edge consists of two integers (naming the two vertices), a real-valued capacity, and a real-valued flow. The data type provides methods for accessing the two endpoints of the directed edge and the weight. It also provides methods for changing the amount of flow on the edge and determining the residual capacity of the edge.
Inheritance Hierarchy
SystemObject
  Algs4NetFlowEdge

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class FlowEdge

The FlowEdge type exposes the following members.

Constructors
  NameDescription
Public methodFlowEdge(FlowEdge)
Initializes a flow edge from another flow edge.
Public methodFlowEdge(Int32, Int32, Double)
Initializes an edge from vertex v to vertex w with the given capacity and zero flow.
Public methodFlowEdge(Int32, Int32, Double, Double)
Initializes an edge from vertex v to vertex w with the given capacity and flow.
Top
Properties
  NameDescription
Public propertyCapacity
Returns the capacity of the edge.
Public propertyFlow
Returns the flow on the edge.
Public propertyFrom
Returns the tail vertex of the edge.
Public propertyTo
Returns the head vertex of the edge.
Top
Methods
  NameDescription
Public methodAddResidualFlowTo
Increases the flow on the edge in the direction to the given vertex. If vertex is the tail vertex, this increases the flow on the edge by delta; if vertex is the head vertex, this decreases the flow on the edge by delta.
Public methodStatic memberMainTest
Demo test the FlowEdge data type.
Public methodOther
Returns the endpoint of the edge that is different from the given vertex (unless the edge represents a self-loop in which case it returns the same vertex).
Public methodResidualCapacityTo
Returns the residual capacity of the edge in the direction to the given vertex.
Public methodToString
Returns a string representation of the edge.
(Overrides ObjectToString.)
Top
Remarks

For additional documentation, see Section 6.4 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

This class is a C# port from the original Java class FlowEdge implementation by the respective authors.

See Also