Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Algo(G,a,b,c)
- INIT(G)
- c[c]=n
- ret=false
- dfs_visit(G,a) // normale dfs visit
- if(c[b]=n)then
- INIT(G)
- c[a]=n
- dfs_visit(G,b) // normale dfs visit
- if(c[c]=n)then
- INIT(G)
- ret=dfs_visitmod(G,c)
- return ret
- dfs_visitmod(G,s)
- c[s]=g
- ret=false
- for each v in Adj[s]do
- if c[v]=b then
- ret=dfs_visitmod(G,v)
- if ret=false then
- return false
- else if c[v]=g then
- if v=a or v=b or v=c then
- ret=false
- else
- ret=true
- c[s]=n
- return ret
- INIT(G)
- for each v in V do
- c[v]=b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement