com.jgraph.layout.hierarchical

Class JGraphMedianHybridCrossingReduction

public class JGraphMedianHybridCrossingReduction extends Object implements JGraphHierarchicalLayoutStep, JGraphLayout.Stoppable

Performs a vertex ordering within ranks as described by Gansner et al 1993
Nested Class Summary
protected classJGraphMedianHybridCrossingReduction.MedianCellSorter
A utility class used to track cells whilst sorting occurs on the median values.
Field Summary
protected intcurrentBestCrossings
The total number of crossings found in the best configuration so far
protected intiterationsWithoutImprovement
protected intmaxIterations
The maximum number of iterations to perform whilst reducing edge crossings
protected intmaxNoImprovementIterations
protected Object[][]nestedBestRanks
Stores each rank as a collection of cells in the best order found for each layer so far
protected JGraphLayoutProgressprogress
The layout progress bar
Method Summary
protected intcalculateRankCrossing(int i, JGraphHierarchyModel model)
Calculates the number of edges crossings between the specified rank and the rank below it
JGraphLayoutProgressgetProgress()
JGraphHierarchyModelrun(JGraphFacade facade, JGraphHierarchyModel model)
Performs a vertex ordering within ranks as described by Gansner et al 1993

Field Detail

currentBestCrossings

protected int currentBestCrossings
The total number of crossings found in the best configuration so far

iterationsWithoutImprovement

protected int iterationsWithoutImprovement

maxIterations

protected int maxIterations
The maximum number of iterations to perform whilst reducing edge crossings

maxNoImprovementIterations

protected int maxNoImprovementIterations

nestedBestRanks

protected Object[][] nestedBestRanks
Stores each rank as a collection of cells in the best order found for each layer so far

progress

protected JGraphLayoutProgress progress
The layout progress bar

Method Detail

calculateRankCrossing

protected int calculateRankCrossing(int i, JGraphHierarchyModel model)
Calculates the number of edges crossings between the specified rank and the rank below it

Parameters: i the topmost rank of the pair ( higher rank value ) model the internal hierarchy model of the graph

Returns: the number of edges crossings with the rank beneath

getProgress

public JGraphLayoutProgress getProgress()

Returns: Returns the progress.

run

public JGraphHierarchyModel run(JGraphFacade facade, JGraphHierarchyModel model)
Performs a vertex ordering within ranks as described by Gansner et al 1993

Parameters: facade the facade describing the input graph model an internal model of the hierarchical layout

Returns: the updated hierarchy model

Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.