|
SNAP Library 2.1, User Reference
2013-09-25 10:47:25
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
Strongly connected componetns Depht-First-Search visitor class. More...
#include <cncom.h>
Public Member Functions | |
| TSccVisitor (const PGraph &_Graph) | |
| void | DiscoverNode (int NId) |
| void | FinishNode (const int &NId) |
| void | ExamineEdge (const int &NId1, const int &NId2) |
| void | TreeEdge (const int &NId1, const int &NId2) |
| void | BackEdge (const int &NId1, const int &NId2) |
| void | FwdEdge (const int &NId1, const int &NId2) |
| int | GetMinDiscTm (const int &NId1, const int &NId2) const |
Public Attributes | |
| PGraph | Graph |
| THash< TInt, TIntPr > | TmRtH |
| TSStack< TInt > | Stack |
| TInt | Time |
| TIntH | SccCntH |
| TCnComV | CnComV |
Strongly connected componetns Depht-First-Search visitor class.
| TSccVisitor< PGraph, OnlyCount >::TSccVisitor | ( | const PGraph & | _Graph | ) | [inline] |
| void TSccVisitor< PGraph, OnlyCount >::BackEdge | ( | const int & | NId1, |
| const int & | NId2 | ||
| ) | [inline] |
| void TSccVisitor< PGraph, OnlyCount >::DiscoverNode | ( | int | NId | ) | [inline] |
| void TSccVisitor< PGraph, OnlyCount >::ExamineEdge | ( | const int & | NId1, |
| const int & | NId2 | ||
| ) | [inline] |
| void TSccVisitor< PGraph, OnlyCount >::FinishNode | ( | const int & | NId | ) | [inline] |
Definition at line 245 of file cncom.h.
{
typename PGraph::TObj::TNodeI NI = Graph->GetNI(NId);
TIntPr& TmRtN = TmRtH.GetDat(NId);
int W = -1, Cnt = 0;
for (int i = 0; i < NI.GetOutDeg(); i++) {
W = NI.GetOutNId(i);
const TIntPr& TmRtW = TmRtH.GetDat(W);
if (TmRtW.Val1 < 0) { // node not yet in any SCC
TmRtN.Val2 = GetMinDiscTm(TmRtN.Val2, TmRtW.Val2); } }
if (TmRtN.Val2 == NId) {
if (! OnlyCount) { CnComV.Add(); }
do { W = Stack.Top(); Stack.Pop();
if (OnlyCount) { Cnt++; } else { CnComV.Last().Add(W); }
TmRtH.GetDat(W).Val1 = abs(TmRtH.GetDat(W).Val1); // node is in SCC
} while (W != NId);
if (OnlyCount) { SccCntH.AddDat(Cnt) += 1; } } }
| void TSccVisitor< PGraph, OnlyCount >::FwdEdge | ( | const int & | NId1, |
| const int & | NId2 | ||
| ) | [inline] |
| int TSccVisitor< PGraph, OnlyCount >::GetMinDiscTm | ( | const int & | NId1, |
| const int & | NId2 | ||
| ) | const [inline] |
| void TSccVisitor< PGraph, OnlyCount >::TreeEdge | ( | const int & | NId1, |
| const int & | NId2 | ||
| ) | [inline] |
| TCnComV TSccVisitor< PGraph, OnlyCount >::CnComV |
| PGraph TSccVisitor< PGraph, OnlyCount >::Graph |
| TIntH TSccVisitor< PGraph, OnlyCount >::SccCntH |
| TSStack<TInt> TSccVisitor< PGraph, OnlyCount >::Stack |
| TInt TSccVisitor< PGraph, OnlyCount >::Time |
| THash<TInt, TIntPr> TSccVisitor< PGraph, OnlyCount >::TmRtH |