From f7022495daa31b714a73d6bdf6640db7494f1f4c Mon Sep 17 00:00:00 2001 From: Alex Auvolat--bernstein Date: Wed, 4 Dec 2013 17:57:00 +0100 Subject: Added optimization to algo C. --- algos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'algos.c') diff --git a/algos.c b/algos.c index 630a719..3d24558 100644 --- a/algos.c +++ b/algos.c @@ -53,8 +53,10 @@ void max_clique_b(const graph g, set k, set c, set a, set *mc) { // Il est donc de la responsabilité de l'appellant de vérifier qu'à // chaque appel les sets sont utilisables et cohérents void max_clique_c(const graph g, set k, set c, set a, set *mc) { + if (set_size(k) + set_size(c) <= set_size(*mc)) return; + if (is_set_empty(c)) { - if (set_size(k) > set_size(*mc)) { + if (set_size(k) > set_size(*mc)) { // useless condition delete_set(*mc); *mc = copy_set(k); printf("Found new max clique: "); dump_set(*mc); fflush(stdout); -- cgit v1.2.3