SNAP Library 3.0, User Reference  2016-07-20 17:56:49
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TArtPointVisitor Class Reference

Articulation point Depth-First-Search visitor class. More...

#include <cncom.h>

Public Member Functions

 TArtPointVisitor ()
 
 TArtPointVisitor (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, TIntPrVnLowH
 
THash< TInt, TIntParentH
 
TIntSet ArtSet
 
TInt Time
 

Detailed Description

Articulation point Depth-First-Search visitor class.

Definition at line 169 of file cncom.h.

Constructor & Destructor Documentation

TArtPointVisitor::TArtPointVisitor ( )
inline

Definition at line 176 of file cncom.h.

176 { }
TArtPointVisitor::TArtPointVisitor ( const int &  Nodes)
inline

Definition at line 177 of file cncom.h.

177 : VnLowH(Nodes), ParentH(Nodes) { }
THash< TInt, TIntPr > VnLowH
Definition: cncom.h:171
THash< TInt, TInt > ParentH
Definition: cncom.h:172

Member Function Documentation

void TArtPointVisitor::BackEdge ( const int &  NId1,
const int &  NId2 
)
inline

Definition at line 186 of file cncom.h.

186  {
187  if (ParentH.IsKey(NId1) && ParentH.GetDat(NId1)!=NId2) {
188  VnLowH.GetDat(NId1).Val2 = TMath::Mn(VnLowH.GetDat(NId1).Val2, VnLowH.GetDat(NId2).Val1); } }
static const T & Mn(const T &LVal, const T &RVal)
Definition: xmath.h:36
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:220
THash< TInt, TIntPr > VnLowH
Definition: cncom.h:171
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
bool IsKey(const TKey &Key) const
Definition: hash.h:216
THash< TInt, TInt > ParentH
Definition: cncom.h:172
void TArtPointVisitor::DiscoverNode ( int  NId)
inline

Definition at line 178 of file cncom.h.

178 { Time++; VnLowH.AddDat(NId, TIntPr(Time, Time)); }
TPair< TInt, TInt > TIntPr
Definition: ds.h:83
THash< TInt, TIntPr > VnLowH
Definition: cncom.h:171
TDat & AddDat(const TKey &Key)
Definition: hash.h:196
void TArtPointVisitor::ExamineEdge ( const int &  NId1,
const int &  NId2 
)
inline

Definition at line 184 of file cncom.h.

184 { }
void TArtPointVisitor::FinishNode ( const int &  NId)
inline

Definition at line 179 of file cncom.h.

179  {
180  if (! ParentH.IsKey(NId)) { return; } const int Prn = ParentH.GetDat(NId);
182  if (VnLowH.GetDat(Prn).Val1==1 && VnLowH.GetDat(NId).Val1!=2) { ArtSet.AddKey(Prn); }
183  if (VnLowH.GetDat(Prn).Val1!=1 && VnLowH.GetDat(NId).Val2>=VnLowH.GetDat(Prn).Val1) { ArtSet.AddKey(Prn); } }
static const T & Mn(const T &LVal, const T &RVal)
Definition: xmath.h:36
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:220
TIntSet ArtSet
Definition: cncom.h:173
THash< TInt, TIntPr > VnLowH
Definition: cncom.h:171
int AddKey(const TKey &Key)
Definition: shash.h:1254
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
bool IsKey(const TKey &Key) const
Definition: hash.h:216
THash< TInt, TInt > ParentH
Definition: cncom.h:172
void TArtPointVisitor::FwdEdge ( const int &  NId1,
const int &  NId2 
)
inline

Definition at line 189 of file cncom.h.

189  {
190  VnLowH.GetDat(NId1).Val2 = TMath::Mn(VnLowH.GetDat(NId1).Val2, VnLowH.GetDat(NId2).Val1); }
static const T & Mn(const T &LVal, const T &RVal)
Definition: xmath.h:36
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:220
THash< TInt, TIntPr > VnLowH
Definition: cncom.h:171
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
void TArtPointVisitor::TreeEdge ( const int &  NId1,
const int &  NId2 
)
inline

Definition at line 185 of file cncom.h.

185 { ParentH.AddDat(NId2, NId1); }
TDat & AddDat(const TKey &Key)
Definition: hash.h:196
THash< TInt, TInt > ParentH
Definition: cncom.h:172

Member Data Documentation

TIntSet TArtPointVisitor::ArtSet

Definition at line 173 of file cncom.h.

THash<TInt, TInt> TArtPointVisitor::ParentH

Definition at line 172 of file cncom.h.

TInt TArtPointVisitor::Time

Definition at line 174 of file cncom.h.

THash<TInt, TIntPr> TArtPointVisitor::VnLowH

Definition at line 171 of file cncom.h.


The documentation for this class was generated from the following file: