-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph.h
More file actions
29 lines (24 loc) · 759 Bytes
/
graph.h
File metadata and controls
29 lines (24 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef GRAPH_C
#define GRAPH_C
#include <stdint.h>
#include "adj_list.h"
#include "stack.h"
typedef struct graph {
int nr_nodes, nr_edges;
struct node** neighbours;
int nr_deposits;
uint32_t deposits;
} graph;
void add_edge(graph *gr, int from, int to, double cost);
void init_adj_list(graph* gr);
void read_graph(graph *gr, FILE* file);
void remove_edge(graph *gr, int from, int to);
void display_graph(graph* gr);
void free_graph(graph* gr);
void BFS_graph(graph*gr, int begin_from);
void DFS_graph(graph* gr, int begin_from, uint32_t* visited, Stack* st);
graph* transpose_graph(graph* gr);
void add_to_vis(uint32_t* vis, uint32_t nd);
int is_visited(uint32_t* vis, uint32_t nd);
void elim_from_vis(uint32_t* vis, uint32_t nd);
#endif