SNAP Library 2.0, Developer Reference
2013-05-13 16:33:57
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
Biconnected componetns Depth-First-Search visitor class. More...
#include <cncom.h>
Public Member Functions | |
TBiConVisitor () | |
TBiConVisitor (const int &Nodes) | |
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) |
Public Attributes | |
THash< TInt, TIntPr > | VnLowH |
THash< TInt, TInt > | ParentH |
TSStack< TIntPr > | Stack |
TCnComV | CnComV |
TIntSet | NSet |
TInt | Time |
TBiConVisitor::TBiConVisitor | ( | ) | [inline] |
TBiConVisitor::TBiConVisitor | ( | const int & | Nodes | ) | [inline] |
void TBiConVisitor::BackEdge | ( | const int & | NId1, |
const int & | NId2 | ||
) | [inline] |
Definition at line 219 of file cncom.h.
References THash< TKey, TDat, THashFunc >::GetDat(), THash< TKey, TDat, THashFunc >::IsKey(), TMath::Mn(), ParentH, TSStack< TVal >::Push(), Stack, TPair< TVal1, TVal2 >::Val1, TPair< TVal1, TVal2 >::Val2, and VnLowH.
{ if (ParentH.IsKey(NId1) && ParentH.GetDat(NId1)!=NId2) { Stack.Push(TIntPr(NId1, NId2)); VnLowH.GetDat(NId1).Val2 = TMath::Mn(VnLowH.GetDat(NId1).Val2, VnLowH.GetDat(NId2).Val1); } }
void TBiConVisitor::DiscoverNode | ( | int | NId | ) | [inline] |
void TBiConVisitor::ExamineEdge | ( | const int & | NId1, |
const int & | NId2 | ||
) | [inline] |
void TBiConVisitor::FinishNode | ( | const int & | NId | ) | [inline] |
Definition at line 202 of file cncom.h.
References TVec< TVal, TSizeTy >::Add(), THashSet< TKey, THashFunc >::AddKey(), THashSet< TKey, THashFunc >::Clr(), TSStack< TVal >::Empty(), THash< TKey, TDat, THashFunc >::GetDat(), THashSet< TKey, THashFunc >::GetKeyV(), THash< TKey, TDat, THashFunc >::IsKey(), TMath::Mn(), NSet, ParentH, TSStack< TVal >::Pop(), TVec< TVal, TSizeTy >::Sort(), Stack, TSStack< TVal >::Top(), TPair< TVal1, TVal2 >::Val1, TPair< TVal1, TVal2 >::Val2, and VnLowH.
{ if (! ParentH.IsKey(NId)) { return; } const int Prn = ParentH.GetDat(NId); VnLowH.GetDat(Prn).Val2 = TMath::Mn(VnLowH.GetDat(Prn).Val2, VnLowH.GetDat(NId).Val2); if (VnLowH.GetDat(NId).Val2 >= VnLowH.GetDat(Prn).Val1) { NSet.Clr(false); while (! Stack.Empty() && Stack.Top() != TIntPr(Prn, NId)) { const TIntPr& Top = Stack.Top(); NSet.AddKey(Top.Val1); NSet.AddKey(Top.Val2); Stack.Pop(); } if (! Stack.Empty()) { const TIntPr& Top = Stack.Top(); NSet.AddKey(Top.Val1); NSet.AddKey(Top.Val2); Stack.Pop(); } TIntV NIdV; NSet.GetKeyV(NIdV); NIdV.Sort(); CnComV.Add(NIdV); } }
void TBiConVisitor::FwdEdge | ( | const int & | NId1, |
const int & | NId2 | ||
) | [inline] |
void TBiConVisitor::TreeEdge | ( | const int & | NId1, |
const int & | NId2 | ||
) | [inline] |
Definition at line 196 of file cncom.h.
Referenced by FinishNode().
Definition at line 193 of file cncom.h.
Referenced by BackEdge(), FinishNode(), and TreeEdge().
Definition at line 194 of file cncom.h.
Referenced by BackEdge(), FinishNode(), and TreeEdge().
Definition at line 197 of file cncom.h.
Referenced by DiscoverNode().
Definition at line 192 of file cncom.h.
Referenced by BackEdge(), DiscoverNode(), and FinishNode().