Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
rawgraph.c File Reference
#include <cgraph/list.h>
#include <ortho/rawgraph.h>
#include <stdbool.h>
#include <stddef.h>
#include <util/alloc.h>
Include dependency graph for rawgraph.c:

Go to the source code of this file.

Macros

#define UNSCANNED   0
 
#define SCANNING   1
 
#define SCANNED   2
 

Functions

rawgraphmake_graph (size_t n)
 makes a graph with n vertices, 0 edges
 
void free_graph (rawgraph *g)
 
void insert_edge (rawgraph *g, size_t v1, size_t v2)
 inserts edge FROM v1 to v2
 
void remove_redge (rawgraph *g, size_t v1, size_t v2)
 removes any edge between v1 to v2 – irrespective of direction
 
static bool zeq (size_t a, size_t b)
 
bool edge_exists (rawgraph *g, size_t v1, size_t v2)
 tests if there is an edge FROM v1 TO v2
 
static int DFS_visit (rawgraph *g, size_t v, int time, int_stack_t *sp)
 
void top_sort (rawgraph *g)
 

Macro Definition Documentation

◆ SCANNED

#define SCANNED   2

Definition at line 19 of file rawgraph.c.

◆ SCANNING

#define SCANNING   1

Definition at line 18 of file rawgraph.c.

◆ UNSCANNED

#define UNSCANNED   0

Definition at line 17 of file rawgraph.c.

Function Documentation

◆ DFS_visit()

static int DFS_visit ( rawgraph g,
size_t  v,
int  time,
int_stack_t *  sp 
)
static

Definition at line 61 of file rawgraph.c.

References vertex::adj_list, vertex::color, DFS_visit(), SCANNED, SCANNING, and UNSCANNED.

Referenced by DFS_visit(), and top_sort().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ edge_exists()

bool edge_exists ( rawgraph g,
size_t  v1,
size_t  v2 
)

Definition at line 55 of file rawgraph.c.

References vertex::adj_list, rawgraph::vertices, and zeq().

Referenced by addPEdges(), insert_edge(), and set_parallel_edges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_graph()

void free_graph ( rawgraph g)

Definition at line 32 of file rawgraph.c.

References vertex::adj_list, free(), rawgraph::nvs, and rawgraph::vertices.

Here is the call graph for this function:

◆ insert_edge()

void insert_edge ( rawgraph g,
size_t  v1,
size_t  v2 
)

Definition at line 40 of file rawgraph.c.

References vertex::adj_list, edge_exists(), and rawgraph::vertices.

Referenced by add_edges_in_G(), and set_parallel_edges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_graph()

rawgraph * make_graph ( size_t  n)

Definition at line 21 of file rawgraph.c.

References vertex::color, gv_alloc(), gv_calloc(), rawgraph::nvs, UNSCANNED, and rawgraph::vertices.

Referenced by create_graphs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove_redge()

void remove_redge ( rawgraph g,
size_t  v1,
size_t  v2 
)

Definition at line 46 of file rawgraph.c.

References vertex::adj_list, and rawgraph::vertices.

Referenced by removeEdge().

Here is the caller graph for this function:

◆ top_sort()

void top_sort ( rawgraph g)

Definition at line 80 of file rawgraph.c.

References vertex::color, DFS_visit(), rawgraph::nvs, vertex::topsort_order, UNSCANNED, and rawgraph::vertices.

Referenced by assignTrackNo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zeq()

static bool zeq ( size_t  a,
size_t  b 
)
static

Definition at line 51 of file rawgraph.c.

Referenced by edge_exists().

Here is the caller graph for this function: