Baseclasses
Definition
The class MedianHeuristic implements the two layer crossing minimization heuristic Median. It reorders the nodes on the changeable layer according to the median weight [EW86]
General Information
Algorithm | |
name | Median |
long name | Median (Eades, Wormald) |
author | P. Eades, N. Wormald |
Implementation | |
author | C. Gutwenger |
date | February 1998 |
version | 1.0 |
Pre- and Postcondition
precondition | = | ![]() |
postcondition(PRE) | = | ![]() |
#include < AGD/MedianHeuristic.h >
Creation
MedianHeuristic | M | creates an instance M of type MedianHeuristic. |
Operations
Standard Interface (Inherited Methods) The detailed description of these methods can be found in the manual entries of the base class (TwoLayerCrossMin).
bool | M.check(const leda_graph& G, const Layer& L, AgdKey& p) | |
void | M.init(const leda_graph& G, const Hierarchy& H) | |
void | M.call(const leda_graph& G, Layer& L) | |
void | M.cleanup() |
Implementation
We use a randomized quicksort for sorting the nodes on
the layer according to the median weight.
The init() function takes time
(n), and the call()
function takes expected time
(mL + nLlognL),
where n is the number of nodes in the input graph, nL
is the number of nodes on the changeable layer and mL
is the number of edges between the fixed and the changeable layer.
© Copyright 1998-2001, Algorithmic Solutions Software GmbH. All rights reserved.
2001-08-13