예제 #1
0
/*Func interna que devolve 0 caso encontre caminho para t*/
int pathR2(Digraph G, Vertex v, Vertex t){
    Vertex w;
    lbl[v] = 0;
    for(w = 0; w<G->V; w++)
        if(G->adj[v][w] && lbl[w]==-1){
            if(w==t)
                return 1;
            else if (pathR2(G, w, t))
                return 1;
        }
    return 0;
}
예제 #2
0
파일: matriz.c 프로젝트: marcosf63/Grafos
/*função básica modificada*/
int DIGRAPHpath2(Digraph G, Vertex s, Vertex t){
  Vertex v;
  for (v = 0; v < G->V; v++){
    lbl[v] = -1;
    parnt[v] = -1;
  }
  parnt[s] = s;
  pathR2(G, s, t);
  if (lbl[t] == -1)
    return 0;
  else
    return 1;
}