| 
 | Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.planar.VertexOrder
public class VertexOrder
Computes an ordering of the vertices of an graph. The ordering is a topological ordering for the subgraph induced by the directed edges.
| Field Summary | |
|---|---|
| protected  boolean | allowRandomization | 
| protected  java.util.ArrayList | candidateList | 
| protected  int[] | degree | 
| protected  Graph | graph | 
| protected  java.util.ArrayList | graphNodes | 
| protected  java.util.ArrayList | neighbors | 
| protected  YRandom | random | 
| protected  long | seed | 
| protected  boolean[] | selected | 
| Constructor Summary | |
|---|---|
| VertexOrder() | |
| Method Summary | |
|---|---|
|  void | computeVertexOrder(NodeList result)This method orders the vertices to place them on a line. | 
| protected  void | getMinDegreeNodes(java.util.ArrayList nodes,
                  java.util.ArrayList result)Returns from a list of nodes the list of nodes with minimal degree and with indegree zero of directed edges. | 
| protected  void | initDegrees()This method calculates the potential of each node to cause a direction error. | 
| protected  Node | randomSelectNode(java.util.ArrayList _nl)selects a Nodefrom a list of nodes. | 
|  void | selectNode(java.util.ArrayList graphNodes,
           java.util.ArrayList candidateList,
           java.util.ArrayList neighbors,
           NodeList result)Selects a node form the candidate list and updates the data structures accordingly. | 
|  void | setAllowRandomization(boolean allowRandomization)Sets if the randomized version of the algorithm is used. | 
|  void | setGraph(Graph graph)Sets the graph for which the vertex order is computed. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected Graph graph
protected boolean allowRandomization
protected int[] degree
protected boolean[] selected
protected java.util.ArrayList graphNodes
protected java.util.ArrayList neighbors
protected java.util.ArrayList candidateList
protected YRandom random
protected long seed
| Constructor Detail | 
|---|
public VertexOrder()
| Method Detail | 
|---|
public void setGraph(Graph graph)
graph - an instance of graph.public void setAllowRandomization(boolean allowRandomization)
public void computeVertexOrder(NodeList result)
protected void initDegrees()
protected void getMinDegreeNodes(java.util.ArrayList nodes,
                                 java.util.ArrayList result)
nodes - the input listresult - result of the computation
public void selectNode(java.util.ArrayList graphNodes,
                       java.util.ArrayList candidateList,
                       java.util.ArrayList neighbors,
                       NodeList result)
graphNodes - the list of unselected nodes.candidateList - list of nodes from which the the node is selected.
                      Sublist of graphNodes.neighbors - the neighbors of the selected node, which are in
                   graphNodes are stored here.result - the list of selected nodes. The node selected by this
                   method will be appended to this list.protected Node randomSelectNode(java.util.ArrayList _nl)
Node from a list of nodes.
_nl - a list of instance of Node.
Node contained in _nl.| 
 | © Copyright 2000-2025, yWorks GmbH. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||