Crossings Minimization  1.0
sorting.h
Go to the documentation of this file.
1 /**
2  * @file sorting.h
3  * @brief Interface for functions that perform various sorts. All sorts are
4  * stable.
5  * @author Matthias Stallmann
6  * @date 2009/01/03
7  * $Id: sorting.h 28 2011-07-18 19:52:04Z mfms $
8  */
9 
10 #ifndef SORTING_H
11 #define SORTING_H
12 
13 #include"graph.h"
14 
15 /**
16  * Sorts the nodes of the given layer by increasing weight and updates the
17  * position fields of the nodes accordingly. Uses insertion sort.
18  */
19 void layerSort( int layer );
20 
21 /**
22  * Sorts the nodes of the given layer by increasing weight and updates the
23  * position fields of the nodes accordingly. Uses Quicksort.
24  */
25 void layerQuicksort( int layer );
26 
27 /**
28  * Sorts the nodes of the given layer by increasing weight and updates the
29  * position fields of the nodes accordingly. Uses insertion sort with equal
30  * elements in reverse order.
31  */
32 void layerUnstableSort( int layer );
33 
34 /**
35  * Sorts the nodes of the given layer by increasing weight and updates the
36  * position fields of the nodes accordingly. Uses Quicksort.
37  */
38 void layerQuicksort( int layer );
39 
40 /**
41  * Sorts the array of edges by the positions of the nodes on the lower layer
42  */
43 void sortByDownNodePosition( Edgeptr * edge_array, int num_edges );
44 
45 /**
46  * Sorts the array of edges by the positions of the nodes on the upper layer
47  */
48 void sortByUpNodePosition( Edgeptr * edge_array, int num_edges );
49 
50 /**
51  * Sorts the array of nodes by increasing degree
52  */
53 void sortByDegree( Nodeptr * node_array, int num_nodes );
54 
55 /**
56  * Updates the position field of each node on the layer to reflect the current
57  * position in the nodes array.
58  */
59 void updateNodePositions( int layer );
60 
61 /**
62  * Updates position fields for all nodes
63  */
64 void updateAllPositions( void );
65 
66 #endif
67 
68 /* [Last modified: 2011 07 18 at 19:20:59 GMT] */
void sortByDegree(Nodeptr *node_array, int num_nodes)
Definition: sorting.c:215
void layerUnstableSort(int layer)
Definition: sorting.c:181
void layerQuicksort(int layer)
Definition: sorting.c:189
void layerSort(int layer)
Definition: sorting.c:159
void sortByDownNodePosition(Edgeptr *edge_array, int num_edges)
Definition: sorting.c:200
void updateNodePositions(int layer)
Definition: sorting.c:149
void sortByUpNodePosition(Edgeptr *edge_array, int num_edges)
Definition: sorting.c:209
Definition of data structures and access functions for a layered graph.
void updateAllPositions(void)
Definition: sorting.c:141