1 Function next_popular_vertex (N, Step, Exclude_Dests[ ], Possible_Dests[ ])

│ // This function returns the identifier id of a vertex

│ // The vertex must be in the list Possible_Dests[ ]

│ // excepting those included in the array Exclude_Dests[0::Step - 1] if Step > 0

│ // Such identifier is a random value smaller than N and

│ // it is generated with probability: P r o b ( i d ) = 2 N i d j = 1 N 2 N j

2 │ id ß prob_rand(N; Prob;Exclude_Dests[ ]; Possible_Dests[ ]).

3 └ return id

// N is the total amount of Vertices in the community

4 Function Generator (N, Length_paths, Total_paths)

5 │ for Source = 0 à N do

6 │ │ Visited_Vertices[Source][ ] = Ø

7 │ └ Max_output_edges[Source]= (int) ( 1.2 N S o u r c e )

8 │ for Source = 0 à N do

6 │ │ for Destination = 0 à N do

7 │ │ └ edge_weight[Source][Destination] ß 0

8 │ for X = 0 à Total_paths do

9 │ │ for Step = 0 à Length_paths do

10 │ │ │ if Step == 0 then

11 │ │ │ └ Path[Step] ß next_popular_vertex(N, Step, Ø, ALL)

12 │ │ │ else if Step > 0 then

13 │ │ │ │ if Max_output_edges[Previous_v]> 0 then

14 │ │ │ │ │ Path[Step] ß next_popular_vertex(N, Step, Path[ ] ,ALL)

15 │ │ │ │ │ if Current_v not in Visited_Vertices[Previous_v][ ] then

16 │ │ │ │ │ │ Max_output_edges[Previous_v] - = 1

17 │ │ │ │ │ └ insert(Visited_Vertices[Previous_v][ ], Current_v)

18 │ │ │ │ │ else

19 │ │ │ │ │ └ Path[Step] next_popular_vertex(N, Step, Path[ ],Visited_Vertices[Previous_v][ ])

20 │ │ │ │ │ Current_v ß Path[Step]

21 │ │ │ │ │ Previous_v ß Path[Step - 1]

22 └ └ └ └ └ edge_weight[Previous_v][Current_v]+=1=(2^Step)