Skip to content

Commit

Permalink
test : edge_gen function tests updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
sadrasabouri committed May 4, 2024
1 parent 8c6a274 commit b94da4b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/engines/erdos_reyni_gilbert_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@
>>> ## ========= edge_gen function =========
>>> ##########################################
>>> random.seed(2)
>>> edge_dic, weight_dic, edge_number = engine.edge_gen(20, 0.5)
>>> edge_dic, weight_dic, edge_number = engine.edge_gen(20, 0.5, False)
>>> edge_dic == {1: [4, 5, 9, 13, 14, 15, 20], 2: [3, 4, 5, 6, 7, 8, 12, 13, 14, 15, 19], 3: [9, 12, 15, 17], 4: [5, 8, 12, 13, 14, 16, 18, 20], 5: [12, 13, 17], 6: [7, 9, 11, 12, 14, 17, 18, 20],7: [9, 10, 11, 13, 15, 17, 18, 20], 8: [9, 11, 12, 14, 15, 16, 19, 20], 9: [10, 11, 18, 19], 10: [11, 12, 13, 15, 17, 19], 11: [12, 14, 15, 17, 18, 19, 20], 12: [13, 19, 20], 13: [14, 19, 20], 14: [16, 17, 18, 19], 15: [16, 17, 18, 19, 20], 16: [18, 19], 17: [18], 18: [20], 19: [], 20: []}
True
>>> edge_number == 93
True
>>> random.seed(11)
>>> edge_dic, weight_dic, edge_number = engine.edge_gen(20, 0.1)
>>> edge_dic == {1: [12, 14, 17], 2: [5, 7, 10], 3: [10, 17], 4: [7, 11, 18], 5: [], 6: [17, 18], 7: [], 8: [17], 9: [16], 10: [14, 17], 11: [20], 12: [13, 17], 13: [16], 14: [], 15: [], 16: [], 17: [18], 18: [], 19: [], 20: []}
>>> edge_dic, weight_dic, edge_number = engine.edge_gen(20, 0.1, True)
>>> edge_dic == {1: [12, 14, 17], 2: [4, 6, 9], 3: [7, 14, 20], 4: [5, 12], 5: [], 6: [1, 2], 7: [8, 18], 8: [6, 10], 9: [2, 3, 7, 14], 10: [15], 11: [5, 7, 17], 12: [], 13: [16, 17, 19], 14: [4, 7, 11], 15: [3, 17], 16: [], 17: [7, 12, 14], 18: [9], 19: [12], 20: [1, 19]}
True
>>> edge_number == 22
>>> edge_number == 40
True
>>> engine.edge_gen(0)
Traceback (most recent call last):
...
TypeError: edge_gen() missing 1 required positional argument: 'p'
TypeError: edge_gen() missing 2 required positional arguments: 'p' and 'direct'
>>> #########################################
>>> ## ========= gen_using function =========
>>> #########################################
Expand Down

0 comments on commit b94da4b

Please sign in to comment.