@@ -25,7 +25,7 @@ template<class E=empty_edget>
25
25
class graph_nodet
26
26
{
27
27
public:
28
- typedef unsigned node_indext;
28
+ typedef std:: size_t node_indext;
29
29
30
30
typedef E edget;
31
31
typedef std::map<node_indext, edget> edgest;
@@ -39,7 +39,7 @@ class graph_nodet
39
39
40
40
inline void add_out (node_indext n)
41
41
{
42
- out.insert (std::pair<unsigned , edget>(n, edget ()));
42
+ out.insert (std::pair<node_indext , edget>(n, edget ()));
43
43
}
44
44
45
45
inline void erase_in (node_indext n)
@@ -229,12 +229,12 @@ class graph
229
229
std::vector<unsigned > depth;
230
230
std::vector<unsigned > lowlink;
231
231
std::vector<bool > in_scc;
232
- std::stack<unsigned > scc_stack;
233
- std::vector<unsigned > &subgraph_nr;
232
+ std::stack<node_indext > scc_stack;
233
+ std::vector<node_indext > &subgraph_nr;
234
234
235
- unsigned scc_count, max_dfs;
235
+ std:: size_t scc_count, max_dfs;
236
236
237
- tarjant (unsigned n, std::vector<unsigned > &_subgraph_nr):
237
+ tarjant (std:: size_t n, std::vector<node_indext > &_subgraph_nr):
238
238
subgraph_nr (_subgraph_nr)
239
239
{
240
240
visited.resize (n, false );
@@ -246,7 +246,7 @@ class graph
246
246
}
247
247
};
248
248
249
- void tarjan (class tarjant &t, unsigned v);
249
+ void tarjan (class tarjant &t, node_indext v);
250
250
251
251
void shortest_path (
252
252
node_indext src,
@@ -518,7 +518,7 @@ std::size_t graph<N>::connected_subgraphs(
518
518
visited.resize (nodes.size (), false );
519
519
subgraph_nr.resize (nodes.size (), 0 );
520
520
521
- unsigned nr=0 ;
521
+ std:: size_t nr=0 ;
522
522
523
523
for (node_indext src=0 ; src<size (); src++)
524
524
{
@@ -566,7 +566,7 @@ Function: graph::tarjan
566
566
\*******************************************************************/
567
567
568
568
template <class N >
569
- void graph<N>::tarjan(tarjant &t, unsigned v)
569
+ void graph<N>::tarjan(tarjant &t, node_indext v)
570
570
{
571
571
t.scc_stack .push (v);
572
572
t.in_scc [v]=true ;
@@ -581,7 +581,7 @@ void graph<N>::tarjan(tarjant &t, unsigned v)
581
581
it!=node.out .end ();
582
582
it++)
583
583
{
584
- unsigned vp=it->first ;
584
+ node_indext vp=it->first ;
585
585
if (!t.visited [vp])
586
586
{
587
587
tarjan (t, vp);
@@ -597,7 +597,7 @@ void graph<N>::tarjan(tarjant &t, unsigned v)
597
597
while (true )
598
598
{
599
599
assert (!t.scc_stack .empty ());
600
- unsigned vp=t.scc_stack .top ();
600
+ node_indext vp=t.scc_stack .top ();
601
601
t.scc_stack .pop ();
602
602
t.in_scc [vp]=false ;
603
603
t.subgraph_nr [vp]=t.scc_count ;
0 commit comments