data_structures
|
#include <errno.h>
#include <sys/types.h>
#include "types.h"
#include "array.h"
#include "rbt.h"
#include "utils.h"
Go to the source code of this file.
Data Structures | |
struct | s_graph |
A graph implemented using a set of arrays. More... | |
Typedefs | |
typedef struct s_graph | t_graph |
Functions | |
t_graph * | graph_new (const t_type *type) |
Initializes a new graph with vertices of the specified type. More... | |
void | graph_add_vertex (t_graph *graph, const void *v) |
Adds a vertex to the graph. More... | |
void | graph_add_edge (t_graph *graph, const void *v1, const void *v2) |
Adds an edge between two vertices in the graph. More... | |
void | graph_delete (t_graph *graph) |
Deletes this graph and frees all the associated data. More... | |
t_queue * | graph_vertices (const t_graph *graph) |
Returns the queue with all the vertices in this graph. More... | |
t_queue * | graph_adjacency (const t_graph *graph, const void *v) |
Returns the queue with all the vertices in this graph that are adjancent to the specified vertex. More... | |
int | graph_adjacent (const t_graph *graph, const void *v1, const void *v2) |
Are two vertices in the graph adjacent to each other? More... | |
void graph_add_edge | ( | t_graph * | graph, |
const void * | v1, | ||
const void * | v2 | ||
) |
Adds an edge between two vertices in the graph.
v1 | One vertex |
v2 | The other vertex |
Definition at line 16 of file graph_add_edge.c.
void graph_add_vertex | ( | t_graph * | graph, |
const void * | v | ||
) |
Adds a vertex to the graph.
v | The vertex name to be copied |
Definition at line 16 of file graph_add_vertex.c.
Returns the queue with all the vertices in this graph that are adjancent to the specified vertex.
v | The vertex |
Definition at line 16 of file graph_adjacency.c.
int graph_adjacent | ( | const t_graph * | graph, |
const void * | v1, | ||
const void * | v2 | ||
) |
Are two vertices in the graph adjacent to each other?
v1 | One vertex |
v2 | The other vertex |
1
if the vertices are adjacent, 0
otherwise Definition at line 16 of file graph_adjacent.c.
void graph_delete | ( | t_graph * | graph | ) |
Deletes this graph and frees all the associated data.
Does nothing if the argument is NULL
.
Definition at line 16 of file graph_delete.c.
Initializes a new graph with vertices of the specified type.
type | The type of vertices |
Definition at line 16 of file graph_new.c.
Returns the queue with all the vertices in this graph.
Definition at line 16 of file graph_vertices.c.