we got it !

functionning edmunds_karp
still need some testing for already used nodes
still need some memory protection
This commit is contained in:
Tanguy MAZE
2019-03-31 19:49:42 +02:00
parent 7a67b49802
commit ab578f6039
6 changed files with 323 additions and 41 deletions

View File

@@ -6,7 +6,7 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/23 17:31:19 by tmaze #+# #+# */
/* Updated: 2019/03/27 17:44:40 by tmaze ### ########.fr */
/* Updated: 2019/03/31 17:58:52 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
@@ -27,6 +27,7 @@ typedef struct s_node
typedef struct s_ind
{
int index;
int weight;
struct s_ind *next;
} t_ind;
@@ -38,10 +39,20 @@ typedef struct s_lmdata
t_ind **adj;
} t_lmdata;
typedef struct s_bfs
{
int parent;
char visited;
int queue;
} t_bfs;
void lm_initdata(t_lmdata *data);
int lm_getparams(t_lmdata *data);
t_ind *lst_indadd(t_ind **lst, int ind);
void lst_inddel(t_ind **lst);
void bfs(t_lmdata *data, t_bfs *tab, int start_ind, int end_ind);
t_ind **edmunds_karp(t_lmdata *data, int start_ind, int end_ind);
#endif