142 unsigned int m_storedCrossings;
178 int pos(
node v)
const override {
return m_pos[v]; }
181 int size()
const override {
return m_levels.
size(); }
187 if (dir == TraversingDir::upward) {
188 return m_upperAdjNodes[v];
190 return m_lowerAdjNodes[v];
277 buildDummyNodesLists();
280 m_storedCrossings = calculateCrossings();
Declaration of interfaces used in Sugiyama framework.
Declaration and implementation of EdgeArray class.
Includes declaration of graph class.
Declaration of graph copy classes.
Declaration and implementation of NodeArray class.
The parameterized class Array implements dynamic arrays of type E.
INDEX high() const
Returns the maximal array index.
INDEX size() const
Returns the size (number of elements) of the array.
The simple implementation of LevelBase interface.
node & operator[](int i) override
Returns the node at position i.
const node & operator[](int i) const override
Returns the node at position i.
ArrayLevel(const Array< node > &nodes)
int high() const override
Returns the maximal array index (= size()-1).
ArrayLevel(unsigned int size)
int size() const override
Returns the number of nodes on this level.
Class representing idea of Blocks used in GlobalSifting and GridSifting algorithms.
Block(edge e)
Creates new edge block for an edge e.
Array< node > m_nodes
Vertices from the proper hierarchy corresponding to this block.
Array< int > m_NeighboursOutgoing
Indices of neighbouring outgoing blocks.
Array< int > m_InvertedOutgoing
Positions of this block in m_NeighboursIncoming of neighbours.
Array< int > m_NeighboursIncoming
Indices of neighbouring incoming blocks.
Array< int > m_InvertedIncoming
Positions of this block in m_NeighboursOutgoing of neighbours.
Block(node v)
Creates new vertex block for a node v.
Hierarchical graph representation used by GlobalSifting and GridSifting algorithms.
int m_bestCrossings
The lowest number of crossing found in the sifting step.
void buildLevels()
Builds levels of vertices from original graph.
int localCountCrossings(const Array< int > &levels)
Only used in verticalSwap().
Array< ArrayLevel * > m_levels
The array of all levels.
NodeArray< int > m_pos
The position of a node on its level.
NodeArray< Block * > m_NodeBlocks
The array of all vertex blocks.
const Hierarchy & hierarchy() const override
void globalSifting(int rho=1, int nRepeats=10, int *pNumCrossings=nullptr)
Calls the global sifting algorithm on graph (its hierarchy).
void doInit(bool longEdgesOnly=true)
Does some initialization.
Array< Block * > m_Blocks
The array of all blocks.
int pos(node v) const override
Returns the position of node v on its level.
void buildDummyNodesLists()
Builds list of dummy nodes laying inside edge blocks.
BlockOrder(Hierarchy &hierarchy, bool longEdgesOnly=true)
Hierarchy & m_hierarchy
The hierarchy on grid- and globalsifting operates.
const Array< node > & adjNodes(node v, TraversingDir dir) const override
Returns the adjacent nodes of v.
void verticalStep(Block *b)
Performs vertical step for block b.
Array< int > m_nNodesOnLvls
EdgeArray< Block * > m_EdgeBlocks
The array of all edge blocks.
const ArrayLevel & operator[](int i) const override
Returns the i-th level.
NodeArray< int > m_ranks
The rank (level) of a node.
Array< int > m_storedPerm
The permutation from which the sifting step starts.
EdgeArray< bool > m_isActiveEdge
Stores information about active edge blocks.
Array< int > m_bestPerm
The best found permutation in the sifting step.
void buildAdjNodes()
Builds lists of adjacent nodes (needed by HierarchyLevelsBase).
void deconstruct()
Deletes levels and blocks owned by this instance of BlockOrder.
void buildHierarchy()
Builds arrays that allow using BlockOrder as HierarchyLevelsBase implementation.
NodeArray< Array< node > > m_upperAdjNodes
(Sorted) adjacent nodes on upper level.
int uswap(Block *blockOfA, Block *blockOfB, Direction d, int level)
Calculates change of crossings made by a single swap.
int m_storedCrossings
Numebr of crossings stored in the sifting step.
NodeArray< int > m_nSet
(Only used by buildAdjNodes().)
int siftingSwap(Block *blockOfA, Block *blockOfB)
Swaps two consecutive blocks.
void updateAdjacencies(Block *blockOfA, Block *blockOfB, Direction d)
Updates adjacencies lists before swaping two blocks.
NodeArray< Array< node > > m_lowerAdjNodes
(Sorted) adjacent nodes on lower level.
int size() const override
Returns the number of levels.
int verticalSwap(Block *b, int level)
Moves block to next level.
GraphCopy m_GC
The graph copy representing the topology of the proper hierarchy.
int siftingStep(Block *blockOfA)
Performs sifting for a single block.
void gridSifting(int nRepeats=10)
Calls the grid sifting algorithm on a graph (its hierarchy).
int blocksCount()
Returns the number of blocks.
Array< int > m_currentPerm
The permutation modified in the sifting step.
Array< int > m_currentPermInv
Inversion of m_currenPerm.
void sortAdjacencies()
Creates sorted lists of neighbours for all blocks.
Dynamic arrays indexed with edges.
Class for the representation of edges.
Copies of graphs supporting edge splitting.
Data type for general directed graphs (adjacency list representation).
Representation of proper hierarchies used by Sugiyama-layout.
Representation of levels in hierarchies.
Dynamic arrays indexed with nodes.
Class for the representation of nodes.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.