Packageflare.analytics.graph
Classpublic class MaxFlowMinCut
InheritanceMaxFlowMinCut Inheritance Operator

Calculates the maximum flow along edges of a graph using the Edmonds-Karp method. Each edge in the graph will be annotated with its final flow value, as well as a boolean value indicating if the edge is part of the minimum cut of the flow graph. Nodes are annotated with their partition according to the minimum cut: a partition value of 0 indicates the source-side of the cut, a value of 1 indicates the sink-side of the cut.



Public Properties
 PropertyDefined by
  edgeCapacity : Function
A function defining the edge capacities for flow.
MaxFlowMinCut
 Inheritedenabled : Boolean
Indicates if the operator is enabled or disabled.
Operator
  flowField : String
The property in which to store computed flow values.
MaxFlowMinCut
  maxFlow : Number
[read-only] The computed maximum flow value.
MaxFlowMinCut
  mincutField : String
The property in which to store minimum-cut data.
MaxFlowMinCut
 Inheritedparameters : Object
Sets parameter values for this operator.
Operator
  sink : NodeSprite
The sink node for which to compute the max flow.
MaxFlowMinCut
  source : NodeSprite
The source node for which to compute the max flow.
MaxFlowMinCut
 Inheritedvisualization : Visualization
The visualization processed by this operator.
Operator
Public Methods
 MethodDefined by
  
MaxFlowMinCut(source:NodeSprite = null, sink:NodeSprite = null, edgeCapacity:* = null)
Creates a new MaxFlowMinCut operator.
MaxFlowMinCut
 Inherited
applyParameters(op:IOperator, params:Object):void
[static] Static method that applies parameter settings to an operator.
Operator
  
calculate(data:Data, s:NodeSprite, t:NodeSprite, c:Function = null):void
Calculates the maximum flow and minimum cut for the given data
MaxFlowMinCut
  
operate(t:Transitioner = null):void
Performs an operation over the contents of a visualization.
MaxFlowMinCut
 Inherited
setup():void
Setup method invoked whenever this operator's visualization property is set.
Operator
Property detail
edgeCapacityproperty
edgeCapacity:Function  [read-write]

A function defining the edge capacities for flow. When setting this value, one can pass in either a Function, which should take an EdgeSprite as input and return a Number as output, or a String, in which case the string will be used as a property name from which to retrieve the edge capacity value from an EdgeSprite instance. If the value is null (the default) all edges will be assumed to have capacity 1.

NOTE: Capacities must be greater than or equal to zero!

Implementation
    public function get edgeCapacity():Function
    public function set edgeCapacity(value:Function):void
flowFieldproperty 
flowField:String  [read-write]

The property in which to store computed flow values. This property is used to annotate edges with the computed flow. The default value is "props.flow".

Implementation
    public function get flowField():String
    public function set flowField(value:String):void
maxFlowproperty 
maxFlow:Number  [read-only]

The computed maximum flow value. This value is zero by default and is populated once the max flow calculation is run.

Implementation
    public function get maxFlow():Number
mincutFieldproperty 
mincutField:String  [read-write]

The property in which to store minimum-cut data. The default value is "props.mincut". This property is used to annotate nodes with their partition (0 for source-side, 1 for sink-side) and to annotate edges with min-cut membership (true if part of the minimum cut, false otherwise).

Implementation
    public function get mincutField():String
    public function set mincutField(value:String):void
sinkproperty 
public var sink:NodeSprite

The sink node for which to compute the max flow.

sourceproperty 
public var source:NodeSprite

The source node for which to compute the max flow.

Constructor detail
MaxFlowMinCut()constructor
public function MaxFlowMinCut(source:NodeSprite = null, sink:NodeSprite = null, edgeCapacity:* = null)

Creates a new MaxFlowMinCut operator.

Parameters
source:NodeSprite (default = null) — the source node in the flow graph
 
sink:NodeSprite (default = null) — the sink node in the flow graph
 
edgeCapacity:* (default = null) — the edge capacity values. This can either be a Function that returns capacity values or a String providing the name of a property to look up on EdgeSprite instances.
Method detail
calculate()method
public function calculate(data:Data, s:NodeSprite, t:NodeSprite, c:Function = null):void

Calculates the maximum flow and minimum cut for the given data

Parameters
data:Data — the data set containing the flow graph
 
s:NodeSprite — the source node in the flow graph
 
t:NodeSprite — the target or "sink" node in the flow graph
 
c:Function (default = null) — a function returning capacity values for edges
operate()method 
public override function operate(t:Transitioner = null):void

Performs an operation over the contents of a visualization.

Parameters
t:Transitioner (default = null) — a Transitioner instance for collecting value updates.