Data Structures |
struct | cugra_graph |
struct | cugra_graph_with_arcset |
struct | cugra_vertex |
struct | cugra_adjlink |
struct | cugra_arc |
Defines |
#define | CUGRA_GFLAG_UNDIRECTED 1 |
#define | CUGRA_GFLAG_LOOPFREE 2 |
#define | CUGRA_GFLAG_SIMPLEARCED 4 |
#define | CUGRAP_ARC_ADJLINK_LINK_OFFSET(dir) |
#define | cugra_vertex_for_inarcs(a, v) |
#define | cugra_vertex_for_outarcs(a, v) |
#define | cugra_vertex_for_arcs(dir, a, v) |
#define | cugra_vertex_for_inoutarcs(dir, a, v) |
#define | cugra_graph_for_vertices(v, G) |
Enumerations |
enum | cugra_direction_t { cugra_direction_BEGIN,
cugra_direction_out = 0,
cugra_direction_in = 1,
cugra_direction_END
} |
Functions |
void | cugra_graph_init (cugra_graph_t G, unsigned int gflags) |
cugra_graph_t | cugra_graph_new (unsigned int gflags) |
void | cugra_graph_merge (cugra_graph_t G_dst, cugra_graph_t G_src) |
cu_bool_t | cugra_graph_is_directed (cugra_graph_t G) |
cu_bool_t | cugra_graph_is_simplearced (cugra_graph_t G) |
void | cugra_graph_vertex_init (cugra_graph_t G, cugra_vertex_t v) |
cugra_vertex_t | cugra_graph_vertex_new (cugra_graph_t G) |
cugra_vertex_t | cugra_graph_vertex_new_mem (cugra_graph_t G, size_t size) |
cugra_vertex_t | cugra_graph_vertex_new_ptr (cugra_graph_t G, void *ptr) |
void * | cugra_vertex_mem (cugra_vertex_t v) |
void * | cugra_vertex_ptr (cugra_vertex_t v) |
cu_bool_t | cugra_vertex_is_isolated (cugra_vertex_t v) |
cu_bool_t | cugra_vertex_is_sink (cugra_vertex_t v) |
cu_bool_t | cugra_vertex_is_source (cugra_vertex_t v) |
cu_bool_t | cugra_vertex_is_convergency (cugra_vertex_t v) |
cu_bool_t | cugra_vertex_is_divergency (cugra_vertex_t v) |
cu_bool_t | cugra_vertex_outdegree_leq_1 (cugra_vertex_t v) |
cu_bool_t | cugra_vertex_indegree_leq_1 (cugra_vertex_t v) |
cu_bool_t | cugra_vertex_has_loop (cugra_vertex_t v) |
cu_bool_t | cugra_connect_custom (cugra_graph_t G, cugra_vertex_t tail, cugra_vertex_t head, size_t arc_size, cugra_arc_t *arc_out) |
cu_bool_t | cugra_connect (cugra_graph_t G, cugra_vertex_t tail, cugra_vertex_t head) |
int | cugra_disconnect (cugra_graph_t G, cugra_vertex_t tail, cugra_vertex_t head) |
void | cugra_erase_arc (cugra_graph_t G, cugra_arc_t arc) |
cugra_arc_t | cugra_graph_arc_new (cugra_vertex_t tail, cugra_vertex_t head) CU_ATTR_DEPRECATED |
cugra_arc_t | cugra_graph_arc_new_mem (cugra_vertex_t tail, cugra_vertex_t head, size_t size) CU_ATTR_DEPRECATED |
cugra_arc_t | cugra_graph_arc_new_ptr (cugra_vertex_t tail, cugra_vertex_t head, void *ptr) CU_ATTR_DEPRECATED |
void | cugra_erase_vertex (cugra_graph_t G, cugra_vertex_t v) |
| cu_clos_edec (cugra_erase_vertex_clos, cu_prot(void, cugra_vertex_t),(cugra_graph_t G;)) |
void | cugra_eliminate_vertex (cugra_graph_t G, cugra_vertex_t v) |
void | cugra_vertex_erase_loops (cugra_graph_t G, cugra_vertex_t v) |
void | cugra_graph_erase_loops (cugra_graph_t G) |
void * | cugra_arc_mem (cugra_arc_t a) |
void * | cugra_arc_ptr (cugra_arc_t a) |
cugra_vertex_t | cugra_arc_adjacent (cugra_direction_t dir, cugra_arc_t e) |
cugra_vertex_t | cugra_arc_head (cugra_arc_t e) |
cugra_vertex_t | cugra_arc_tail (cugra_arc_t e) |
cu_bool_t | cugra_arc_connects (cugra_arc_t a, cugra_vertex_t vT, cugra_vertex_t vH) |
cu_bool_t | cugra_arc_unord_connects (cugra_arc_t a, cugra_vertex_t v0, cugra_vertex_t v1) |
cu_bool_t | cugra_arc_is_loop (cugra_arc_t a) |
cugra_arc_t | cugra_vertex_arcs_begin (cugra_direction_t dir, cugra_vertex_t v) |
cugra_arc_t | cugra_vertex_arcs_end (cugra_direction_t dir, cugra_vertex_t v) |
cugra_arc_t | cugra_vertex_arcs_next (cugra_direction_t dir, cugra_arc_t e) |
cugra_arc_t | cugra_vertex_outarcs_begin (cugra_vertex_t v) |
cugra_arc_t | cugra_vertex_outarcs_end (cugra_vertex_t v) |
cugra_arc_t | cugra_vertex_outarcs_next (cugra_arc_t e) |
cugra_arc_t | cugra_vertex_inarcs_begin (cugra_vertex_t v) |
cugra_arc_t | cugra_vertex_inarcs_end (cugra_vertex_t v) |
cugra_arc_t | cugra_vertex_inarcs_next (cugra_arc_t e) |
cugra_vertex_t | cugra_graph_vertices_begin (cugra_graph_t G) |
cugra_vertex_t | cugra_graph_vertices_end (cugra_graph_t G) |
cugra_vertex_t | cugra_graph_vertices_next (cugra_vertex_t v) |
cugra_arc_t | cugra_graph_arcs_begin (cugra_graph_t G) |
cugra_arc_t | cugra_graph_arcs_end (cugra_graph_t G) |
cugra_arc_t | cugra_graph_arcs_next (cugra_graph_t G, cugra_arc_t a) |
This defines a directed graph with access to both input and output arcs for each vertex, using doubly linked lists. Thus single arc updates is O(1) and single vertex updates is linear in the number of incident arcs.
The structure can quite easily be used for undirected graphs, as well, using the io/out generic methods. This is done by iterating over the cugra_direction_t argument before iterating over the incident arcs