Packagecom.yworks.yfiles.layout.planar
Classpublic class VertexOrder
InheritanceVertexOrder Inheritance YObject Inheritance Object

Computes an ordering of the vertices of an graph. The ordering is a topological ordering for the subgraph induced by the directed edges.



Public Properties
 PropertyDefined By
  allowRandomization : Boolean
[write-only] Sets if the randomized version of the algorithm is used.
VertexOrder
  graph : Graph
[write-only] Sets the graph for which the vertex order is computed.
VertexOrder
Protected Properties
 PropertyDefined By
  _allowRandomization : Boolean
VertexOrder
  candidateList : ArrayList
VertexOrder
  degree : Vector.<int>
VertexOrder
  _graph : Graph
VertexOrder
  graphNodes : ArrayList
VertexOrder
  neighbors : ArrayList
VertexOrder
  random : YRandom
VertexOrder
  seed : LongImpl
VertexOrder
  selected : Vector.<Boolean>
VertexOrder
Public Methods
 MethodDefined By
  
VertexOrder(init:Boolean = true)
VertexOrder
  
This method orders the vertices to place them on a line.
VertexOrder
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
VertexOrder
 Inherited
hashCode():int
YObject
  
[static]
VertexOrder
  
selectNode(graphNodes:ArrayList, candidateList:ArrayList, neighbors:ArrayList, result:NodeList):void
Selects a node form the candidate list and updates the data structures accordingly.
VertexOrder
Protected Methods
 MethodDefined By
  
Returns from a list of nodes the list of nodes with minimal degree and with indegree zero of directed edges.
VertexOrder
  
This method calculates the potential of each node to cause a direction error.
VertexOrder
  
VertexOrder
  
selects a Node from a list of nodes.
VertexOrder
Property Detail
_allowRandomizationproperty
protected var _allowRandomization:Boolean

_graphproperty 
protected var _graph:Graph

allowRandomizationproperty 
allowRandomization:Boolean  [write-only]

Sets if the randomized version of the algorithm is used.


Implementation
    public function set allowRandomization(value:Boolean):void
candidateListproperty 
protected var candidateList:ArrayList

degreeproperty 
protected var degree:Vector.<int>

graphproperty 
graph:Graph  [write-only]

Sets the graph for which the vertex order is computed.


Implementation
    public function set graph(value:Graph):void
graphNodesproperty 
protected var graphNodes:ArrayList

neighborsproperty 
protected var neighbors:ArrayList

randomproperty 
protected var random:YRandom

seedproperty 
protected var seed:LongImpl

selectedproperty 
protected var selected:Vector.<Boolean>

Constructor Detail
VertexOrder()Constructor
public function VertexOrder(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
computeVertexOrder()method
public function computeVertexOrder(result:NodeList):void

This method orders the vertices to place them on a line. It implements the first phase of the Goldschmidt-Takvorian heuristic

Parameters

result:NodeList

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

Returns
Class
getMinDegreeNodes()method 
protected function getMinDegreeNodes(nodes:ArrayList, result:ArrayList):void

Returns from a list of nodes the list of nodes with minimal degree and with indegree zero of directed edges.

Parameters

nodes:ArrayList — the input list
 
result:ArrayList — result of the computation

initDegrees()method 
protected function initDegrees():void

This method calculates the potential of each node to cause a direction error. When selected by vertex order, the potential must be zero or upward planarity cannot be reached. Undirected edges' potential is set to zero by default, because they never cause any trouble in that belongings.

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

newVertexOrder()method 
public static function newVertexOrder():VertexOrder

Returns
VertexOrder
randomSelectNode()method 
protected function randomSelectNode(_nl:ArrayList):Node

selects a Node from a list of nodes.

Parameters

_nl:ArrayList — a list of instance of Node.

Returns
Node — an arbitrary Node contained in _nl.
selectNode()method 
public function selectNode(graphNodes:ArrayList, candidateList:ArrayList, neighbors:ArrayList, result:NodeList):void

Selects a node form the candidate list and updates the data structures accordingly.

Parameters

graphNodes:ArrayList — the list of unselected nodes.
 
candidateList:ArrayList — list of nodes from which the the node is selected. Sublist of graphNodes.
 
neighbors:ArrayList — the neighbors of the selected node, which are in graphNodes are stored here.
 
result:NodeList — the list of selected nodes. The node selected by this method will be appended to this list.