Computes an ordering of the vertices of an graph.
The ordering is a topological ordering for the subgraph induced by the directed edges.
protected var _allowRandomization:Boolean
protected var _graph:Graph
allowRandomization:Boolean
[write-only]
Sets if the randomized version of the algorithm is used.
Implementation public function set allowRandomization(value:Boolean):void
protected var candidateList:ArrayList
protected var degree:Vector.<int>
graph:Graph
[write-only]
Sets the graph for which the vertex order is computed.
Implementation public function set graph(value:Graph):void
protected var graphNodes:ArrayList
protected var neighbors:ArrayList
protected var random:YRandom
protected var seed:LongImpl
protected var selected:Vector.<Boolean>
public function VertexOrder(init:Boolean = true)
Parameters | init:Boolean (default = true )
|
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
override public function getClass():Class
Returns 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
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.
protected final function initVertexOrder():void
public static function newVertexOrder():VertexOrder
Returns protected function randomSelectNode(_nl:ArrayList):Node
selects a Node
from a list of nodes.
Parameters
Returns | Node — an arbitrary Node contained in _nl .
|
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.
|
Wed Oct 7 2015, 04:43 PM +02:00