Commit c35f7753 authored by Mateusz Pawlik's avatar Mateusz Pawlik

Added SED and CTED to experiments. Briefly tested locally.

parent 2fcfb44f
{
"datasets": [
"dblp/dblp_no_www_sorted.bracket"
],
"thresholds": [
10.0
],
"algorithms": [
"--sed", "--cted"
]
}
\ No newline at end of file
{
"datasets": [
"sentiment/sentiment_sorted.bracket"
],
"thresholds": [
10.0
],
"algorithms": [
"--sed", "--cted"
]
}
\ No newline at end of file
......@@ -368,6 +368,32 @@ CREATE TABLE ted_apted (
runtime double precision
);
DROP TABLE IF EXISTS ted_sed;
CREATE TABLE ted_sed (
execution_id bigserial PRIMARY KEY,
ted_experiment_params_id integer NOT NULL REFERENCES ted_experiment_params(ted_experiment_params_id),
tree_id_1 integer,
tree_id_2 integer,
tree_size_1 integer,
tree_size_2 integer,
ted_value decimal,
subproblems bigint,
runtime double precision
);
DROP TABLE IF EXISTS ted_cted;
CREATE TABLE ted_cted (
execution_id bigserial PRIMARY KEY,
ted_experiment_params_id integer NOT NULL REFERENCES ted_experiment_params(ted_experiment_params_id),
tree_id_1 integer,
tree_id_2 integer,
tree_size_1 integer,
tree_size_2 integer,
ted_value decimal,
subproblems bigint,
runtime double precision
);
-- Touzet's algorithm - baseline version without the depth-based pruning
DROP TABLE IF EXISTS tedk_touzet;
CREATE TABLE tedk_touzet (
......
......@@ -18,6 +18,24 @@
],
"name": "APTED"
},
{
"table_name": "dblp_sed_x_avg_pair_tree_size_y_avg_runtime_k10",
"attributes": [
{
"attr_name": "avg(avg_runtime)"
}
],
"name": "SED"
},
{
"table_name": "dblp_cted_x_avg_pair_tree_size_y_avg_runtime_k10",
"attributes": [
{
"attr_name": "avg(avg_runtime)"
}
],
"name": "CTED"
},
{
"table_name": "dblp_touzetd_x_avg_pair_tree_size_y_avg_runtime_k10",
"attributes": [
......
......@@ -18,6 +18,24 @@
],
"name": "APTED"
},
{
"table_name": "sentiment_sed_x_avg_pair_tree_size_y_avg_runtime_k10",
"attributes": [
{
"attr_name": "avg(avg_runtime)"
}
],
"name": "SED"
},
{
"table_name": "sentiment_cted_x_avg_pair_tree_size_y_avg_runtime_k10",
"attributes": [
{
"attr_name": "avg(avg_runtime)"
}
],
"name": "CTED"
},
{
"table_name": "sentiment_touzetd_x_avg_pair_tree_size_y_avg_runtime_k10",
"attributes": [
......
......@@ -320,6 +320,8 @@ int main(int argc, char** argv) {
// TED algorithms.
using ZhangShasha = ted::ZhangShasha<Label, CostModel>;
using APTED = ted::APTED<Label, CostModel>;
using SED = ted_lb::StringEditDistanceLB<Label, CostModel>;
using CTED = ted_ub::ConstrainedUB<Label, CostModel>;
// TED-k algorithms.
using Touzet = ted::Touzet<Label, CostModel>;
......@@ -355,6 +357,8 @@ int main(int argc, char** argv) {
// --lg LabelGuided greedy_ub_ted
bool alg_zs_is_set = false;
bool alg_apted_is_set = false;
bool alg_sed_is_set = false;
bool alg_cted_is_set = false;
bool alg_tz_is_set = false;
bool alg_tzd_is_set = false;
bool alg_lg_is_set = false;
......@@ -387,6 +391,12 @@ int main(int argc, char** argv) {
} else if (a == "--zs") {
alg_zs_is_set = true;
args_start_it += 1;
} else if (a == "--sed") {
alg_sed_is_set = true;
args_start_it += 1;
} else if (a == "--cted") {
alg_cted_is_set = true;
args_start_it += 1;
} else if (a == "--apted") {
alg_apted_is_set = true;
args_start_it += 1;
......@@ -479,6 +489,16 @@ int main(int argc, char** argv) {
execute_mechanism<Label, APTED, &APTED::apted_ted_k>(
trees_collection, mp, similarity_threshold, lp));
}
if (alg_sed_is_set) {
experiment.algorithm_executions.emplace_back("StringEditDistanceLB",
execute_mechanism<Label, SED, &SED::sed_lb_ted_k>(
trees_collection, mp, similarity_threshold, lp));
}
if (alg_cted_is_set) {
experiment.algorithm_executions.emplace_back("ConstrainedUB",
execute_mechanism<Label, CTED, &CTED::cted_ub_ted_k>(
trees_collection, mp, similarity_threshold, lp));
}
if (alg_tz_is_set) {
experiment.algorithm_executions.emplace_back("Touzet",
execute_mechanism<Label, Touzet, &Touzet::touzet_ted>(
......
......@@ -44,6 +44,8 @@
#include "touzet.h"
#include "greedy_ub.h"
#include "apted.h"
#include "sed_lb.h"
#include "cted_ub.h"
#include "bracket_notation_parser.h"
#endif // TED_ALGS_EXPERIMENTS_H
......@@ -172,13 +172,15 @@ ted_experiment_params = {
"hostname" : get_hostname()
}
ted_algs = ["--apted", "--zs"]
ted_algs = ["--apted", "--zs", "--sed", "--cted"]
tedk_algs = ["--tz", "--tzd"]
tedub_algs = ["--lg",]
table_names = {
'--apted' : 'ted_apted',
'--zs' : 'ted_zhangshasha',
'--sed' : 'ted_sed',
'--cted' : 'ted_cted',
'--tz' : 'tedk_touzet',
'--tzd' : 'tedk_touzetd',
'--lg' : 'tedk_labelguided'
......
......@@ -9,6 +9,28 @@ CREATE MATERIALIZED VIEW sentiment_apted_x_avg_pair_tree_size_y_avg_runtime_k10
ORDER BY avg_pair_tree_size
WITH DATA;
-- Sentiment ted_sed average runtime per average size in tree pair k10.
DROP MATERIALIZED VIEW IF EXISTS sentiment_sed_x_avg_pair_tree_size_y_avg_runtime_k10;
CREATE MATERIALIZED VIEW sentiment_sed_x_avg_pair_tree_size_y_avg_runtime_k10 AS
SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(runtime) AS avg_runtime
FROM ted_sed NATURAL JOIN ted_experiment_params
WHERE dataset_filename = 'sentiment_sorted.bracket'
AND abs(tree_size_1-tree_size_2)<=10
GROUP BY avg_pair_tree_size
ORDER BY avg_pair_tree_size
WITH DATA;
-- Sentiment ted_cted average runtime per average size in tree pair k10.
DROP MATERIALIZED VIEW IF EXISTS sentiment_cted_x_avg_pair_tree_size_y_avg_runtime_k10;
CREATE MATERIALIZED VIEW sentiment_cted_x_avg_pair_tree_size_y_avg_runtime_k10 AS
SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(runtime) AS avg_runtime
FROM ted_cted NATURAL JOIN ted_experiment_params
WHERE dataset_filename = 'sentiment_sorted.bracket'
AND abs(tree_size_1-tree_size_2)<=10
GROUP BY avg_pair_tree_size
ORDER BY avg_pair_tree_size
WITH DATA;
-- Sentiment tedk_labelguided average runtime per average size in tree pair k10.
DROP MATERIALIZED VIEW IF EXISTS sentiment_labelguided_x_avg_pair_tree_size_y_avg_runtime_k10;
CREATE MATERIALIZED VIEW sentiment_labelguided_x_avg_pair_tree_size_y_avg_runtime_k10 AS
......@@ -44,6 +66,28 @@ CREATE MATERIALIZED VIEW dblp_apted_x_avg_pair_tree_size_y_avg_runtime_k10 AS
ORDER BY avg_pair_tree_size
WITH DATA;
-- DBLP ted_sed average runtime per average size in tree pair k10.
DROP MATERIALIZED VIEW IF EXISTS dblp_sed_x_avg_pair_tree_size_y_avg_runtime_k10;
CREATE MATERIALIZED VIEW dblp_sed_x_avg_pair_tree_size_y_avg_runtime_k10 AS
SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(runtime) AS avg_runtime
FROM ted_sed NATURAL JOIN ted_experiment_params
WHERE dataset_filename = 'dblp_no_www_sorted.bracket'
AND abs(tree_size_1-tree_size_2)<=10
GROUP BY avg_pair_tree_size
ORDER BY avg_pair_tree_size
WITH DATA;
-- DBLP ted_cted average runtime per average size in tree pair k10.
DROP MATERIALIZED VIEW IF EXISTS dblp_cted_x_avg_pair_tree_size_y_avg_runtime_k10;
CREATE MATERIALIZED VIEW dblp_cted_x_avg_pair_tree_size_y_avg_runtime_k10 AS
SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(runtime) AS avg_runtime
FROM ted_cted NATURAL JOIN ted_experiment_params
WHERE dataset_filename = 'dblp_no_www_sorted.bracket'
AND abs(tree_size_1-tree_size_2)<=10
GROUP BY avg_pair_tree_size
ORDER BY avg_pair_tree_size
WITH DATA;
-- DBLP tedk_labelguided average runtime per average size in tree pair k10.
DROP MATERIALIZED VIEW IF EXISTS dblp_labelguided_x_avg_pair_tree_size_y_avg_runtime_k10;
CREATE MATERIALIZED VIEW dblp_labelguided_x_avg_pair_tree_size_y_avg_runtime_k10 AS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment