Crossings Minimization  1.0
priority_edges.c File Reference

Implementation of unctions for setting up priority edges and retrieving the number of crossings involving them. More...

#include "graph.h"
#include "defs.h"
#include "crossings.h"
#include "heuristics.h"
#include "priority_edges.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
Include dependency graph for priority_edges.c:

Go to the source code of this file.

Functions

void initPriorityEdges (void)
 
void freePriorityEdges (void)
 
void addToPriorityEdges (Edgeptr edge)
 
int numberOfFavoredEdges (void)
 
const EdgeptrfavoredEdges (void)
 
int priorityEdgeCrossings (void)
 
static void upDFS (Nodeptr node)
 Adds edges along all paths going upward from the node to the priority list. More...
 
static void downDFS (Nodeptr node)
 Adds edges along all paths going downward from the node to the priority list. More...
 
void createFanoutList (Nodeptr node)
 Takes all the edges that are accessible via a path from the node and adds them to the priority list. More...
 
void createFavoredEdgeInfo (char *file_name_buffer, char *graph_name_buffer, char *comment_buffer)
 

Variables

static Edgeptrpriority_edge_list
 
static int number_of_priority_edges
 
static int priority_edge_list_capacity
 

Detailed Description

Implementation of unctions for setting up priority edges and retrieving the number of crossings involving them.

Author
Matthias Stallmann
Date
April, 2011
Id
priority_edges.c 2 2011-06-07 19:50:41Z mfms

Definition in file priority_edges.c.

Function Documentation

◆ addToPriorityEdges()

void addToPriorityEdges ( Edgeptr  edge)
Parameters
edgethe edge to be added to the list of priority edges

Definition at line 41 of file priority_edges.c.

References CAPACITY_INCREMENT, number_of_priority_edges, and priority_edge_list_capacity.

Referenced by downDFS(), and upDFS().

◆ createFanoutList()

void createFanoutList ( Nodeptr  node)

Takes all the edges that are accessible via a path from the node and adds them to the priority list.

Definition at line 104 of file priority_edges.c.

References clearFixedNodes(), downDFS(), and upDFS().

Referenced by main().

Here is the call graph for this function:

◆ createFavoredEdgeInfo()

void createFavoredEdgeInfo ( char *  file_name_buffer,
char *  graph_name_buffer,
char *  comment_buffer 
)
Parameters
file_name_bufferstorage for the file name for the favored edges
graph_name_bufferstorage for the graph name for the favored edges
commentsin the favored edge file, if any
Todo:
put more information into the graph name and/or comments; also, most graph names have characters such as - and + in them; these must be converted to _'s

Definition at line 112 of file priority_edges.c.

References createDotFileName(), and graph_name.

Referenced by main().

Here is the call graph for this function:

◆ downDFS()

static void downDFS ( Nodeptr  node)
static

Adds edges along all paths going downward from the node to the priority list.

Definition at line 89 of file priority_edges.c.

References addToPriorityEdges(), node_struct::down_degree, node_struct::down_edges, edge_struct::down_node, and node_struct::fixed.

Referenced by createFanoutList().

Here is the call graph for this function:

◆ favoredEdges()

const Edgeptr* favoredEdges ( void  )
Returns
(a pointer to) the array of favored edges

Definition at line 56 of file priority_edges.c.

References priority_edge_list.

Referenced by main().

◆ freePriorityEdges()

void freePriorityEdges ( void  )

deallocates priority edge list

Definition at line 34 of file priority_edges.c.

References number_of_priority_edges.

◆ initPriorityEdges()

void initPriorityEdges ( void  )

Initializes list of priority edges

Definition at line 27 of file priority_edges.c.

References CAPACITY_INCREMENT, number_of_priority_edges, and priority_edge_list_capacity.

Referenced by main().

◆ numberOfFavoredEdges()

int numberOfFavoredEdges ( void  )
Returns
the number of priority (favored) edges

Definition at line 51 of file priority_edges.c.

References number_of_priority_edges.

Referenced by main().

◆ priorityEdgeCrossings()

int priorityEdgeCrossings ( void  )
Returns
the number of crossings involving priority edges

Definition at line 61 of file priority_edges.c.

References number_of_priority_edges, and total_crossings.

Referenced by capture_beginning_stats(), capture_preprocessing_stats(), and update_best_all().

◆ upDFS()

static void upDFS ( Nodeptr  node)
static

Adds edges along all paths going upward from the node to the priority list.

Definition at line 73 of file priority_edges.c.

References addToPriorityEdges(), node_struct::fixed, node_struct::up_degree, node_struct::up_edges, and edge_struct::up_node.

Referenced by createFanoutList().

Here is the call graph for this function:

Variable Documentation

◆ number_of_priority_edges

int number_of_priority_edges
static

◆ priority_edge_list

Edgeptr* priority_edge_list
static

Definition at line 23 of file priority_edges.c.

Referenced by favoredEdges().

◆ priority_edge_list_capacity

int priority_edge_list_capacity
static

Definition at line 25 of file priority_edges.c.

Referenced by addToPriorityEdges(), and initPriorityEdges().