#include <stdio.h>#include <stdlib.h>#include <unistd.h>Go to the source code of this file.
Data Structures | |
| struct | _graph |
Typedefs | |
| typedef int ** | _graph_t |
| typedef _graph * | graph_t |
| type of a graph. | |
| typedef unsigned int | node_t |
| type of a node. | |
Functions | |
| graph_t | graph_new (node_t n) |
| make a new undirected graph with n nodes. | |
| void | graph_clear (graph_t g) |
| destroy a graph. | |
| void | graph_set_edge (graph_t g, node_t i, node_t j) |
| add edge (i,j) to the graph. | |
| int | graph_get_edge (graph_t g, node_t i, node_t j) |
| return true if edge (i,j) exists in g. | |
| void | graph_del_edge (graph_t g, node_t i, node_t j) |
| delete edge (i,j) in g (if it exists). | |
| int | graph_flip_edge (graph_t g, node_t i, node_t j) |
| add edge (i,j) if it exists, else delete it. Return new state. | |
| void | graph_show (graph_t g, node_t n) |
| print the whole graph. | |
| node_t | graph_get_degree (graph_t g, node_t i) |
| return the degree of node i. | |
| node_t | graph_get_nedges (graph_t g) |
| return the number of edges in the graph. | |
| void | graph_write_dotfile (char *fn, graph_t g, unsigned int n) |
| write a file suitable for input to dot or neato. | |
| double | graph_timing_init (FILE *f) |
| initialize timing. | |
| double | graph_timing_end (FILE *f) |
| finalize timing. | |
|
|
A library of low-level graph functions, optimized for medium size, dense graphs. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002