|
| 1 | +# Banana Trees |
| 2 | + |
| 3 | +This implements the banana tree data structure introduced by Cultrera di Montesano, Edelsbrunner, Henzinger and Ost at SODA 2024. |
| 4 | + |
| 5 | +# Build Instructions |
| 6 | + |
| 7 | +The code is written in C++20. |
| 8 | +Building requires boost (any reasonably recent version should do; we use the pool library and the intrusive library). |
| 9 | +All other dependencies are in the `ext` directory. |
| 10 | + |
| 11 | +To compile using `meson` and `ninja`: |
| 12 | +``` |
| 13 | +mkdir build |
| 14 | +meson setup --buildtype=release build . |
| 15 | +ninja -C build/ |
| 16 | +``` |
| 17 | + |
| 18 | +If `operator<<` for `std::chrono::duration` types is not available, run `meson setup -D fallback-operator=true build .` instead. |
| 19 | +Alternatively, run `meson configure -D fallback-operator=true build` after the setup step. |
| 20 | + |
| 21 | +Replace `release` by `debug` for a debug build. |
| 22 | + |
| 23 | +Tests are build if meson finds `GTest` and `gtest_main`. |
| 24 | + |
| 25 | +# Running Experiments |
| 26 | + |
| 27 | +Relevant executables are `ex_construction`, `ex_local_maintenance`, `ex_topological_maintenance`, `ex_time_series`. |
| 28 | +Run with option `--help` to see the available options. |
| 29 | +The string passed to `--gen-args` is described in `docs/generators.md` |
| 30 | + |
| 31 | +`ex_construction` generates a time series and measures the time for constructing the banana tree. |
| 32 | + |
| 33 | +`ex_local_maintenance` generates a time series and measures the time for value changes in an interval $M = [-m,m]$. |
| 34 | +It selects a random item, then, from the original input, changes the value of that item by values in $M$. |
| 35 | +The magnitudes of the changes are chosen from $M$ uniformly spaced; $D$ changes are performed in total. |
| 36 | +The paramters $m$ and $D$ are user specified (`-m` and `-d`, respectively). |
| 37 | + |
| 38 | +`ex_topological_maintenance` generates a time series and measures the time for topological operations. |
| 39 | +The size of the left interval relative to the total time series is given by the option `-c`. |
| 40 | + |
| 41 | +Both `ex_local_maintenance` and `ex_topological_maintenance` can run worst-case scenarios by selecting the appropriate subcommand. |
| 42 | +The `num_items` option works slightly differently in these executables than described in the help string: |
| 43 | +the format is `min number_of_divisions max`; `number_of_divisions` values are selected from the interval `[min, max]`, |
| 44 | +such that they are spaced evenly on a logarithmic scale. |
| 45 | + |
| 46 | +`ex_time_series construct` reads a time series from standard input in the form of a sequence of function values and constructs the banana tree. |
| 47 | + |
| 48 | +Each executable outputs performance statistics to standard output. |
| 49 | +This output can be converted into a csv-file using the python script `tools/convert-to-csv.py`. |
| 50 | +Structural properties of the banana trees can be written to a separate file via the option `-o`. |
| 51 | +This output can be converted into a csv-file using the python script `tools/structure-convert-to-csv.py`. |
| 52 | + |
| 53 | +# License |
| 54 | + |
| 55 | +This repository, except files in `ext/`, is published under the MIT license. |
| 56 | + |
| 57 | +See the files in `ext/` for the respective licenses. |
0 commit comments