-
Notifications
You must be signed in to change notification settings - Fork 0
/
path.h
36 lines (30 loc) · 1.6 KB
/
path.h
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
30
31
32
33
34
35
36
#ifndef PATH_H_INCLUDED
#define PATH_H_INCLUDED
#include "matrix.h"
#include "queue_stack.h"
/**********************************************************************************************
* Breadth-first search
*
* Takes a adjacency matrix m, node source and vector distance
* Fills vector distance in which every element i represents distance from source to node i
**********************************************************************************************/
void breadth_search (matrix *m, int source, int *distance);
/**********************************************************************************************
* Minimum Paths
*
* Returns new adjacency matrix containing only edges that are part of minimum paths
**********************************************************************************************/
matrix * minimum_paths (matrix *adj, int target, int d, int *d_s, int *d_t);
/**********************************************************************************************
* Find P
*
* Returns number of minimum paths after performing Depth-first search
**********************************************************************************************/
int find_p (matrix *m, int s, int target);
/**********************************************************************************************
* Find P
*
* Function that uses all functions above to return number of minimum paths
**********************************************************************************************/
int count_paths (int x, int y, int e, int *vector_e, int target);
#endif // PATH_H_INCLUDED