Crossings Minimization  1.0
graph_io.h
Go to the documentation of this file.
1 /**
2  * @file graph_io.h
3  * @brief Definition of functions for reading and writing graphs.
4  * @author Matt Stallmann, based on Saurabh Gupta's crossing heuristics
5  * implementation.
6  * @date 2008/12/19
7  * $Id: graph_io.h 90 2014-08-13 20:31:25Z mfms $
8  */
9 
10 #include<stdbool.h>
11 
12 #ifndef GRAPH_IO_H
13 #define GRAPH_IO_H
14 
15 #include"graph.h"
16 
17 /**
18  * Reads the graph from the given files, specified by their names. Each file
19  * is read twice so that arrays can be allocated to the correct size on the
20  * first pass. Also initializes all graph-related data structures and global
21  * variables.
22  */
23 void readGraph( const char * dot_file, const char * ord_file );
24 
25 /**
26  * Prints the graph in a verbose format on standard output for debugging
27  * purposes. May also be used for piping to a graphical trace later.
28  */
29 void printGraph();
30 
31 /**
32  * Writes the current layer orderings to an ord file with the given name.
33  */
34 void writeOrd( const char * ord_file );
35 
36 /**
37  * Writes a dot file with the given name.
38  * @param dot_file_name the output file name (including .dot extension)
39  * @param header_information what will go into the file before the '{' that
40  * starts the list of edges (including the graph name)
41  * @param edge_list array of (indices of) the edges to be written
42  * @param edge_list_length length of the edge list
43  */
44 void writeDot( const char * dot_file_name,
45  const char * graph_name,
46  const char * header_information,
47  const Edgeptr * edge_list,
48  int edge_list_length
49  );
50 
51 /**
52  * Renumbers nodes, i.e., assigns id's, based on their order of appearance in
53  * a dot file. This is useful if converting to sgf format -- see
54  * dot_and_ord_to_sgf.c; the node number will not depend on the order in the
55  * ord file and different orderings will have the same node numbers so that
56  * they can be compared.
57  */
58 void renumberNodesUsingDotFile( const char * dot_file );
59 
60 #endif
61 
62 /* [Last modified: 2016 02 16 at 20:06:09 GMT] */
void writeDot(const char *dot_file_name, const char *graph_name, const char *header_information, const Edgeptr *edge_list, int edge_list_length)
void writeOrd(const char *ord_file)
Definition: graph_io.c:405
void readGraph(const char *dot_file, const char *ord_file)
Definition: graph_io.c:363
Definition of data structures and access functions for a layered graph.
static char graph_name[MAX_NAME_LENGTH]
Definition: dot.c:42
void printGraph()
Definition: graph_io.c:486
void renumberNodesUsingDotFile(const char *dot_file)