Skip to content

Commit 7f3fed0

Browse files
committed
Added smaller graphs to get exec time for naive algorithm
1 parent 42cbd82 commit 7f3fed0

6 files changed

Lines changed: 95 additions & 1 deletion

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:ac3fb6618f77b4ca3af47b6654d2195f0f42d4d27205abf2b511f48e0966555b
3+
size 1604
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:dc92317e2bb179ed8b3212e994b5c46b3d38129c5a050b9375ef4b66cb0474e6
3+
size 2628
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:2d38d0d36751214ebb2949867bd07f08169b551298f43f851301da5834480040
3+
size 3893
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:66d0352bfe6373b29b177ce14c97ccffb5c9f58649226209b688f1976d782e2e
3+
size 871
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
================================================================================
2+
BENCHMARK RESULTS
3+
Date: Fri Dec 19 15:12:14 2025
4+
Treated folder: C:\Unif\Memoire\Benchmark graphs\small for naive
5+
Timeout per graph: 600s
6+
================================================================================
7+
8+
================================================================================
9+
Treating: V_10.npz
10+
================================================================================
11+
12+
File loaded: 20 graphs.
13+
14+
Finished tests. See results.
15+
16+
| Method | Min (s) | Max (s) | Mean (s) | Median (s) | Success (%) | Timeout (%) | Errors (%) |
17+
|------------------------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|
18+
| get_decycling_number_naive | 0.001627 | 0.021900 | 0.010867 | 0.010646 | 100.00 % | 0.00 % | 0.00 % |
19+
| get_decycling_number_razgon | 0.004084 | 0.009963 | 0.006897 | 0.006964 | 100.00 % | 0.00 % | 0.00 % |
20+
| get_decycling_number_fomin | 0.009226 | 0.024966 | 0.016678 | 0.016895 | 100.00 % | 0.00 % | 0.00 % |
21+
| get_decycling_number_xiao | 0.003670 | 0.014062 | 0.007538 | 0.006986 | 100.00 % | 0.00 % | 0.00 % |
22+
23+
================================================================================
24+
Treating: V_15.npz
25+
================================================================================
26+
27+
File loaded: 20 graphs.
28+
29+
Finished tests. See results.
30+
31+
| Method | Min (s) | Max (s) | Mean (s) | Median (s) | Success (%) | Timeout (%) | Errors (%) |
32+
|------------------------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|
33+
| get_decycling_number_naive | 0.545736 | 1.139897 | 0.865571 | 0.835115 | 100.00 % | 0.00 % | 0.00 % |
34+
| get_decycling_number_razgon | 0.029861 | 0.096629 | 0.047167 | 0.045691 | 100.00 % | 0.00 % | 0.00 % |
35+
| get_decycling_number_fomin | 0.075776 | 0.210059 | 0.128060 | 0.129441 | 100.00 % | 0.00 % | 0.00 % |
36+
| get_decycling_number_xiao | 0.020251 | 0.064642 | 0.045316 | 0.044285 | 100.00 % | 0.00 % | 0.00 % |
37+
38+
================================================================================
39+
Treating: V_20.npz
40+
================================================================================
41+
42+
File loaded: 20 graphs.
43+
44+
Finished tests. See results.
45+
46+
| Method | Min (s) | Max (s) | Mean (s) | Median (s) | Success (%) | Timeout (%) | Errors (%) |
47+
|------------------------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|
48+
| get_decycling_number_naive | 38.544659 | 72.990759 | 57.914424 | 57.881055 | 100.00 % | 0.00 % | 0.00 % |
49+
| get_decycling_number_razgon | 0.157743 | 0.585591 | 0.296216 | 0.276125 | 100.00 % | 0.00 % | 0.00 % |
50+
| get_decycling_number_fomin | 0.508525 | 1.090358 | 0.735925 | 0.718155 | 100.00 % | 0.00 % | 0.00 % |
51+
| get_decycling_number_xiao | 0.198449 | 0.433513 | 0.274661 | 0.263418 | 100.00 % | 0.00 % | 0.00 % |
52+
53+
================================================================================
54+
Treating: V_5.npz
55+
================================================================================
56+
57+
File loaded: 20 graphs.
58+
59+
Finished tests. See results.
60+
61+
| Method | Min (s) | Max (s) | Mean (s) | Median (s) | Success (%) | Timeout (%) | Errors (%) |
62+
|------------------------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|
63+
| get_decycling_number_naive | 0.000411 | 0.000772 | 0.000516 | 0.000473 | 100.00 % | 0.00 % | 0.00 % |
64+
| get_decycling_number_razgon | 0.000813 | 0.001830 | 0.001176 | 0.001164 | 100.00 % | 0.00 % | 0.00 % |
65+
| get_decycling_number_fomin | 0.001338 | 0.002923 | 0.001961 | 0.001886 | 100.00 % | 0.00 % | 0.00 % |
66+
| get_decycling_number_xiao | 0.001091 | 0.002114 | 0.001504 | 0.001519 | 100.00 % | 0.00 % | 0.00 % |
67+
68+
69+
================================================================================
70+
Benchmark over.
71+
Total execution time: 0:21:54.706614

run_full_benchmark.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import networkx as nx
99
import numpy as np
1010

11+
from naive import get_decycling_number_naive
1112
from razgon import get_decycling_number_razgon
1213
from fomin import get_decycling_number_fomin
1314
from xiao import get_decycling_number_xiao
@@ -74,6 +75,7 @@ def benchmark_exact_exec_time(
7475
methods_list,
7576
timeout_seconds,
7677
output_filename,
78+
times=3,
7779
):
7880

7981
benchmark_start_time = time.perf_counter()
@@ -136,7 +138,7 @@ def benchmark_exact_exec_time(
136138
timeout_occurred = False
137139
error_occurred = False
138140

139-
for _ in range(3):
141+
for _ in range(times):
140142
result_queue = multiprocessing.Queue()
141143
p = multiprocessing.Process(
142144
target=run_method_get_time_and_result,
@@ -894,6 +896,7 @@ def benchmark_approx_comparison(
894896
TIMEOUT_MAX = 600
895897

896898
EXACT_METHODS = [
899+
# get_decycling_number_naive,
897900
get_decycling_number_razgon,
898901
get_decycling_number_fomin,
899902
get_decycling_number_xiao,
@@ -905,6 +908,14 @@ def benchmark_approx_comparison(
905908
approx_decycling_number_stanojevic,
906909
]
907910

911+
# benchmark_exact_exec_time(
912+
# directory_path="Benchmark graphs/small for naive",
913+
# methods_list=EXACT_METHODS,
914+
# timeout_seconds=TIMEOUT_MAX,
915+
# output_filename="Benchmark results/final_ben_small_for_naive.txt",
916+
# times=1,
917+
# )
918+
908919
benchmark_exact_exec_time(
909920
directory_path="Benchmark graphs/random graphs density",
910921
methods_list=EXACT_METHODS,

0 commit comments

Comments
 (0)