Search this API

y.algo
Class Sorting

java.lang.Object
  extended by y.algo.Sorting

public final class Sorting
extends java.lang.Object

This class provides methods for efficiently sorting graph elements in graph structures.

 
Your browser does not support SVG content.

Method Summary
static Node[] sortNodesByDegree(Graph graph)
          Sorts the nodes of a given graph by degree in ascending order.
static Node[] sortNodesByIntKey(Graph graph, DataProvider keys)
          Sorts the nodes of a given graph by an integer key associated with each node through a DataProvider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

sortNodesByDegree

public static Node[] sortNodesByDegree(Graph graph)
Sorts the nodes of a given graph by degree in ascending order.

Parameters:
graph - the given graph
Returns:
an array of Nodes sorted by degree in ascending order

sortNodesByIntKey

public static Node[] sortNodesByIntKey(Graph graph,
                                       DataProvider keys)
Sorts the nodes of a given graph by an integer key associated with each node through a DataProvider.

The nodes are sorted in ascending order.

Parameters:
graph - the given graph
keys - the DataProvider that returns the keys based on which the nodes will be sorted
Returns:
an array of Nodes sorted by an integer key in ascending order

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.