Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
rawgraph.h
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#pragma once
12
13#include <cdt.h>
14#include <stdbool.h>
15#include <stddef.h>
16
17typedef struct {
18 int color;
20 Dt_t* adj_list; /* adj_list */
21} vertex;
22
23typedef struct {
24 size_t nvs;
26} rawgraph;
27
29rawgraph *make_graph(size_t n);
30
31extern void free_graph(rawgraph*);
32
34void insert_edge(rawgraph *, size_t v1, size_t v2);
35
37void remove_redge(rawgraph *, size_t v1, size_t v2);
38
40bool edge_exists(rawgraph *, size_t v1, size_t v2);
41
42 /* topologically sorts the directed graph */
43extern void top_sort(rawgraph*);
container data types API
void remove_redge(rawgraph *, size_t v1, size_t v2)
removes any edge between v1 to v2 – irrespective of direction
Definition rawgraph.c:50
void free_graph(rawgraph *)
Definition rawgraph.c:37
rawgraph * make_graph(size_t n)
makes a graph with n vertices, 0 edges
Definition rawgraph.c:25
void insert_edge(rawgraph *, size_t v1, size_t v2)
inserts edge FROM v1 to v2
Definition rawgraph.c:45
bool edge_exists(rawgraph *, size_t v1, size_t v2)
tests if there is an edge FROM v1 TO v2
Definition rawgraph.c:57
void top_sort(rawgraph *)
Definition rawgraph.c:84
Definition cdt.h:104
size_t nvs
Definition rawgraph.h:24
vertex * vertices
Definition rawgraph.h:25
Definition legal.c:31
Dt_t * adj_list
Definition rawgraph.h:20
int topsort_order
Definition rawgraph.h:19
int color
Definition rawgraph.h:18