Generated on Tue Dec 16 12:49:16 2008 for BIU-2.2.0 by doxygen 1.5.1

src/biu/Graph_UD.hh

Go to the documentation of this file.
00001 #ifndef GRAPH_UD_HH_
00002 #define GRAPH_UD_HH_
00003 
00004 #include <vector>
00005 #include <set>
00006 #include <string>
00007 #include <ostream>
00008 
00009 namespace biu
00010 {
00011 
00012 
00018 class Graph_UD
00019 {
00020     
00021 protected:
00022 
00024     std::vector< std::set<size_t> > adjList;  
00025     
00026 
00027 public:
00028     
00029       // component label representation
00030     typedef std::vector<size_t> CompLabel;
00031     
00033     typedef std::set<size_t>::const_iterator AdjacencyIterator;
00035     typedef std::pair<AdjacencyIterator,AdjacencyIterator> AdjItPair;
00036 
00039     Graph_UD(size_t nodeNumber = 0);
00040     
00042     virtual ~Graph_UD();
00043     
00047     void setNodeNumber(const size_t n);
00048     
00050     void addEdge(const size_t n1, const size_t n2);
00051     
00053     void remEdge(const size_t n1, const size_t n2);
00054     
00057     bool isEdge(const size_t n1, const size_t n2);
00058     
00061     size_t nodes() const;
00062     
00065     size_t edges() const;
00066 
00070     size_t degree(const size_t n) const;
00071 
00075     size_t connectedComponents(CompLabel & compID) const;
00076     
00078     void printDOT( std::ostream & out ) const;
00079     
00085     AdjItPair
00086     adjNodes( const size_t n ) const;
00087 
00088 protected:
00089 
00097     void labelAdjacentNodes( const size_t curNode, CompLabel & compID, const size_t label) const;
00098 
00099 };
00100 
00101 }
00102 
00103 #endif /*GRAPH_UD_HH_*/