Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Algo(G)
- INIT(G)
- ORD_TOPOLOGICO(G)
- numsem=0
- maxsem=0
- ret=dfs_mod(G,v,numsem)
- return ret
- dfs_mod(G,s,numsem)
- c[s]=g
- for each u in Adj[s] do
- if c[u]=b then
- numsem++
- if numsem > maxsem then
- maxsem=numsem
- dfs_mod(G,u,numsem)
- c[s]=n
- return maxsem
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement