Data Structures Lerax  v3.0-102-gaf18
Opinionated Data Structures & Algorithms
Loading...
Searching...
No Matches
graph.h File Reference
#include <stdbool.h>
#include "../set/set.h"

Go to the source code of this file.

Typedefs

typedef struct Graph Graph

Functions

Graphgraph_create ()
 Creates a new directed graph.
Graphgraph_undirected_create ()
 Creates a new undirected graph.
void graph_add_node (Graph *g, int node)
 Adds a node to the graph.
void graph_add_edge (Graph *g, int u, int v)
 Adds an edge to the graph.
void graph_remove_edge (Graph *g, int u, int v)
 Removes an edge from the graph.
void graph_remove_node (Graph *g, int node)
 Removes a node from the graph.
bool graph_has_edge (Graph *g, int u, int v)
 Checks if an edge exists in the graph.
Setgraph_get_neighbors (Graph *g, int node)
 Gets the neighbors of a node.
void graph_free (Graph *g)
 Frees the memory allocated for the graph.
void graph_print (Graph *g)
 Prints the graph.
Iteratorgraph_bfs (Graph *g, int start_node)
 Performs a Breadth-First Search on a graph.
Iteratorgraph_dfs (Graph *g, int start_node)
 Performs a Depth-First Search on a graph.

Typedef Documentation

◆ Graph

typedef struct Graph Graph

    Copyright 2025 Manoel Vilela

    Author: Manoel Vilela
   Contact: manoel_vilela@engineer.com

Organization: ITA