From be181b248426fd320a546f7235a9f22d6fd69eae Mon Sep 17 00:00:00 2001 From: Henrique Cipriano Date: Sun, 6 Nov 2016 16:38:36 -0200 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=A3o=20na=20fun=C3=A7=C3=A3o=20qu?= =?UTF-8?q?e=20encontra=20ciclos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scr/tad/grafo/grafo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scr/tad/grafo/grafo.c b/scr/tad/grafo/grafo.c index 0b6b7c1..c260d79 100644 --- a/scr/tad/grafo/grafo.c +++ b/scr/tad/grafo/grafo.c @@ -186,6 +186,10 @@ int buscarRelacao(lista *arestas, lista *antecessores, int sucessor) { node *n = antecessores->raiz; while(n != NULL){ arco *arco= n->elemento; + if(arco->antecessor->bool_marcardo){ + return bool_FALSE; + } + arco->antecessor->bool_marcardo = bool_TRUE; if(arco->sucessor->valor == sucessor){ return bool_TRUE; }