
to become a common practice in smart grids as it
represents a mean to incentive price-based demand-
response programs. Prosumers can, indeed, be moti-
vated to change their habitual consumption patterns
in response to economic signals, thereby favouring
the transition from the conventional “supply follows
load” paradigm to the “load follows supply” one in
the long run. Due to the increasing relevance, the
electricity pricing problem has been the subject of in-
tensive research in recent years. The problem involves
two different players tied by a hierarchical relation.
The retailer/aggregator plays the role of leader, decid-
ing first, whereas the prosumer the role of follower.
To account for such a relation, we formulate the prob-
lem by the Bi-Level (BL) paradigm (Colson et al.,
2007). Specifically, the leader solves the Upper Level
(UL) problem aimed at defining the electricity rates
and the procurement plan that bears the maximum
profit. In taking the best decision, he conjectures the
possible reaction of the follower to the offered rates
as this affects the objective function. Indeed, the fol-
lower, on the basis of the offered rates, decides the
management of his home energy system including the
load scheduling. The aim of this Lower Level (LL)
problem is the minimization of the daily electricity
bill. Since variation of the controllable loads with the
respect to the ideal consumption procures a discom-
fort, a penalization term is also considered in the fol-
lower’s objective function. Different recent contribu-
tions propose BL formulations for the electricity pric-
ing problem. For example, in (Grimm et al., 2021) the
authors compare different pricing schemes and show
that the RTP structure guarantees the highest addi-
tional revenue for the retailer, but also the largest price
volatility for the prosumer. (Soares et al., 2020) pro-
pose a BL formulation where in the UL problem the
retailer establishes the ToU tariff that maximizes the
profit, whereas at the LL, the consumer, as follower,
reacts to this price by determining the operation of the
controllable loads in order to minimize the electricity
bill and a discomfort cost. (Ferrara et al., 2021) pro-
pose a BL formulation where the leader owns a local
energy production system to optimally manage, with
the aim of reducing the amount of energy to purchase
from the wholesale market to cover the follower re-
quest who is also equipped with a renewable energy
system and can control the flexible loads. More re-
cently, (Beraldi and Khodaparasti, 2023a) propose a
BL formulation for defining RTP tariffs offered to a
follower representative of a residential prosumager
who reacts to price signal by scheduling the flexi-
ble appliances. Unlike other contributions, the leader
owns a local energy system that must be properly
managed with the aim of maximizing the daily profit.
The contributions mentioned above share the assump-
tion of perfect information of the parameters involved
in the decision process, thus neglecting the impact
that uncertainty in market prices and weather-related
variables may have in defining the optimal tariff. Only
a few recent contributions, acknowledging the im-
portance of explicitly dealing with uncertainty, pro-
pose stochastic BL formulations. Here, we men-
tion the recent contribution by (Beraldi and Khoda-
parasti, 2023b) who propose a stochastic formulation
for the definition of time-variant tariffs. Specifically,
the leader solves a two-stage problem to define the
optimal procurement plan, considering both the day-
ahead and the real-time market, and maximizing a
safety measure that controls the expected profit that
can be gained in a given percentage of worst case re-
alizations. The follower reacts to the offered tariffs
by optimally managing his home energy system with
the aim of reducing the expected electricity bill. In
(Sarfarazi et al., 2023) the authors provide a stochas-
tic BL formulation where the aggregator sets real-
time selling and buying prices, whereas users mod-
ify their consumption and their grid feed-in through
the use of battery storage systems, to minimize their
costs. Scenario based framework is introduced to take
into account the uncertainty about market prices, local
market generation levels and user electricity demand.
In (Feng and Ruiz, 2023) a stochastic BL approach
to determine electricity tariffs for energy community
members is proposed. Proactive prosumers are as-
sumed to be equipped with PV panels, storage de-
vices and hydrogen systems. Although stochastic BL
formulations have been shown to perform better than
their deterministic counterparts (Beraldi and Khoda-
parasti, 2023b), their solution poses severe computa-
tional challenges. Deterministic BL problems have
been proved to be NP-hard, thus the explicit consid-
eration of uncertainty introduces an additional layer
of complexity, preventing the solution of large-scale
instances that take into account a significant number
of possible future scenarios. Nevertheless, the pricing
problem should be solved on a daily basis to generate
electricity rates for the following day, thus imposing a
limit on the computational time. To address this chal-
lenge, we incorporate uncertainty into the decision
process by employing forecasts of the random param-
eters (Samal et al., 2021). In particular, we assume to
know the wholesale electricity prices as they are an-
nounced in advance one day-ahead, whereas weather-
related variables, i.e. the solar production, are con-
sidered as random and are forecast. The proposed
approach relies on the idea of integrating prediction
and optimization. In particular, we apply the classical
”predict, then optimize” paradigm, where prediction
A Learning Powered Bi-Level Approach for Dynamic Electricity Pricing
391