started work to redo algorithm

branch out to redo algorithm
This commit is contained in:
Tanguy MAZE
2019-04-15 18:05:25 +02:00
parent 4a5c798b25
commit dd255666f1
8 changed files with 136 additions and 91 deletions

View File

@@ -6,7 +6,7 @@
/* By: mndhlovu <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/25 06:31:05 by mndhlovu #+# #+# */
/* Updated: 2019/04/14 12:22:28 by tmaze ### ########.fr */
/* Updated: 2019/04/15 17:55:43 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
@@ -26,16 +26,6 @@ static t_node *get_node_role(t_lmdata *data, char role)
return (NULL);
}
static int get_nb_paths(t_ind **ret)
{
int i;
i = 0;
while (ret[i])
i++;
return (i);
}
static void get_nb_paths_max(t_lmdata *data, int start, int end)
{
int i;
@@ -54,7 +44,7 @@ static void get_nb_paths_max(t_lmdata *data, int start, int end)
}
static int lem_in(t_syntax *synt, t_holder *holder,
t_lmdata *lmdata, t_ind ***ret)
t_lmdata *lmdata, t_path **ret)
{
if (!(lm_parser(synt, lmdata, holder)))
return (0);
@@ -70,9 +60,9 @@ static int lem_in(t_syntax *synt, t_holder *holder,
if ((*ret = edmunds_karp(lmdata, get_node_role(lmdata, 's')->ind
, get_node_role(lmdata, 'e')->ind)) == NULL)
return (0);
if (!push_ants(lmdata, *ret, get_nb_paths(*ret)))
if (!push_ants(lmdata, *ret))
return (0);
tablst_inddel(*ret);
clean_path(*ret);
return (1);
}
@@ -87,7 +77,7 @@ int main(int ac, char **av)
t_syntax synt;
t_lmdata ldata;
t_holder holder;
t_ind **ret;
t_path *ret;
(void)av;
if (ac == 1)