Revision 437fd680 custompackages/graph-parser/src/bi_connected_components.h

View differences:

custompackages/graph-parser/src/bi_connected_components.h
15 15

  
16 16

  
17 17
typedef std::vector<edges_size_type> ComponentVec;
18
typedef boost::iterator_property_map<ComponentVec::iterator, EdgeIndexMap> ComponentMap;
18
typedef boost::iterator_property_map<ComponentVec::iterator, EdgeIndexPMap> ComponentMap;
19 19

  
20 20
typedef map<string, vector<int> > VertexIdToComponentStdMap;
21 21
typedef boost::associative_property_map<VertexIdToComponentStdMap> VertexIdToComponentMap;
......
38 38
    void init();
39 39

  
40 40
    // Getter functions
41
    set<string> const& all_art_points_id() const;
42
    int num_of_vertices() const;
41
    int const num_of_bcc();
42
    int const num_of_vertices() const;
43
    StringSet const& all_art_points_id() const;
44
    NameToDoubleMap const& bc_score() const;
43 45

  
44 46
    // SUB-COMPONENT
45 47
    void FindBiConnectedComponents();
......
53 55

  
54 56
    // BETWEENNESS CENTRALITY
55 57
    void CalculateBetweennessCentrality();
56

  
57
    // HELPERS
58
    int num_of_bcc();
58
    void initialize_betweenness_centrality();
59
    void calculate_bc_inter();
60
    void finalize_betweenness_centrality();
59 61

  
60 62
    // HELPERS FOR OUTPUTTING RESULT
61 63
    void print();
......
80 82
    ComponentVec component_vec_;
81 83
    ComponentMap component_map_;
82 84
    vector<Vertex> art_points_;
85
    StringSet all_art_points_id_;
83 86

  
84 87
    int num_of_bcc_ = -1;
85 88
    int num_of_vertices_ = -1;
86 89

  
87
    StringSet all_art_points_id_;
88

  
89 90
    std::queue<QueueElem> Q;
90 91

  
91
    // Old code
92
    void processArtPoints();
93
    void testProcessArtPoints();
94

  
95
    VertexVec get_normal_vertices_for_component(int comp_index);
96

  
97
    // Calculate Betweenness Centrality
98
    void findBetweennessCentrality();
99
    void printBetweennessCentrality();
100

  
101
    // Function used in debugging
102
    void _print_art_points();
103
    void _test_set_difference();
104

  
92
    // bc_score_ will be updated gradually, first with the score for non art points, and then the score for art points
93
    NameToDoubleMap bc_score_;
94
    NameToDoubleMap bc_sum_art_points_; // summing all the bc score for articulation points
95
    NameToDoubleMap bc_inter_;
105 96
};
106 97

  
107

  
108 98
#endif //GRAPH_PARSER_BI_CONNECTED_COMPONENTS_H

Also available in: Unified diff