Skip to content

Commit

Permalink
Implemented two methods (loop_vec and online)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebd99 committed Nov 16, 2023
1 parent 7c5ea5a commit 51c1d28
Show file tree
Hide file tree
Showing 5 changed files with 241 additions and 83 deletions.
17 changes: 11 additions & 6 deletions Experiments/Scripts/sampling_strategies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@
using Profile
include("../Experiments.jl")

datasets = [human, aids, yeast, hprd, dblp, wordnet]
#datasets = [human, aids, yeast, hprd, dblp, wordnet]
datasets = [aids]

experiment_params = Vector{ExperimentParams}()
build_params = Vector{ExperimentParams}()
num_colors = 128
for dataset in datasets
push!(build_params, ExperimentParams(dataset=dataset))
for sampling_strategy in instances(SAMPLING_STRATEGY)
push!(experiment_params, ExperimentParams(dataset=dataset, sampling_strategy=sampling_strategy, inference_max_paths=128))
push!(build_params, ExperimentParams(dataset=dataset, num_colors=num_colors))
# for sampling_strategy in instances(SAMPLING_STRATEGY)
for sampling_strategy in [redistributive, loop_vec, online]
push!(experiment_params, ExperimentParams(dataset=dataset, num_colors=num_colors, sampling_strategy=sampling_strategy, inference_max_paths=512))
end
end

build_experiments(build_params)
#build_experiments(build_params)

run_estimation_experiments(experiment_params)

graph_grouped_box_plot(experiment_params; grouping=sampling_type, filename="sampling_strategies_comparison")
graph_grouped_box_plot(experiment_params; grouping=sampling_type, filename="sampling_strategies_comparison_error")

graph_grouped_box_plot(experiment_params; y_type = runtime, grouping=sampling_type, filename="sampling_strategies_comparison_runtime")
1 change: 1 addition & 0 deletions Experiments/run_estimators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function run_estimation_experiments(experiment_params_list::Vector{ExperimentPar
for i in 1:length(all_queries[dataset])
query::QueryGraph = all_queries[dataset][i].query
query_path = all_queries[dataset][i].query_path
println(query_path)
exact_size = all_queries[dataset][i].exact_size
estimate_results = [(@timed get_cardinality_bounds(query, summary;
max_partial_paths = experiment_params.inference_max_paths,
Expand Down
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
GraphRecipes = "bd48cda9-67a9-57be-86fa-5b3c104eda73"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890"
Parquet2 = "98572fba-bba0-415d-956f-fa77e587d26d"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Probably = "2172800d-0309-5a57-a84f-d50c94757422"
QuasiStableColors = "9c3856af-3e7c-4d34-a6af-a406867b22e4"
QuickHeaps = "30b38841-0f52-47f8-a5f8-18d5d4064379"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"
Expand Down
6 changes: 5 additions & 1 deletion Source/CardinalityWithColors.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
using Probably: BloomFilter, constrain
using DataStructures: counter, Dict, Set, Vector, inc!, Queue
using DataStructures: counter, inc!, Queue
using QuickHeaps: PriorityQueue, dequeue!, enqueue!
using AutoHashEquals
using QuasiStableColors
using StatsBase
using Random
using LoopVectorization
using Distributions

QSC = QuasiStableColors
using Graphs: SimpleDiGraphFromIterator, Edge, DiGraph, edges, nv, ne, add_edge!,
Expand Down
Loading

0 comments on commit 51c1d28

Please sign in to comment.