\section{Introduction}
\label{sec1}
Day-ahead electricity markets are multi-unit auctions where market players submit orders to buy or sell electric power in a given area during predefined hours of the following day. Market players agree on a collection of rules describing the bid acceptance and the price determination. The so called market operator collects the participants' orders, and determines the dispatch in order to maximize the total social welfare (TSW).

The TSW is defined as the total utility of consumption minus the total cost of production, and it may be derived as a function of the decision variables describing the acceptance/rejection of bids and bid parameters. Assuming a general market clearing price, the total social welfare may be decomposed to the welfare or surplus of single bids.

The computed market prices should ideally support a market equilibrium, which maximizes the social welfare \cite{madani2017revisiting}, with respect to the actual constraints (e.g. keeping production and consumption in balance for every hour). \\
The most difficult feature to deal with in day-ahead electricity markets is the fact, that some orders may be non-convex \cite{madani2016non}.

Non-convexity may originate from technical constraints such as minimum performance or load gradient \cite{sleisz2019new}, and can be also generated by the cost structure (e.g. start-up costs of power plants). \\
Regarding non-convex bids, in this study we assume the presence of block orders (orders including potentially multiple bids for several consecutive hours \cite{meeus2009block}) for which a "fill-or-kill condition" must met: the order is either fully accepted or fully rejected (in each of the hours).  These block orders help participants to express their production constraints and cost structures: they allow the participant to combine multiple periods.

\section{Methods}
The input of the day-ahead market is the set of supply and demand bids for each period (hour). Each submitted bid is characterized by a quantity and a bid price (per unit). It is our task to decide which bids will be accepted and rejected.  Bids which define no interdependencies between periods and may be partially accepted are called standard (hourly) bids.

\subsection{General multiperiod problem formulation with block bids}
The general problem considered in this paper is including $T$ time periods (hours), (multi-period) block bids, minimum allocation ratios and start-up costs as well.
Each block bid $j$ is characterized by a set $T_j \subseteq T$, describing the (consecutive) time periods for which the block bid is submitted, by a quantity $Q_j$ and by a bid price $P_j$. We assume that the latter two parameters are universal for all periods included in the bid (in other words we do not consider 'profiled block bids' \cite{euphemia2015}).

\begin{align}
& \max\limits_{x, u} \sum_{t \in T} \left( \sum_{i \in I_t} Q_{ti}P_{ti} x_{ti} + \sum_{j: t\in T_j} Q_j P_j u_j \right) - \nonumber \\ & - \sum_{t \in T}\sum_{i \in I_t}u_{ti}F_{ti} \label{obj fncn} \\
\text{wrt.} ~~~~ &r_{ti}u_{ti} \leq x_{ti}\leq u_{ti}~~~~~~ \forall t \in T, ~~~\forall i \in I_t \label{startup}\\
 &Q_{ti} x_{ti} + \sum_{j: t\in T_j} Q_j u_j = 0~~~~\forall t \in T \label{power balance}
\end{align}
where $x_{ti} \in [0,1]$ denotes the acceptance indicator of the $i$-th standard hourly bid submitted for period $t$, $r_{ti}$ denotes its minimum allocation ratio and $I_t$ is the index set of standard hourly bids submitted for period $t$.
$u_j \in \{0,1 \}$ denotes the binary acceptance indicator of block bid $j$.
The first term in the objective function (\ref{obj fncn}) corresponds to the TSW of hourly bids while the second term corresponds to the welfare contribution of block bids. $F_{ti}$ corresponds to the start-up cost for the $i$-th standard hourly bid of period $t$. If $F_{ti}=0$, the corresponding variable $u_{ti}$ may be fixed to 1, and it may be neglected in the optimization problem.
We assume that in the case of block bids, bidders include the start-up costs in the bid price as well.
Equation (\ref{power balance}) formulates the power balance for all hours, while eq. (\ref{startup})
corresponds to the consideration that without the start-up of the respective unit, no bid may be accepted.

\subsection{The concept of bid-aggregation based clearing}
The number of bids in the clearing problem naturally affects the computational time of the optimization.
By reducing the number of bids, the speed of optimization can be increased.

We introduce the concept of bid aggregation to decrease the number of bids (thus accelerate the clearing process).
Solving the aggregated optimization problem, based on the  acceptance/rejection of certain aggregated bids we will fix the acceptance indicators of the corresponding original bids, and we may exclude them from the further computational steps aiming the solution of the original problem.
In these further steps we decompose the remaining (not fixed) aggregated bids to determine the acceptance of the remaining original bids. Multi-period block bids are not included in the aggregation process.

\subsubsection{The aggregation rule for $n$ bids}
\label{aggreg_rule_for_n_bids}
$n$ standard supply/demand offers are given that we want to aggregate into a single bid. The parameters\footnote{$P^A$ stands for the unit price, $Q^A$ for the quantity, $r^A$ for the minimum allocation ratio and $F^A$ for the start-up cost of the aggregated bid.} of the resulting aggregated bid will be computed as follows:
\begin{equation*}
\begin{aligned}
&P^A = \frac{\sum_{i = 1}^{n} p_i q_i}{\sum_{i = 1}^{n} q_i} ~~~~Q^A = \sum_{i = 1}^{n} q_i \nonumber \\
&r^A = \frac{\sum_{i = 1}^{n} r_i q_i}{\sum_{i = 1}^{n} q_i} ~~~~F^A = \sum_{i = 1}^{n} F_i \label{aggregation}
\end{aligned}
\end{equation*}

The bid price of the aggregated bid ($P^A$) is computed from the quantity-weighted average of original bid prices, while its quantity ($Q^A$) will be the sum of the quantities of its bids. The minimum allocation ratio of the aggregated bid ($r^A$) is the quantity-weighted average of the minimum allocation ratios of its components and its startup cost ($F^A$) is determined as the sum of the startup costs of the original bids.

\subsection{Clearing of the aggregated bids - the first step of the clearing}
\label{Cotab}
By partitioning the original bids into subsets and aggregating these subsets into new bids we decrease the size of the optimization problem.
The solution of this new optimization problem results in the determination of acceptance indicators for the aggregated bids.

In most of the cases
there are three possible outcomes of this first optimization step:
 \begin{itemize}
   \item One of the demand bids is partially accepted.
   \item One of the supply bids is partially accepted.
   \item The acceptance indicator of all bids is 0 or 1.
 \end{itemize}

If there is an aggregated bid on the supply (demand) side that has been partially accepted, we can identify the two closest bids on the demand (supply) side: The first fully accepted demand (supply) bid whose price is higher than the bid price of the partially accepted bid, and the first fully rejected demand (supply) bid  whose price is lower than the bid price of the partially accepted bid.

Thus, we have three distinguished aggregated bids: one partially accepted (on one side: supply or demand), one fully accepted and one fully rejected (the latter two on the other side).

If the acceptance indicator of all bids is 0 or 1 we take four aggregated bids similarly as described above (one-one fully accepted and rejected bids from both the supply and demand side).

\subsection{The second clearing step}
The initial bids from which these three (or four) distinguished aggregated bids are composed may be identified by the stored IDs. In the next step of the process we first fix the acceptance value of all original bids, which are not included in these three (or four) distinguished aggregated bids according to the outcome of the first clearing step (to fully accepted or rejected), and perform a second optimization step to determine the final acceptance values of those bids which are included in the three (or four) distinguished aggregated bids.

\subsubsection{Constraints of the second clearing step}
Let us remember that in the original problem eq. (\ref{power balance}) ensures the balance of supply and demand quantities for each period. This balance constraints also hold in the first step of the process (when clearing the aggregated bids).

However, if according to the outcome of this first step we fix the acceptance indicators of some bids (potentially both on the supply and on the demand side), in most cases we create a power imbalance. In order to get a final result which respects the power balance constraint, during the second step of the process (in the second clearing step), this imbalance must be taken into account and the remaining bids must be cleared in a way which compensates for this imbalance. This can be done via the appropriate modification of the right-hand side of eq. (\ref{power balance}).


\subsection{Example for the aggregation-based clearing}
\label{example}
Let us consider a small one-period example given in Tables \ref{ex_aggr_dem} and \ref{ex_aggr_sup} without minimum allocation ratios, startup costs and block bids for the demonstration of the bid-aggregation based clearing:

\begin{table}[h!]
\centering
\begin{tabular}{ |c|c|c|c|c| }
 \hline
 Bid ID & $Q\> [MWh]$ & $P\> [\text{EUR} / MWh]$  \\ \hline
 1 & $23$ & $78$ \\ \hline
 2 & $67$ & $65$ \\ \hline
 3 & $27$ & $57$ \\ \hline
 4 & $30$ & $55$ \\ \hline
 5 & $91$ & $45$ \\ \hline
 6 & $90$ & $42$ \\ \hline
\end{tabular}
\caption{Demand offers \label{ex_aggr_dem}}%
\end{table}

\begin{table}[h!]
\centering
\begin{tabular}{ |c|c|c|c|c| }
 \hline
Bid ID & $Q\> [MWh]$ & $P\> [\text{EUR} / MWh]$  \\ \hline
 7 & $-96$ & $40$ \\ \hline
 8 & $-71$ & $42$ \\ \hline
 9 & $-41$ & $47$ \\ \hline
 10 & $-80$ & $52$ \\ \hline
 11 & $-99$ & $57$ \\ \hline
 12 & $-99$ & $58$ \\ \hline
\end{tabular}
\caption{Supply offers \label{ex_aggr_sup}}%
\end{table}

The result of solving the problem without aggregation can be seen in Table \ref{res_wo_aggr}.
\begin{table}[h!]
\centering
\caption{Results without aggregation \label{res_wo_aggr}}
\begin{tabular}[t]{ |c|>{\centering\arraybackslash}p{1cm}||c|>{\centering\arraybackslash}p{1cm}|}
 \hline
Bid ID &$x_i$ & Bid ID &$x_i$ \\ \hline
 1 & $1$ & 7 & $1$ \\ \hline
 2 & $1$ & 8 & $1$ \\ \hline
 3 & $1$ & 9 & $0$ \\ \hline
 4 & $1$ & 10 &$0$ \\ \hline
 5 & $0.2198$ & 11 &$0$ \\ \hline
 6 & $0$ & 12 &$0$ \\ \hline
\end{tabular}
\end{table}

Let us now consider pairwise aggregation of the original bids. The IDs of the created aggregated bids are denoted by A$i$. In this case, according to the formulas defined in  (\ref{aggregation}) the aggregated bids are as follows (Tables \ref{aggr_dem} and \ref{aggr_sup}).

\begin{table}[h!]
\centering
\begin{tabular}{ |c|c|c|c|c| }
 \hline
 Aggr. bid ID& $Q\> [MWh]$ & $P\> [\text{EUR} / MWh]$ & Init. bids \\ \hline
 A1 & $90$ & $68.32$ & 1, 2 \\ \hline
 A2 & $57$ & $55.95$ & 3, 4 \\ \hline
 A3 & $181$ & $43.51$ & 5, 6 \\ \hline
\end{tabular}
\caption{Aggregated demand offers \label{aggr_dem}}
\end{table}

\begin{table}[h!]
\centering
\begin{tabular}{ |c|c|c|c|c| }
 \hline
 Aggr. bid ID& $Q\> [MWh]$ & $P\> [\text{EUR} / MWh]$ & Init. bids \\ \hline
 A4 & $-167$ & $40.85$ & 7, 8 \\ \hline
 A5 & $-121$ & $50.31$ & 9, 10 \\ \hline
 A6 & $-198$ & $57.5$ & 11, 12 \\ \hline
\end{tabular}
\caption{Aggregated supply offers \label{aggr_sup}}
\end{table}

Figures \ref{fig:rendes_licitek} and \ref{fig:aggregalt_licitek} depict the supply-demand curves of the original problem and of the problem derived from the aggregated bids.
\begin{figure}[h!]
\centering
\includegraphics[scale=0.4]{rendes_licitek.png}
\caption{Initial bids \label{fig:rendes_licitek}}%
\end{figure}

\begin{figure}[h!]
\centering
\includegraphics[scale=0.4]{aggregalt_licitek.png}
\caption{Aggregated bids \label{fig:aggregalt_licitek}}%
\end{figure}

Solving the optimization problem described in eqs. (\ref{obj fncn}) - (\ref{power balance}) for the aggregated bids we get:

\begin{table}[h!]
\centering
\caption{Resulting acceptance indicators of the aggregated bids ($x^A_i$) \label{aggr_ind}}
\begin{tabular}{ |c|>{\centering\arraybackslash}p{1cm}||c|>{\centering\arraybackslash}p{1cm}| }
 \hline
Aggr. bid ID &$x_i^A$ & Aggr. bid ID &$x_i^A$ \\ \hline
 A1 & $1$ & A4 & $1$ \\ \hline
 A2 & $1$ & A5 & $0$ \\ \hline
 A3 & $0.1105$ & A6 & $0$ \\ \hline
\end{tabular}
\end{table}

As can be seen in Figure \ref{fig:aggregalt_licitek} we partially accept the A3 aggregated  demand bid.
Thus, the set of the three distinguished aggregated bids defined in subsection \ref{Cotab} will be A3, A4 and A5 (see Figure \ref{fig:szetbontando_aggregalt_licitek}) --  the acceptance indicators of the components of these bids (regarding original bid IDs: 5,6,7,8,9,10) will serve as variables of the second clearing step, while the acceptance of all other original bids are fixed according to the resulting acceptance of the aggregated bid including them as summarized in Table \ref{fixed_ind}.

\begin{table}[h!]
\begin{center}
\begin{tabular}{ |c|c|c| }
 \hline
Bid ID &$x_i$ & based on\\ \hline
 1 & $1$ & full acceptance of $x^A_1$\\ \hline
 2 & $1$ & full acceptance of $x^A_1$\\ \hline
 3 & $1$ & full acceptance of $x^A_2$\\ \hline
 4 & $1$ & full acceptance of $x^A_2$\\ \hline
 11 & $0$ & full rejection of $x^A_6$\\ \hline
 12 & $0$ & full rejection of $x^A_6$\\ \hline
\end{tabular}
\caption{ Fixed variables regarding the acceptance indicators of the original problem. \label{fixed_ind}}
\end{center}
\end{table}

After this, we perform the second optimization with the remaining original bids (Tables \ref{remaining_dem} and \ref{remaining_sup}) can be seen in Figure \ref{fig:szetbontott_aggregalt_licitek}.

\begin{table}[h!]
\centering
\begin{tabular}{ |c|c|c|c|c| }
 \hline
 Bid ID & $Q\> [MWh]$ & $P\> [\text{EUR} / MWh]$  \\ \hline
 5 & $91$ & $45$ \\ \hline
 6 & $90$ & $42$ \\ \hline
\end{tabular}
  \caption{Remaining demand offers \label{remaining_dem}}
\end{table}

\begin{table}[h!]
\centering
\begin{tabular}{ |c|c|c|c|c| }
 \hline
 Bid ID & $Q\> [MWh]$ & $P\> [\text{EUR} / MWh]$  \\ \hline
 7 & $-96$ & $40$ \\ \hline
 8 & $-71$ & $42$ \\ \hline
 9 & $-41$ & $47$ \\ \hline
 10 & $-80$ & $52$ \\ \hline
\end{tabular}
  \caption{Remaining supply offers \label{remaining_sup}}
\end{table}


As mentioned earlier, fixing the acceptance indicators of bids not corresponding to the three distinguished aggregated bid creates a power imbalance, which must be compensated in the second optimization step. In this example we fix the acceptance indicators of bids 1, 2, 3 and 4 to 1 (see Table \ref{aggr_ind}), resulting in a surplus of
\begin{equation*}
q_1 + q_2 + q_3 + q_4 = 23 + 67 + 27 + 30 = 147 MWh
\end{equation*}
in the demand side, and this has to be taken into account.

The value required to satisfy the power balance constraint calculated above is placed in the appropriate position of the $b_{eq}$ vector (its position in the vector is the number of the observed period).

As we need to compensate the demand surplus with production, and supply bids do have a negative sign for quantity, the balance equation for the second optimization is as follows:
\begin{equation*}
\begin{aligned}
&  91 \cdot x_5 + 90 \cdot x_6 -96 \cdot x_7 - 71 \cdot x_8 - \\ & - 41  \cdot x_9 -80 \cdot x_{10} = -147.
\end{aligned}
\end{equation*}

Figures \ref{fig:szetbontando_aggregalt_licitek} and \ref{fig:szetbontott_aggregalt_licitek} depict the remaining aggregated and decomposed offers.
\begin{figure}[h!]
    \centering
\includegraphics[scale=0.4]{szetbontando_aggregalt_licitek.png}
  \caption{The 3 distinguished aggregated bids, which will be decomposed in the second step.\label{fig:szetbontando_aggregalt_licitek}}
\end{figure}

\begin{figure}[h!]
    \centering
\includegraphics[scale=0.4]{szetbontott_aggregalt_licitek.png}
  \caption{The remaining original bids after the decomposition of the 3 distinguished aggregated bids. \label{fig:szetbontott_aggregalt_licitek}}
\end{figure}

Solving the second clearing step gives the result (see Figure \ref{fig:szetbontott_aggregalt_licitek}):

\begin{table}[h!]
\centering
\caption{Bids indicators' in the second clearing step \label{sec_opt_ind}}
\begin{tabular}{ |c|>{\centering\arraybackslash}p{1cm}||c|>{\centering\arraybackslash}p{1cm}| }
 \hline
Bid ID &$x_i$ & Bid ID &$x_i$\\ \hline
 5 & $0.2198$ &  8 & $1$\\ \hline
 6 & $0$ &  9 &$0$ \\ \hline
 7 & $1$ &  10 &$0$ \\ \hline
\end{tabular}
\end{table}

Testing the quantities we get that
\begin{equation*}
\begin{aligned}
& x_5 \cdot q_5 + x_6 \cdot q_6 - x_7 \cdot q_7 - \\ & - x_8 \cdot q_8 - x_9 \cdot q_9 - x_{10} \cdot q_{10} = \\
&= 0.2198 \cdot 91 + 0 \cdot 90 - 1 \cdot 96 - \\ & - 1 \cdot 71 - 0 \cdot 41 - 0 \cdot 80 = - 147,
\end{aligned}
\end{equation*}
the requirement for the power balance is satisfied.\\

The final result using the results from the first (see Table \ref{fixed_ind}) and the second (see Table \ref{sec_opt_ind}) steps of optimization:

\begin{table}[h!]
\centering
\caption{Results with aggregation\label{result}}
\begin{tabular}[t]{ |c|>{\centering\arraybackslash}p{1cm}||c|>{\centering\arraybackslash}p{1cm}|}
 \hline
Bid ID &$x_i$ & Bid ID &$x_i$ \\ \hline
 1 & $1$ & 7 & $1$ \\ \hline
 2 & $1$ & 8 & $1$ \\ \hline
 3 & $1$ & 9 & $0$ \\ \hline
 4 & $1$ & 10 &$0$ \\ \hline
 5 & $0.2198$ & 11 &$0$ \\ \hline
 6 & $0$ & 12 &$0$ \\ \hline
\end{tabular}
\end{table}

In this case, the results of the original method and the method based on the aggregation of bids are the same. In the following however, we will see that the bid aggregation-based clearing may also induce sub-optimal results in some cases.

\section{Results and discussion}
In the previous example (\ref{example}), we have always grouped 2 bids into an aggregated bid (thus $n$ was equal to 2), but for larger problems, aggregating a low number of bids does not results in the most efficient solution because the time needed for the first optimization step will be higher due to the large number of aggregated bids.

If we perform the aggregation for flexible number of bids, taking into account their price parameters, we potentially get an aggregated bid set with more equidistant distribution in the price space, which is beneficial for optimization purposes. We will call the proposed method \emph{nominal aggregation}.

Although in the majority of the tested scenarios the nominal aggregation based clearing reaches the same TSW as the non-aggregated clearing (thus the result is optimal), in some cases a sub-optimal solution is reached.
It is possible, that the decomposition of aggregated bids not fixed after the first clearing step results in a bid set, which can not lead to an optimal solution.

Figures \ref{fig:nominalis_nem_talalja_el_3} and \ref{fig:nominalis_nem_talalja_el_4} illustrate such a case: The
remaining 3 aggregated bids and the initial bids contained by them are depicted in the figures.
\begin{figure}[h!]
\centering
\includegraphics[scale=0.5]{nominalis_nem_talalja_el_3.eps}
\caption{The 3 distinguished aggregated bids, which will be decomposed in the second step.
\label{fig:nominalis_nem_talalja_el_3}}
\end{figure}

\begin{figure}[h!]
\centering
\includegraphics[scale=0.5]{nominalis_nem_talalja_el_4.eps}
\caption{The remaining original bids after the decomposition of the 3 distinguished aggregated bids. \label{fig:nominalis_nem_talalja_el_4}}
\end{figure}

As can be seen on Fig. \ref{fig:nominalis_nem_talalja_el_3} the curve of the aggregated supply bid meets with the aggregated demand curve (this is the reason why these three aggregated bids were chosen to participate in the second optimization).
However in Fig. \ref{fig:nominalis_nem_talalja_el_4} the supply and demand curves after the decomposition do not intersect each other.
If we do not use bid aggregation and solve the original problem, in the TSW maximizing solution, bid 13 is accepted partially.
In contrast, using bid aggregation, its acceptance indicator will be fixed to 0 (according to the acceptance indicators of aggregated offers). From this, it can be clearly seen that the optimal solution can not be reached here via the bid aggregation method.

\subsection{Optimality performance}
Figures \ref{results1} and \ref{results2} depict the suboptimality of the aggregation-based method with the number of bids on the $x$-axis. We examined the results in 250 randomly generated test cases using a predetermined threshold ($\varepsilon$), assuming various number of bids and varying penetration of block bids in the market. If the relative deviation of the TSW value obtained by the actual aggregation method was less then $\varepsilon$, we considered the clearing successful. The maximum of the nominal aggregation's average relative difference from the reference values was 0.3422\% (It occured when the number of supply-demand bids was 100 and the ratio of block bids was 20\%.).

\begin{figure}[h!]
    \centering
\begin{tikzpicture}
\pgfplotsset{height=7cm, width=\textwidth,compat=1.17}
\begin{axis}[
ybar,
enlarge y limits={0.2},
enlarge x limits={0.5},
legend style={at={(0.5,1), anchor=north west},
anchor=north,legend columns=-1},
ylabel={Hit rate [\%]},
xlabel={Number of supply and demand offers},
symbolic x coords={100, 250, 500, 1000},
xtick=data,
bar width=10pt,
scatter/position=absolute,
        node near coords style={
            at={(axis cs:\pgfkeysvalueof{/data point/x},\pgfkeysvalueof{/pgfplots/ymin})},
            anchor=north,
            yshift={-\pgfkeysvalueof{/pgfplots/major tick length}},
            anchor=west,
            rotate=-90,
            color = black,
        },
]
\addplot[blue, fill] coordinates {(100, 54.8) (250, 95.2) (500, 99.2) (1000, 100)};
\end{axis}
\end{tikzpicture}
    \caption{Optimality of the aggregation based method with $\varepsilon = 0.1\%$ threshold over 5 time periods. The number of block bids was 10\% of the number of supply-demand offers.}
    \label{results1}
\end{figure}

\begin{figure}[h!]
    \centering
\begin{tikzpicture}
\pgfplotsset{height=7cm, width=\textwidth,compat=1.17}
\begin{axis}[
ybar,
enlarge y limits={0.2},
enlarge x limits={0.5},
legend style={at={(0.5,1), anchor=north west},
anchor=north,legend columns=-1},
ylabel={Hit rate [\%]},
xlabel={Number of supply and demand offers},
symbolic x coords={100, 250, 500, 1000},
xtick=data,
bar width=10pt,
scatter/position=absolute,
        node near coords style={
            at={(axis cs:\pgfkeysvalueof{/data point/x},\pgfkeysvalueof{/pgfplots/ymin})},
            anchor=north,
            yshift={-\pgfkeysvalueof{/pgfplots/major tick length}},
            anchor=west,
            rotate=-90,
            color = black,
        },
]
\addplot[blue, fill] coordinates {(100, 53.6) (250, 88.4) (500, 100) (1000, 100)};
\end{axis}
\end{tikzpicture}
    \caption{Optimality of the aggregation based method with $\varepsilon = 0.1\%$ threshold over 5 time periods. The number of block bids was 20\% of the number of supply-demand offers.}
    \label{results2}
\end{figure}

According to several tests, as the number of bids increases, the success rates also show an increasing trend (reaches nearly optimum) and the average relative deviation of TSW values decrease in the case of the nominal aggregation based method. This can be explained by the fact that for multiple bids, the clustering algorithm that determines the original bids to be aggregated into a single bid result in larger clusters. When these larger clusters are decomposed, more bids are available for the algorithm in the second step to optimize, thus the chance is lower to reach sub-optimal result.

\subsection{Computational improvement}
Figures \ref{results3} and \ref{results4} depict the computational time for different market configurations.
In real markets, it is usual to have thousands of offers submitted for a single hour (see e.g. \cite{HUPX}).

\begin{figure}[h!]
\centering
\begin{tikzpicture}
\pgfplotsset{height=7cm, width=\textwidth,compat=1.17}
\begin{axis}[
ybar,
enlarge y limits={0.2},
enlarge x limits={0.5},
legend style={at={(0.5,1), anchor=north west},
anchor=north,legend columns=-1},
ylabel={Computational time [s]},
xlabel={Number of supply and demand offers},
symbolic x coords={1000, 5000, 10000},
xtick=data,
bar width=10pt,
scatter/position=absolute,
        node near coords style={
            at={(axis cs:\pgfkeysvalueof{/data point/x},\pgfkeysvalueof{/pgfplots/ymin})},
            anchor=north,
            yshift={-\pgfkeysvalueof{/pgfplots/major tick length}},
            anchor=west,
            rotate=-90,
            color = black,
        },
]
\addplot[blue, fill] coordinates {(1000, 13.4) (5000,162.6) (10000,673)};
\addplot[red, fill] coordinates {(1000, 1.99) (5000, 14.91) (10000, 58.76)};

\legend{Without aggregation, With aggregation}
\end{axis}
\end{tikzpicture}
\caption{Computational time for different bid numbers and solution methods over 10 time periods. The number of block bids was 5\% of the number of supply-demand offers.}
\label{results3}
\end{figure}
 The aggregation based method is faster than the original method by 85\%, 91\%, 91\% for the increasing bid numbers, respectively.

\begin{figure}[h!]
\centering
\begin{tikzpicture}
\pgfplotsset{height=7cm, width=\textwidth,compat=1.17}
\begin{axis}[
ybar,
enlarge y limits={0.2},
enlarge x limits={0.5},
legend style={at={(0.5,1), anchor=north west},
anchor=north,legend columns=-1},
ylabel={Computational time [s]},
xlabel={Number of supply and demand offers},
symbolic x coords={1000, 5000, 10000},
xtick=data,
bar width=10pt,
scatter/position=absolute,
        node near coords style={
            at={(axis cs:\pgfkeysvalueof{/data point/x},\pgfkeysvalueof{/pgfplots/ymin})},
            anchor=north,
            yshift={-\pgfkeysvalueof{/pgfplots/major tick length}},
            anchor=west,
            rotate=-90,
            color = black,
        },
]
\addplot[blue, fill] coordinates {(1000, 17.76) (5000,150.8) (10000,775.6)};
\addplot[red, fill] coordinates {(1000, 1.92) (5000, 15.77) (10000, 57.96)};

\legend{Without aggregation, With aggregation}
\end{axis}
\end{tikzpicture}
\caption{Computational time for different bid numbers and solution methods over 10 time periods. The number of block bids was 10\% of the number of supply-demand offers.}
\label{results4}
\end{figure}
 The aggregation based method is faster than the original method by 89\%, 90\%, 92\% for the increasing bid numbers, respectively.

It is noticeable that with the increase in the number of bids, the aggregation based method outperforms the the standard method used as reference in terms of time requirement.

The figures also show that the amount of block bids slightly influences the optimization time of the nominally aggregated bids. This can be explained by the fact that block bids are not subject to aggregation. In addition, block bids induce binary variables in the problem, which increase the computational time.

\section{Conclusions and future work}
In this work we proposed an approximation-based approach for the clearing of electricity markets. The principle of the approach is the concept of bid-aggregation.
We analyzed the computational gain and optimality of the method in different scenarios regarding the number of submitted bids and the ratio of block bids among them.
Regarding the computational gain, we found that in the case of large bid quantities the method reduced the computational time by one order of magnitude.
Corresponding to the optimality/suboptimality of the proposed method, the results showed that if we assume a large number of bids, the error of the approximation is practically always below 0.5 percent, and if the number of bids was at least 1000-1000 (supply and demand), the error of approximation was below 0.1\% in 99\% of the simulated cases.

\subsection{Future work}
In the future we plan to carry out more simulations to evaluate further details of the method. In addition, the current model is TSW-oriented, and does not explicitly consider market clearing prices (MCPs). Introducing MCPs in the model formulation implies implication type constraints connecting MCPs and bid acceptance constraints, which may be implemented by the big-M method, implying auxiliary binary variables (see e.g. \cite{csercsik2019uncertain}). We expect that the proposed method may be applied efficiently in this case as well, based on the consideration that the significant reduction of bid number leads to the reduction of the number of these auxiliary binary variables.

As mentioned earlier, clearing based on the aggregation of bids can potentially reach a sub-optimal solution. To overcome this issue the algorithm may be initiated with several possible aggregation configurations and the version with the highest TSW value may be considered as the final solution. The optimization problems resulting from these different initial aggregation scenarios may be evaluated in a parallel manner.

\section{Acknowledgements}
{This work has been supported by the \textit{Integrated researcher training program in the disciplines of information technology and computer science} (EFOP-3.6.3-VEKOP-16-2017-00002) project, and
 by the Funds PD 123900 and K 131545 of the Hungarian National Research, Development and Innovation Office. D\{a}vid Csercsik is the grantee of the J\'{a}nos Bolyai Research Scholarship of the Hungarian Academy of Sciences.

\section*{Bibliography}
 \bibliographystyle{elsarticle-num}

