Tarjan求强联通分量
http://www.cnblogs.com/shadowland/p/5872257.html
void tarjan(int x){
dfn[x]=++dfs_num;
low[x]=dfs_num;
vis[x]=true;
stack[++top]=x;
for(int i=head[x];i!=0;i=e[i].next){
int temp=e[i].to;
if(!dfn[temp]){
tarjan(temp);
low[x]=min(low[x],low[temp]);
}
else if(vis[temp])low[x]=min(low[x],dfn[temp]);
}
if(dfn[x]==low[x]){
vis[x]=false;
color[x]=++col_num;
while(stack[top]!=x){
color[stack[top]]=col_num;
vis[stack[top--]]=false;
}
top--;
}
}