diff options
author | Aria Shrimpton <me@aria.rip> | 2024-03-10 18:39:02 +0000 |
---|---|---|
committer | Aria Shrimpton <me@aria.rip> | 2024-03-10 18:39:02 +0000 |
commit | 4dca559b1a7d4ad6b104bec3f0d909cb68259fe4 (patch) | |
tree | 9d67e912f13ddb8d661c7f0915d9efd55c255245 /thesis/parts/implementation.tex | |
parent | 6a08fd153587608d66a088bd5deee9eeee40c5c0 (diff) |
more writing
Diffstat (limited to 'thesis/parts/implementation.tex')
-rw-r--r-- | thesis/parts/implementation.tex | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/thesis/parts/implementation.tex b/thesis/parts/implementation.tex index b1e156a..1c131ed 100644 --- a/thesis/parts/implementation.tex +++ b/thesis/parts/implementation.tex @@ -78,11 +78,12 @@ This provides us with estimates for each singular candidate. In order to try and suggest an adaptive container, we use the following algorithm: \begin{enumerate} +\item Sort partitions in order of ascending maximum n values. \item Calculate the cost for each candidate and for each partition \item For each partition, find the best candidate and store it in the array \code{best}. Note that we don't sum across all partitions this time. \item Find the lowest index \code{i} where \code{best[i] != best[0]} \item Check that \code{i} partitions the list properly: For all \code{j < i}, \code{best[j] == best[0]} and for all \code{j>=i}, \code{best[j] == best[i]}. -\item Let \code{before} be the name of the candidate in \code{best[0]}, \code{after} be the name of the candidate in \code{best[i]}, and \code{threshold} be the maximum n value of partition \code{i}. +\item Let \code{before} be the name of the candidate in \code{best[0]}, \code{after} be the name of the candidate in \code{best[i]}, and \code{threshold} be halfway between the maximum n values of partition \code{i} and partition \code{i-1}. \item Calculate the cost of switching as: $$ C_{\textrm{before,clear}}(\textrm{threshold}) + \textrm{threshold} * C_{\textrm{after,insert}}(\textrm{threshold}) |