Packagecom.yworks.yfiles.algo
Classpublic class Bfs
InheritanceBfs Inheritance YObject Inheritance Object

This class provides services that center around breadth first search (BFS)



Public Methods
 MethodDefined By
  
Bfs(init:Boolean = true)
Bfs
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
Bfs
  
getLayers(graph:Graph, coreNodes:NodeList):Vector.<Object>
[static] Returns layers of nodes constructed by a breadth first search.
Bfs
  
getLayers2(graph:Graph, isCoreNode:DataProvider):Vector.<Object>
[static] Like getLayers(), but this time the core nodes are identified by a boolean predicate.
Bfs
  
getLayers3(graph:Graph, isCoreNode:DataProvider, layerIDMap:NodeMap):Vector.<Object>
[static] Like getLayers2().
Bfs
  
getLayers4(graph:Graph, coreNodes:NodeList, layerIDMap:NodeMap):Vector.<Object>
[static] Like getLayers().
Bfs
  
getLayers5(graph:Graph, coreNodes:NodeList, directed:Boolean, layerIDMap:NodeMap):Vector.<Object>
[static] Returns layers of nodes constructed by a breadth first search.
Bfs
  
getLayers6(graph:Graph, coreNodes:NodeList, directed:Boolean, layerIDMap:NodeMap, maxLayers:int):Vector.<Object>
[static] Returns layers of nodes constructed by a breadth first search.
Bfs
  
getLayers7(graph:Graph, coreNodes:NodeList, direction:int, layerIDMap:NodeMap, maxLayers:int):Vector.<Object>
[static] Returns layers of nodes constructed by a breadth first search.
Bfs
 Inherited
hashCode():int
YObject
  
[static]
Bfs
Protected Methods
 MethodDefined By
  
initBfs():void
Bfs
Public Constants
 ConstantDefined By
  DIRECTION_BOTH : int = 3
[static] Edge direction specifier for both incoming and outgoing edges.
Bfs
  DIRECTION_PREDECESSOR : int = 1
[static] Edge direction specifier for incoming edges.
Bfs
  DIRECTION_SUCCESSOR : int = 2
[static] Edge direction specifier for outgoing edges.
Bfs
Constructor Detail
Bfs()Constructor
public function Bfs(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
getClass()method
override public function getClass():Class

Returns
Class
getLayers()method 
public static function getLayers(graph:Graph, coreNodes:NodeList):Vector.<Object>

Returns layers of nodes constructed by a breadth first search. The first of these layers contains all nodes within the given NodeList. These nodes are the core nodes from where an undirected breath first search to the other nodes starts.

In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer.

Complexity O(graph.N()+graph.E())

Parameters

graph:Graph
 
coreNodes:NodeList

Returns
Vector.<Object>
getLayers2()method 
public static function getLayers2(graph:Graph, isCoreNode:DataProvider):Vector.<Object>

Like getLayers(), but this time the core nodes are identified by a boolean predicate.

Precondition isCoreNode.getBool(node) defined for all nodes in graph.

Parameters

graph:Graph
 
isCoreNode:DataProvider

Returns
Vector.<Object>

See also

getLayers3()method 
public static function getLayers3(graph:Graph, isCoreNode:DataProvider, layerIDMap:NodeMap):Vector.<Object>

Like getLayers2(). Additionally the provided node map will be filled with integers that hold the layer number for each node.

Parameters

graph:Graph
 
isCoreNode:DataProvider
 
layerIDMap:NodeMap

Returns
Vector.<Object>

See also

getLayers4()method 
public static function getLayers4(graph:Graph, coreNodes:NodeList, layerIDMap:NodeMap):Vector.<Object>

Like getLayers(). Additionally the provided node map will be filled with integers that hold the layer number for each node.

Parameters

graph:Graph
 
coreNodes:NodeList
 
layerIDMap:NodeMap

Returns
Vector.<Object>

See also

getLayers5()method 
public static function getLayers5(graph:Graph, coreNodes:NodeList, directed:Boolean, layerIDMap:NodeMap):Vector.<Object>

Returns layers of nodes constructed by a breadth first search. The first of these layers contains all nodes within the given NodeList. These nodes are the core nodes from where either a directed or undirected breath first search to the other nodes starts.

In the i-th layer are previously unassigned nodes that are successors to nodes in the (i-1)-th layer.

Complexity O(graph.N()+graph.E())

Parameters

graph:Graph
 
coreNodes:NodeList
 
directed:Boolean
 
layerIDMap:NodeMap

Returns
Vector.<Object>
getLayers6()method 
public static function getLayers6(graph:Graph, coreNodes:NodeList, directed:Boolean, layerIDMap:NodeMap, maxLayers:int):Vector.<Object>

Returns layers of nodes constructed by a breadth first search. The first of these layers contains all nodes within the given NodeList. These nodes are the core nodes from where either a directed or undirected breath first search to the other nodes starts.

In the i-th layer are previously unassigned nodes that are successors to nodes in the (i-1)-th layer.

Complexity O(graph.N()+graph.E())

Parameters

graph:Graph — the graph the bfs is running on
 
coreNodes:NodeList — contains the nodes the bfs run starts from
 
directed:Boolean — true: only outgoing edges are attended, false: all edges
 
layerIDMap:NodeMap — is used to store the layer depths information in
 
maxLayers:int — number of layers that will be returned. "0" for all layers

Returns
Vector.<Object> — an array of com.yworks.yfiles.base.NodeList s representing the layers

See also

getLayers7()method 
public static function getLayers7(graph:Graph, coreNodes:NodeList, direction:int, layerIDMap:NodeMap, maxLayers:int):Vector.<Object>

Returns layers of nodes constructed by a breadth first search. The first of these layers contains all nodes within the given NodeList. These nodes are the core nodes from where either a directed or undirected breath first search to the other nodes starts.

In the i-th layer are previously unassigned nodes that are successors to nodes in the (i-1)-th layer.

Complexity O(graph.N()+graph.E())

Parameters

graph:Graph — the graph the bfs is running on
 
coreNodes:NodeList — contains the nodes the bfs run starts from
 
direction:int — specifies which edges to follow. One of
  • DIRECTION_PREDECESSOR,
  • DIRECTION_SUCCESSOR, or
  • DIRECTION_BOTH
 
layerIDMap:NodeMap — is used to store the layer depths information in
 
maxLayers:int — number of layers that will be returned. "0" for all layers

Returns
Vector.<Object> — an array of com.yworks.yfiles.base.NodeList s representing the layers

See also

initBfs()method 
protected final function initBfs():void

newBfs()method 
public static function newBfs():Bfs

Returns
Bfs
Constant Detail
DIRECTION_BOTHConstant
public static const DIRECTION_BOTH:int = 3

Edge direction specifier for both incoming and outgoing edges.

See also

DIRECTION_PREDECESSORConstant 
public static const DIRECTION_PREDECESSOR:int = 1

Edge direction specifier for incoming edges.

See also

DIRECTION_SUCCESSORConstant 
public static const DIRECTION_SUCCESSOR:int = 2

Edge direction specifier for outgoing edges.

See also