At first, I believe that every one will feel a bit puzzled, mainly because the word "weight", of course, if only to understand and use the two terms, you do not have to care about this irrelevant word.
Well, it's time to talk. The so-called double connectivity and strong connectivity, the biggest difference, but also the most essential difference is that the former applies to undirected graphs, while the latter applies to the undirected graph. The concept of the two is the same, that is, a point, B Point, from point A can reach point B, and from point B can reach point A. (if a directed graph must be extended direction to arrive.) )
The two connected components can be subdivided into: point-double connected component, edge-double connected component. The so-called point-to-double connectivity component refers to at least two paths between two points in an undirected graph, and different points in the path (not counting the tail). Different points-two connected components have at most one common point, and this point must be "cut-top". It is mentioned that the cutting top has to be wordy here, and the cut-off (pictured below) is the number of connected blocks increases when the point is deleted. As for what is called the connected block, can be understood as a set of points, if the two points can be directly or indirectly connected to the two points in the same connected block.
As for the side-double connected component, there are at least two paths between two points in an undirected graph, and the edges in the path are different. There must be no bridge in the side-double connected component. The bridge (pictured above) means that when the edge is deleted, the number of connected blocks increases.
The knowledge of the thing has been finished, the following roughly speaking about the program.
Determine if the undirected connectivity graph is connected:
void Dfs (int v)
{
node_pointer w;
VISITED[V] = TRUE;
for (w = graph[v]; w; w = w->link)
{
if (!visited[w->vertex])
{
dfs (W->vertex);
}}}
void Connect ()
{for
(int i = 0; i < n; i++)
{
if (!visited[i])
{
dfs (i);
}}}
Find points-Double connected graphs:
stack<int> s;
int num=1,time=0;
int id[1000]={0};
void Tarjan (int x, int fa)
{
dfn[x]=low[x]=time++;
for (int e=first[x];e!=-1;e=next[e])
{
if (X!=fa&&dfn[x]<dfn[v[e]])
{
s.push (e);
if (dfn[x]==0)
{
Tarjan (v[e], x);
if (Low[v[e]]<low[x]) Low[x]=low[v[e]];
if (Low[v[e]]>=dfn[x])
{
int edge;
Do
{
s.pop ();
Edge=s.top ();
id[u[edge]]=id[v[edge]]=num++;
} while (u[edge]!=x| | V[edge]!=v[e]);
}
}
else if (dfn[v[e]]<low[x]) low[x]=dfn[v[e]];}}
}
Find edges-Double connected graphs:
void (int u,int fa)
{
dfn[u]=low[u]=++time;
S[top++]=u;
for (int e=first[u];e!=-1;e=next[e])
{
if (V[E]!=FA)
{
if (!dfn[v[e]])
{
Tarjan (v[e],u);
if (Low[v[e]]<low[u]) Low[u]=low[v[e]];
else if (Low[v[e]]>dfn[u])
{for
(S[top]=-1;s[top]!=v[e];)
{
id[s[--top]]=num;
num++
;
}}} else if (Dfn[v[e]]<low[u]) low[u]=dfn[v[e]];}}
}
To find strong connected graphs:
void Tarjan (int i)
{
int J;
Dfn[i]=low[i]=++dindex;
Instack[i]=true;
stap[++stop]=i;
For (Edge *e=v[i];e;e=e->next)
{
j=e->t;
if (! DFN[J])
{
Tarjan (j);
if (Low[j]<low[i]) low[i]=low[j];
}
else if (Instack[j] && dfn[j]<low[i]) low[i]=dfn[j];
}
if (Dfn[i]==low[i])
{
bcnt++;
Do
{
j=stap[stop--];
Instack[j]=false;
belong[j]=bcnt;
} while (j!=i);
}
}
void Solve ()
{
stop=bcnt=dindex=0;
memset (dfn,0,sizeof (DFN));
for (int i=1;i<=n;i++)
{
if (! Dfn[i]) Tarjan (i);
}
}
Thank you for watching my blog, if there are insufficient welcome to put forward, at the same time I hope you can have some gains, thank you.