Advertisement
Davencode

Demo3 ottobre

Jan 14th, 2022
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. ALGO(G1,G2,s,v)
  2. INIT(G1,G2)
  3. L_NoArchi = vuoto
  4. grado_uscente(G1,ge)
  5. grado_entrante(G2,ge)
  6.  
  7. for each v in V do
  8. if ge[v]=0 then
  9. L_NoArchi = L_NoArchi u {v}
  10. c1[v]=nero
  11. for each i in L_NoArchi do
  12. if c1[i]=bianco then
  13. dfs_visit(GT,i,c1)
  14. if c1[s]=nero then
  15. dfs_visit(G,s,c2) //fine primo punto
  16.  
  17. dfs_visit(G2,s,c3)
  18. if c3[v]=nero then
  19. if(dfs_visit_ciclo(G2,v,c4))then
  20. if(ge[v] > 1)then
  21. return false //se il vertice v dove si diparte il ciclo prima tiene un grado entrante > 1 allora ci sono
  22. altri archi che passano per
  23.  
  24.  
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement