Skip to content

Commit

Permalink
added more graph plots for maxsave
Browse files Browse the repository at this point in the history
  • Loading branch information
Almog-David committed Aug 1, 2024
1 parent 738fd26 commit b4a3202
Show file tree
Hide file tree
Showing 7 changed files with 2,199 additions and 2,171 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,37 +249,65 @@ def multiple_runs(runs=10):
results.to_csv(cleaned_csv_file, index=False)

# Plot the results using the cleaned DataFrame
"""
multi_plot_results(
results_csv_file=cleaned_csv_file,
filter={},
subplot_rows=1,
subplot_rows=2,
subplot_cols=3,
x_field="graph_nodes",
y_field="Nodes_Saved",
z_field="algorithm",
subplot_field="Budget",
sharex=True,
sharey=True,
mean=True,
save_to_file="./networkz/algorithms/approximation/tests/test_firefighter_problem/comparisons/spreading_maxsave_budget.png"
)

multi_plot_results(
results_csv_file=cleaned_csv_file,
filter={"graph_nodes":100},
subplot_rows=3,
subplot_cols=1,
x_field="Budget",
y_field="Nodes_Saved",
z_field="algorithm",
subplot_field="edge_probability",
sharex=True,
sharey=True,
mean=True,
save_to_file="./networkz/algorithms/approximation/tests/test_firefighter_problem/comparisons/spreading_maxsave_edge_prob.png"
)"""
save_to_file="./networkz/algorithms/approximation/tests/test_firefighter_problem/comparisons/spreading_maxsave_100_edge_prob.png"
)

multi_plot_results(
results_csv_file=cleaned_csv_file,
filter={},
subplot_rows=2,
subplot_cols=3,
x_field="graph_nodes",
filter={"graph_nodes":200},
subplot_rows=3,
subplot_cols=1,
x_field="Budget",
y_field="Nodes_Saved",
z_field="algorithm",
subplot_field="Budget",
subplot_field="edge_probability",
sharex=True,
sharey=True,
mean=True,
save_to_file="./networkz/algorithms/approximation/tests/test_firefighter_problem/comparisons/spreading_maxsave_budget.png"
save_to_file="./networkz/algorithms/approximation/tests/test_firefighter_problem/comparisons/spreading_maxsave_200_edge_prob.png"
)

multi_plot_results(
results_csv_file=cleaned_csv_file,
filter={"graph_nodes":400},
subplot_rows=3,
subplot_cols=1,
x_field="Budget",
y_field="Nodes_Saved",
z_field="algorithm",
subplot_field="edge_probability",
sharex=True,
sharey=True,
mean=True,
save_to_file="./networkz/algorithms/approximation/tests/test_firefighter_problem/comparisons/spreading_maxsave_400_edge_prob.png"
)

print("\n DataFrame-NonSpread: \n", ex2.dataFrame)

Expand Down
Loading

0 comments on commit b4a3202

Please sign in to comment.