Packagecom.yworks.yfiles.algo
Classpublic class Bipartitions
InheritanceBipartitions Inheritance YObject Inheritance Object

Responsible for graph bipartition problems.

A bipartite graph is a graph whose node set can be partitioned into two sets in such a way that all edges in the graph connect nodes that belong to different partitions. In other words, there are no edges connecting nodes that belong to the same partition.



Public Methods
 MethodDefined By
  
Bipartitions(init:Boolean = true)
Bipartitions
 Inherited
equals(o:Object):Boolean
YObject
  
getBipartition(graph:Graph, markMap:NodeMap):Boolean
[static] Calculates a bipartition of the given graph if one exists.
Bipartitions
  
getClass():Class
[override]
Bipartitions
 Inherited
hashCode():int
YObject
  
isBipartite(graph:Graph):Boolean
[static] Tests whether or not the given graph is bipartite.
Bipartitions
  
[static]
Bipartitions
Protected Methods
 MethodDefined By
  
Bipartitions
Public Constants
 ConstantDefined By
  BLUE : Object = BLUE
[static] Marker for a node that belongs to the blue partition
Bipartitions
  RED : Object = RED
[static] Marker for a node that belongs to the red partition
Bipartitions
Constructor Detail
Bipartitions()Constructor
public function Bipartitions(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
getBipartition()method
public static function getBipartition(graph:Graph, markMap:NodeMap):Boolean

Calculates a bipartition of the given graph if one exists.

If the graph is bipartite then for all nodes of the given graph either RED or BLUE objects will put in the given node map, depending on the partition the node belongs to.

Complexity O(nodeCount()+edgeCount())

Parameters

graph:Graph
 
markMap:NodeMap

Returns
BooleanisBipartite(graph)

See also

getClass()method 
override public function getClass():Class

Returns
Class
initBipartitions()method 
protected final function initBipartitions():void

isBipartite()method 
public static function isBipartite(graph:Graph):Boolean

Tests whether or not the given graph is bipartite.

Complexity O(nodeCount()+edgeCount())

Parameters

graph:Graph

Returns
Boolean
newBipartitions()method 
public static function newBipartitions():Bipartitions

Returns
Bipartitions
Constant Detail
BLUEConstant
public static const BLUE:Object = BLUE

Marker for a node that belongs to the blue partition

REDConstant 
public static const RED:Object = RED

Marker for a node that belongs to the red partition