next up previous contents index
Next: Node Hierarchies ( Hierarchy Up: Graphs and Generators Previous: Leveled Graphs ( LeveledGraph   Contents   Index


Layers of Hierarchies ( Layer )

Definition

An instance L of type Layer is an ordered collection v0,..., vm - 1 of nodes with an associated node hierarchy H (see Node Hierarchies) to which L belongs.

The changeable and the fixed layer of H are called neighbored.

#include < AGD/Layer.h >

Creation

Layer L(Hierarchy& H, int i, const leda_list<leda_node>& nodes)
    creates an instance L of type Layer initialized to a layer of hierarchy H with nodes nodes.

Operations

const Hierarchy& L.hierarchy() returns a reference to the associated node hierarchy.

const Layer& L.neighbored_layer() returns a reference to the neighbored layer. Precondition: L is currently the fixed or changeable layer.

int L.length() returns the number of nodes on L.

leda_node L[int i] returns the node at position i. Precondition: 0 < = i < = m - 1.

void L.swap(int i, int j) swaps the ith and the jth nodes on L.

const leda_list<leda_node>& L.adj_nodes(leda_node v) returns a reference to the list of nodes on the neighbored layer that are adjacent to v.

const leda_list<leda_edge>& L.adj_edges(leda_node v) returns a reference to the list of edges leading to the neighbored layer that are adjacent to v.

void L.quicksort(const leda_node_array<double>& weight)
    sorts the nodes on L according to weight using a randomized quicksort. The sort is stable, i.e., if two nodes have the same weight, they keep in order of their previous positions.

void L.set_pos(const leda_node_map<int>& position)
    orders the nodes on L according to position. Precondition: {position[v] | v $ \in$ L} = {0,..., m - 1}

void L.shuffle() permutes the nodes on L randomly.


next up previous contents index
Next: Node Hierarchies ( Hierarchy Up: Graphs and Generators Previous: Leveled Graphs ( LeveledGraph   Contents   Index

© Copyright 1998-2001, Algorithmic Solutions Software GmbH. All rights reserved.
2001-08-13