Skip to content

Commit

Permalink
heatmaps, no speedups,used digraphs
Browse files Browse the repository at this point in the history
  • Loading branch information
Schefflera-Arboricola committed Feb 14, 2024
1 parent 884e76a commit a7440a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Binary file modified timing/heatmap_global_reaching_centrality_timing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified timing/heatmap_local_reaching_centrality_timing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions timing/timing_individual_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

# Code to create README heatmaps for individual function currFun
heatmapDF = pd.DataFrame()
number_of_nodes_list = [10, 50, 100, 300, 500]
number_of_nodes_list = [125, 250, 500, 1000]
pList = [1, 0.8, 0.6, 0.4, 0.2]
currFun = nx.local_reaching_centrality
currFun = nx.global_reaching_centrality
for p in pList:
for num in number_of_nodes_list:
# create original and parallel graphs
G = nx.fast_gnp_random_graph(num, p, seed=42, directed=False)
G = nx.fast_gnp_random_graph(num, p, seed=42, directed=True)

# for weighted graphs
random.seed(42)
Expand All @@ -27,15 +27,15 @@
H = nx_parallel.ParallelGraph(G)

# time both versions and update heatmapDF
v = random.choice(list(G.nodes()))
# v = random.choice(list(G.nodes()))
t1 = time.time()
c = currFun(H, v)
c = currFun(H)
if isinstance(c, types.GeneratorType):
d = dict(c)
t2 = time.time()
parallelTime = t2 - t1
t1 = time.time()
c = currFun(G, v)
c = currFun(G)
if isinstance(c, types.GeneratorType):
d = dict(c)
t2 = time.time()
Expand Down

0 comments on commit a7440a2

Please sign in to comment.