1/* $Id$Revision: */
2/* vim:set shiftwidth=4 ts=8: */
3
4/*************************************************************************
5 * Copyright (c) 2011 AT&T Intellectual Property
6 * All rights reserved. This program and the accompanying materials
7 * are made available under the terms of the Eclipse Public License v1.0
8 * which accompanies this distribution, and is available at
9 * http://www.eclipse.org/legal/epl-v10.html
10 *
11 * Contributors: See CVS logs. Details at http://www.graphviz.org/
12 *************************************************************************/
13
14#ifndef RAWGRAPH_H
15#define RAWGRAPH_H
16
17#include <cdt.h>
18
19typedef struct {
20 int color;
21 int topsort_order;
22 Dt_t* adj_list; /* adj_list */
23} vertex;
24
25typedef struct {
26 int nvs;
27 vertex* vertices;
28} rawgraph;
29
30extern rawgraph* make_graph(int n); /* makes a graph with n vertices, 0 edges */
31extern void free_graph(rawgraph*);
32 /* inserts edge FROM v1 to v2 */
33extern void insert_edge(rawgraph*, int v1, int v2);
34 /* removes any edge between v1 to v2 -- irrespective of direction */
35extern void remove_redge(rawgraph*, int v1, int v2);
36 /* tests if there is an edge FROM v1 TO v2 */
37extern int edge_exists(rawgraph*, int v1, int v2);
38 /* topologically sorts the directed graph */
39extern void top_sort(rawgraph*);
40
41#endif
42