Schedule Optimization in a Smart Microgrid Considering Demand Response Constraints

Smart microgrids (SMGs) may face energy rationing due to unavailability of energy resources. Demand response (DR) in SMGs is useful not only in emergencies, since load cuts might be planned with a reduction in consumption but also in normal operation. SMG energy resources include storage systems, dispatchable units, and resources with uncertainty, such as residential demand, renewable generation, electric vehicle traffic, and electricity markets. An aggregator can optimize the scheduling of these resources, however, load demand can completely curtail until being neglected to increase the profits. The DR function (DRF) is developed as a constraint of minimum size to supply the demand and contributes solving of the 0-1 knapsack problem (KP), which involves a combinatorial optimization. The 0-1 KP stores limited energy capacity and is successful in disconnecting loads. Both constraints, the 0-1 KP and DRF, are compared in the ranking index, load reduction percentage, and execution time. Both functions turn out to be very similar according to the performance of these indicators, unlike the ranking index, in which the DRF has better performance. The DRF reduces to 25% the minimum demand to avoid non-optimal situations, such as non-supplying the demand and has potential benefits, such as the elimination of finite combinations and easy implementation.


Introduction
User participation has become of great value in smart grids management. Cooperation among users allows decision-making more flexibility, through the use of demand response (DR). Customers can be included in DR programs either by changing their habits or by implementing load control [1]. DR can be analyzed from two approaches: the first considers the power quality that is affected by disturbances, such as harmonics, inter-harmonics, phase unbalance, phase jump, and temperature effects due to overloads [2,3]. The second encompasses demand benefits for reducing operating costs, improving aggregator profits, and mitigating market power [3,4]. This research falls under the second group, which saves energy through demand management [5].
Demand management can consider demand forecasts, load curtailment, and combinatorial optimization with DR [6,7]. This type of combinatorial optimization problem has several applications for load shedding [8]. Heuristic techniques have been applied to solve this problem with nondeterministic polynomial times, also called NP-hard problems [8,9]. This type of problem can arise as a subproblem or a constraint [5,8,9]. The solution was presented as a combination of a series of user decisions [5,8,9]. In microgrids, load shedding was modeled through the 0-1 knapsack problem (KP), which is classified as an NP-hard problem [8]. In using this technique, the possibilities and solution times are exponentially increased with 2 N [8]. The 0-1 KP problem was solved with heuristic algorithms and Lagrangian multipliers. For example, Cuckoo Search and Tabu Search are heuristic algorithms that are applied efficiently by solving multidimensional 0-1 KP [8,10]. In addition, the method of Lagrangian multipliers is implemented with integer programming. Results show that execution time is polynomial and is similar to other findings [11].
Load restoration has been addressed with 0-1 KP in microgrids. Consumer supply is an important procedure after the smart microgrid (SMG) is out of service [12,13]. For example, failures and blackouts can deteriorate customer satisfaction and restoration of power supply is essential [12,13]. DR programs share the objectives of ensuring user welfare and supplying essential loads [14]. Energy must be supplied at low cost and supplying critical loads [12,13]. The energy supply is optimized through heuristic techniques [12,13]. Consequently, DR programs are supported by load restoration programs, in both cases the aim is to ensure the energy supply of a group of users.
Optimization techniques with heuristics have been widely studied [15]. SMGs comprise interacting elements such as residential loads with DR programs, distributed electric vehicles (EVs), energy storage systems (ESSs), generation with renewable energies, and dispatchable units [13,14]. SMGs may also be subject to sources of uncertainty that further complicate operation, such as residential demand, renewable generation, traffic of EVs, and electricity markets [13,15]. For example, a comparative analysis is performed between various algorithms for a SMG model [9,16]. The variable neighborhood search-differential evolutionary particle swarm optimization (VNS-DEEPSO) algorithm turned out to be better than the chaotic evolutionary particle swarm optimization (PSO), differential evolution (DE) with stochastic selection, enhanced velocity differential evolutionary PSO, firefly, improved chaotic DEEPSO, improved DE, PSO with global best perturbation, and unified PSO algorithms [16]. Research on these algorithms suggests implementing constraints for DR [17][18][19].

Motivation of This Paper
Operational costs optimization with heuristics alleviates renewable energy disadvantages such as intermittency and fluctuations that can be addressed with the management of ESSs. Heuristics with probabilistic analysis provide robust solutions to the uncertainty of renewables [20]. In addition, the energy supply is considered as an additional objective under criteria of frequency, duration, and magnitude [4,20]. For example, the reduction of operational costs and energy supply are considered in multi-objective optimization problems, this approach presents as a drawback of multiple optimal solutions on the Pareto front [4,20]. However, in the traditional approach the problem is addressed considering 0-1 KP restrictions, however the polynomial execution times make it difficult to analyze real microgrids [14]. Solving problems involving polynomial execution times, robust solutions in SMGs with uncertainty, and addressing multiple criteria in a single objective function motivates the findings of this research.

Contribution of This Paper
This article presents an implementation of 0-1 KP constraints for DR. In addition, the DR function (DRF) is developed as a contribution of this research that solves the 0-1 KP, which indeed involves combinatorial optimization. Both techniques, DRF and 0-1 KP, are evaluated in a SMG model considering an aggregator that seeks social welfare and supplies essential loads. The aggregator schedules resources with or without uncertainty. The uncertainty resources are EVs trips, renewable generation, loads with DR, and energy market prices [21]. The resources without uncertainty are distributed generators (DGs) and ESSs. Additionally, this article makes the following contributions: (1) The implementation of 0-1 KP in a SMG model. 0-1 KP is formulated in two levels. In the first level the demand is grouped, and in the second level the demand is discretized into hour blocks. The refinement of the blocks depends on the computing capacity. Results are measured in terms of the ranking index (RI), load reduction percentage, and execution time. The RI is calculated as the sum of the average profits and their standard deviation. (2) DRF is developed to solve the 0-1 KP. DRF is compared with 0-1 KP in terms of the RI, load reduction percentage, and execution time. The outstanding outcomes of DRF are similar to those of the 0-1 KP. However, DRF stands out for the following characteristics. DRF works with continued variables, so DRF has no problem of refinement. In addition, DRF needs no additional execution time for preloading combinations, since the polynomial time in 0-1 KP and its function are easier to implement than 0-1 KP.
The article presents the following structure: Section 2 summarizes the state of the art, Section 3 presents the SMG model, Section 4 formulates 0-1 KP and DRF, Section 5 contains the results, and Section 6 presents the main conclusions of the research. Table 1 shows the SMG models with energy resources that are subject to 0-1 KP and DRF restrictions [18][19][20][21][22][23][24][25][26]. These models are listed from 1 to 9 and are described in the following. The SMG model 1 considers a maximum generation capacity at 0-1 KP and is solved by using binary variables. The SMG model 1 also considers the maximization of the benefits of SMG [14]. The 0-1 KP solution is successful. However, this model has the problem of polynomial times. Since the SMG model 1 represents a simple microgrid, it lacks elements such as load with DR, market prices, EVs, and ESSs. Therefore, the implementation of the SMG model 1 is feasible in didactic and short-range scenarios of actual SMGs [14].

State of the Art
The SMG model 2 gathers elements such as DGs, photovoltaic (PV) generation, external suppliers, load with DR, market prices, EVs, and ESSs [13,17,27,28]. The SMG model 2 also has sources of uncertainty such as residential demand, renewable generation, traffic of EVs, and electricity markets [13,17,27]. The model is based on the operation of a residential microgrid [16]. However, the residential customer demand is unattended after the optimization process, that is, the load demand is close to zero. In demand management, this is an unwanted solution [12,16]. The SMG model 2 is improved with a battery swapping station for EVs and sets a DRF as a constraint [22]. However, DRF is a target rather than a constraint in [4]. Therefore, the new implementation of the DRF lacks a previous study for the implementation with loads with DR. The residential power system model 3 aims to improve the economic benefits [23]. This model considers the use of smart meters in SMGs [1] as well as load uncertainty and price volatility in real time [23]. This model has no restrictions in optimization, which ensures a good state of the demand, such as 0-1 KP and DRF [23]. The analysis does not consider EVs and ESSs [23]. The power system model 4 takes into account the predictive forecast but not load shedding [24]. In addition, batteries and generation with combined heat and power and renewable are considered to increase profits [24]. This model includes neither DR programs nor EVs [24].
The model 5 of distributed resources supplies the demand side with renewable energy [25] and aims to reduce CO2 emissions and energy costs. The technique restricts the energy demand supplying and is similar to 0-1 KP, but in this case seven probability scenarios are studied. These seven scenarios are obtained by using a scenario reduction technique. This model is strictly limited to plausible scenarios in uncertain environments; therefore, it can find plausible but not optimal solutions [25].
The smart grid model 6 comprises EVs, ESSs, and renewable generation. This model aims to reduce operating costs and lower CO2 emissions from thermal power plants [26]. This model predicts the load; however, it warns of deviations from the actual load. The model includes no implementation of load with DR [26]. The small-scale model 7 of smart grid aims to maximize the profits in the grid and considers a system with DGs, renewable energies, and ESSs [27]. In this model, the loads are represented by an agent that controls the electric power and exchanges information with other agents in the network [27]. The major drawback of this formulation is that the model lacks load demand management strategies and is difficult to reproduce. Nevertheless, it provides viable results despite having no load restrictions.
The microgrid model 8 reduces operation costs while the dispatchable generation units and the storage of energy are scheduled. Errors for forecasting demand in the operation are recommended to be studied in future works. The microgrid model 8 highlights operations to optimize costs, such as load curtailment and load shifting [29]. Power network models in 9 analyze generation costs, power losses, emissions, and validate an evolutionary hybrid algorithm. This research has demonstrated the interest of the scientific community in validating optimization algorithms with multiple tests. However, the study neglects sources of uncertainty, ESSs, VEs, loads with response to demand, and penalties for not supplying the demand [32]. Table 2 summarizes the limitations presented in the review of this section.
The SMG model 10 is implemented in this research and overcomes some drawbacks described in previous literature. First, this model addresses residential loads with DR programs, EVs, ESSs, DGs, and renewable resources. An aggregator aims to increase profits and can negotiate the buy/sell energy in electricity markets. The microgrid considers uncertainty conditions that are more challenging in the operation, such as renewable generation forecasts, trip planning with EVs, market price volatility, and load forecast. Table 2. Limitations of the review of microgrids with 0-1 KP and DRF.

No.
Limitations of the Review of Microgrids Energy Resources with 0-1 KP and DRF. 1 The model 1 lacks elements such as load with DR, market prices, EVs, and ESSs [14]. 2 The residential customer demand is unattended after the optimization process. In demand management, this is an unwanted solution [22]. 3 The model 3 has no restrictions in optimization, which ensures a good state of the demand, such as 0-1 KP and DRF [23]. 4 The model 4 does not include either DR programs or EVs [24]. 5 The model 5 is strictly limited to plausible scenarios in uncertain environments; therefore, it can find feasible but not optimal solutions [25]. 6 The model 6 includes no implementation of load with DR [26]. 7 The major drawback of this formulation is that the model 7 lacks load demand management strategies and is difficult to reproduce [27]. 8 Errors for forecasting demand in the operation are recommended to be studied in future works [29]. 9 The study neglects sources of uncertainty, ESSs, VEs, loads with DR, and penalties for not supplying the demand [31]. 10 Model 10 overcomes the above limitations.
The SMG model 10 overcomes the weaknesses mentioned in previous models, such as ensuring that the demand is met, integrating DR programs, generating a feasible SMG model for optimization, and creating a reproducible method. This model includes 0-1 KP and DRF to optimize the loads with DR. The 0-1 KP implementation consists of discretizing the load for its optimization and guaranteeing that the demand is satisfied. DRF is a constraint in the objective function to ensure welfare of the demand. This model is the most complete according to the literature review shown in Table 1 that includes sources of uncertainty, elements of the SMG, and 0-1 KP and DRF demand restrictions.
Various heuristic algorithms have been studied to solve SMG models. The resulting VNS-DEEPSO algorithm has the highest performance of the algorithms mentioned above according to [12,16]. The mechanisms implemented in this heuristic are described below.

VNS-DEEPSO Algorithm
This technique assembles the VNS algorithm and the DEEPSO algorithm [12,16]. VNS-DEEPSO algorithm solves an SMG optimization problem with uncertainty, proposed by the GECAD group in [16]. The VNS-DEEPSO secured the first place in this world competition [16,19], as their algorithm considerably improved the results obtained with the differential evolution (DE)/rand/1 algorithm by 279% in a case study with uncertain environments [30]. This study determined an optimal participation of VNS and DEEPSO of 48.6% and 51.4%, respectively [30]. In the early stages, VNS searches for neighborhood structures, scans distant neighborhoods, and maintains the most current solution. The solution is improved with local search method in two steps. In the first step, the cyclic coordinate method searches for a set of directions to optimize non-differentiable or nonlinear functions. In the second step, the Fibonacci line search method reduces the uncertainty interval, as shown in Figure 1a [33]. DEEPSO has the structure of PSO. The new particles are calculated by calculating (1) the new velocity of the particle, (2) the new position, and (3) the particle mutation weight, as shown in Figure 1b. Additionally, the particles change their position inspired by DE and evolutionary algorithms. The improvements include noise to affect the particle positions, thereby adding positive benefits. Moreover, the movement of memory is replaced by the movement of perception. This improvement aims to track the direction of the local gradient. These improvements lead to a solution with remarkable convergence [34]. The pseudocode and link of the complete code are presented in Figure 1 for the VNS and DEEPSO algorithms [16,19].

Conceptual Formulation
The conceptual formulation is based on the flow diagram as shown in Figure 2. The SMG model is defined in Section 3. Demand response constraints ensure the welfare of a group of users and the essential supply of energy. The 0-1 KP or DRF method is formulated to ensure the aforementioned restrictions, and are defined in Sections 4.1 and 4.2. Finally, the results are verified by comparing the traditional 0-1 KP method with the DRF.

Smart Microgrid Model
The aggregator aims to improve the SMG profits in the day-ahead operation ( 1) [30]. Dayahead scheduling of residential microgrid is considered an optimization problem [21]; this microgrid located in Portugal includes EVs, residential loads, and an energy storage system, as shown in Figure  3 [35]. A SMG scheduling problem contains 17 aggregated PV generators (17 agg.) in a group of PV generation [36]. This SMG model contains different types of variables, such as binary, continuous, and discrete, by using mixed integer programming [16,21]. The aggregator reduces the operational costs (OCs) and maximizes the incomes (In), as shown in Equation (1) [21].
The OCs are associated to DGs, ESSs, external supplier ( ), EVs, PV generation, negative and positive imbalance by exceeding the generation and shortage of energy, and curtailable loads with residential DR , as shown in Equation (2) [13,17]. The OCs have a scenarios distribution probability π (s) and predict the forecast error through Monte Carlo simulations [21]. These simulations are based on historical data [16]. The scenarios are reduced with the Soares technique, which is based on statistical metrics. Scenarios are reduced from 5000 to 100 feasible for PV generation, load, and market prices [37]. An EVs simulation tool is employed to generate the travel route forecast [38]. Table 3 shows the specifications of the microgrid.
The aggregator increases the incomes by selling and buying energy in the wholesale and local markets, as shown in Equation (3).
The major constraint is to maintain the active power balance, which includes the sum of PV generation, ESS, DG, external supplier, energy imbalance, load curtailment, buy/sale of energy markets, and EVs, as shown, respectively, in Equation (4). The generation, ESS, EVs, external supplier, and DR curtailment are limited for each period t, as shown in Equations (5)- (9). Binary variables represent the on/off state for each element. Equation (1) is subject to: , , , , , , , ℤ ∀ , ∀ , ∀ , ∀ , ∀ The maximum number of evaluations of the objective function in Equation (1) is limited to 50,000, as shown in Equation (10). This is calculated by multiplying the number of populations, scenarios, and iterations in Equation (10) [16]. * * The RI is calculated with the average of the sum of the mean and the standard deviation divided into the number of runs ( ) of the objective function [13].  Table 4 summarizes the implementation of the 0-1 KP and DRF formulations that can be carried out using the simulation general framework in the Matlab R2019b program. The minimum demand is scheduled either using the step 2a or 2b of Table 4. Table 4. Simulation general framework.

No.
Step

Formulation of 0-1 Knapsack Problem 0-1 KP
SMGs are vulnerable to energy shortages; therefore, it is essential to address the problem of power outages to increase their reliability. 0-1 KP is widely used to solve this problem based on combinatorial optimization. The loads of customer are discretized [3]. 0-1 KP is represented by the evaluation of an objective function that is subject to a constraint. Equation (1) is subject to Equation (12).
∀ ∈ , ∀ ∈ , ∀ ∈ ∈ 0,1 ∈ 1,2, … , The problem in Equation (1) is extended by adding a constraint called 0-1 KP. The same analogy for a knapsack applies to Equation (12). The knapsack has a fixed capacity to carry products. The capacity of the knapsack is 25% of the maximum demand which is fixed at the convenience of the microgrid, and the products that fill the knapsack are stochastic scenarios, time periods, and loads. In other words, a good state of the demand is ensured, given that the reduction of the demand varies from 25% to 100% of the maximum demand. The off and on state is represented by the variable as 0 and 1. The number of discrete variables is represented by N. The problem is addressed in two stages for better compression and is explained in the following subsections. First, the demand is grouped according to similar patterns and, second, the demand is disaggregated into discrete variables. Figure 4 represents the load forecast with the generated scenarios which are represented by demand profiles. Despite uncertainty in the demand forecast, the main trends are presented. In the afternoon, the maximum loads are expected during the day, and at 11 p.m. at night, between 1 and 2 p.m. [16]. The demand falls smoothly from 1 a.m. to 6 a.m., with a peak over 41 kW at 4 a.m. The load gradually increases from 7 a.m. at midday and it progressively decreases from 4 p.m. to 7 p.m. Groups of loads are stacked to the maximum loads of 90 users, as shown in Figure 5a. The loads are classified into three groups with similar characteristics with the colors red, blue, and green. Figure  5b shows the selected groups according to the similarity of their demand.

Demand Discretization
The mean is calculated for groups 1, 2, and 3, shown in Figure 5b. These values are 43.8, 62.01, and 78.31 kW, respectively. The groups are subdivided according to these values. The purpose is to convert continuous variables into discrete variables. Discrete groups should have similar sizes in terms of means. Under this condition, groups 1, 2, and 3 are subdivided into 2, 3, and 4, respectively. Then, 68 discrete variables are obtained for a 24-h period, as shown in Figure 6. In the next step, the number of combinations is calculated for a load of 25% which is selected for demand convenience. The calculation is represented with = 68 and = 17, using Equation (13). The variables comprise an array of binary variables of 68 × 409.29 quintillion. In the Matlab R2019b program, the maximum variable size is exceeded, so it does not work with this matrix size. The computer processor is Core i5-7200-12 GB RAM. The next combination is generated by taking = 34 and = 9 with a matrix around 34 × 1715 million variables and by using Equation (13). The maximum variable size is exceeded again. The next combination is = 17 and = 5 that results in 17 × 127,858. With this matrix size, optimization is feasible.
The 24-h period is discretized into 17 loads, as shown in Figure 7. One of the concerns of this problem is polynomial nondeterministic time, better known as the N-P hard problem. The polynomial increase is evident [8]. The initial formulation with 68 discrete charges requires a matrix of the order of quintillion. The half of the discrete loads (34) requires a matrix of millions of discrete variables. The half of the discrete loads (17) requires an array of thousands of discrete variables. In other words, the main concern in this type of combinatorial problem is the polynomial calculation time. In 0-1 KP, additional computation times are avoided by preloading a binary matrix of 17 ×

Formulation of Demand Response Function (DRF)
DRF is formulated based on the analogy of actual SMGs. In other words, if a group of users runs out of energy, then, the aggregator will receive a financial penalty. This penalty is received in the objective function, as shown in Equation (14). (14) where represents the objective function and represents the penalty. This ensures the welfare of the demand. The objective function is detailed in Equation (1); the penalization is given in monetary units (m.u.). The penalization is represented in Equation (15).
This formulation is motivated by the transfer function in the first order systems [39] and yields results like those presented in Figure 8 [39]. The system output is represented by J and the stabilization time (T') is represented by the maximum load. It is worth noting that the load is fixed by taking fractions of maximum load. In the early phase, there is a steep slope. Next, the slope gradually falls and finishes with the fixed value of the load, represented in blue; this means that it is equivalent to the capacity in 0-1 KP.

Results and Discussion
VNS-DEEPSO was selected based on the review of heuristic optimization algorithms [15,16,19]. This algorithm was proposed to solve 0-1 KP and DRF. In fact, the profits were optimized for the SMG model in Equation (1). This case study was optimized for 100 scenarios and 50,000 evaluations of objective function, as shown in Equation (10) [36]. Figure 9 summarizes the load curtailment with DR in percentage. The two methodologies are labeled as (Figure 9a) 0-1 KP and (Figure 9b) DRF. The blue area represents the percentage of load curtailment and the orange area represents the percentage of load shedding. The sum of the orange and blue area must be 100%, which represents the demand Hours  1 2 3 4 5 6 7 8  13 14  23 24  Loading block  8 9  16 17  13  14  15   19 20 21 22  7   15 16 17 18  10  11  12   11 12  10  5  6  1  2  3  4   9 forecast for 90 residential loads. The load reduction with 0-1 KP drops from 20% to 5%, from 1 to 9 a.m. The load curtailment fluctuates between 5% and 18.33%, from 10 a.m., at 3 p.m., and in the remaining hours of the day, the load disconnection increases from 5% to 95% with slight fluctuations, as shown in Figure 9a. The DRF solution reaches a peak of 66.87% load reduction during the first 4 h and the remainder of the day the load shedding is almost constant between 21.67% and 22.12%, as shown in Figure 9b.  Figure 10 shows DR for all consumers. The solution with 0-1 KP and DRF are labelled with (a) and (b), respectively. The load profile of 0-1 KP reveals the following patterns. The load with modestly decreases from around 10 to 3 kW in the period between 1 a.m. and 9 a.m. A mild plateau takes place around 10 kW between 10 and 12 p.m. Load demand is substantially eliminated at 1 p.m. Between 2 and 3 p.m., there is a slight increase in the load, which does not last long and gradually increases to a peak of around 68 kW. The profile using the DRF presents the following trends, as shown in Figure 10b. The major consumptions occur between 1 a.m. and 3 a.m. Demand consumption increases smoothly from 7 to 18 kW between 4 a.m. and 1 p.m. Three decreasing slopes are repeated for the periods between 4 p.m. and 7 p.m., between 8 a.m. and 10 p.m., and between 11 p.m. and 12 a.m. Finally, the 0-1 KP solution has sharper peaks compared to DRF. To sum up, 0-1 KP disconnects the load without following a clear pattern, whereas in DRF the loads are disconnected from 4 a.m. until the end of the day. DRF gently follows the trends of the demand forecast and suggests a substantive use of the microgrid between 1 and 3 a.m. DRF is presumed to follow a smooth trend with the use of continuous variables, unlike 0-1 KP with discrete variables.  Figure 11a shows the RI for 20 runs with 1-0 KP, variability in the solutions, and unfavorable benefits in runs 6, 7, 17, and 18. In contrast, DRF keeps the RI fairly stable. In addition, the average RI is better for DRF with 32.8 m.u. than for 0-1 KP with 38.5 m.u. with an average improvement of 5.7 m.u. in the 20 runs. Figure 11b shows reduction percentage of load shedding with DR. 0-1 KP has three runs with sharp peaks in runs 3, 6, and 18, and a slight spike in run 17. The remaining runs are stable. In addition, DRF has an outstanding peak in run 16. The remaining runs yield consistent values. The average percentage of DR shedding is 31%, 2% for 0-1 KP, and 25% for DRF.  Figure 12a shows the execution time. 0-1 KP has favorable execution times, as a result of preloading files with binary combinations. Slight peaks in the running times occur in runs 11, 15, and 18. DRF shows uniform stability in the solution, except for run 6. In general, the execution times are very close for both methods. Figure 12b shows the generation divided into DGs and PV generation. DGs have reduced participation with 0-1 KP, whereas DGs with DRF actively participate with smooth fluctuations around 130 kW during the day. The PV generation has a higher participation than in the DGs with 0-1 KP. The opposite case happens with DRF. In addition, the PV generation with DRF injects more power into the SMG than 0-1 KP. The crunch point generation is presented for 1 and 4 p.m. Energy is transferred to the grid with ESSs and EVs, as shown in Figure 13a. The ESSs with DRF consume more energy during the first 3 h, then decrease to a smooth consumption of roughly 7 kW, whereas the peak power supply of ESSs with 0-1 KP occur at 3 a.m. and power consumption at midday. EVs have low participation with 0-1 KP and their participation is further reduced with DRF. Transfers in electricity markets are represented by a wholesale market and a local market, as shown in Figure 13b. In general terms, 0-1 KP solution has broad support from the electricity markets with notable fluctuations. In contrast, DRF is more moderate in the use of markets and maintains smooth energy consumption.

Discussion of This Paper
The optimal solution to reduce operating costs is to disconnect the largest number of users. This means that the aggregator reduces network costs by disconnecting as many loads as possible. However, essential and critical loads cannot be disconnected, therefore, this methodology turns out to be non-viable. On the one hand, the DRF maintains the supply of energy penalizing the non-supply of essential loads. In other words, the penalty has an objective opposite to the objective function. This penalty is similar to the criteria for formulating multi-objective optimization problems. On the other hand, 0-1 KP does not penalize the objective function, however, it has the disadvantage that it must calculate the complete number of feasible solutions, this calculation can be obtained from the combination of feasible solutions, however, because the execution time grows in polynomial way obtaining optimal solutions in acceptable times is an NP-hard problem. This means that as the discretization of variables increases, the simulation times grow significantly. The 0-1 KP limitations refer to the high simulation times of NP-hard problems. 0-1 KP can be approached with two methods. The first method consists of calculating the combination that would combine in the optimization problem, however, the simulation times are increased in a polynomial way. The second method is implemented in this research and consists of preloading the feasible solutions, the polynomial times are eliminated as evidenced in the results of this research, however, the computer's RAM memory can be saturated as revealed in Section 4.1. The DRF has the limitation that its scope must be tested in other studies, for example, by changing economic parameters over time and calculating the stabilization time for different percentages of load shedding. However, the percentage of energy supply is satisfied satisfactorily for the optimization problem addressed in this study.

Conclusions
Demand management has benefits for SMGs that include load curtailment and shedding. Optimal participation relieves critical congestion periods. These participation strategies are carried out in a SMG model. The aggregator can manage SMG with a suitable optimization tool, called the VNS-DEEPSO algorithm for loads with DR. This paper proposes to ensure the power supply with the 0-1 KP and DRF method. The 0-1 KP method addresses all feasible solutions in the solution space. Feasible solutions include supplying essential loads. The DRF method penalizes not supplying power. According to the results obtained, 0-1 KP and DRF aim to ensure a minimum supply of energy demand. The classical 0-1 KP method yields outstanding results in terms of load curtailment and shedding. Furthermore, 0-1 KP maintains a reduction with fluctuations around 31.2% in stochastic scenarios. The alternative constraint with DRF is compared with 0-1 KP and their results are allowable with 25% load curtailment. Therefore, the restrictions are satisfied satisfactorily for the investigated case study.
DRF has the following advantages regarding 0-1 KP. (1) DRF requires no discretization of variables. In fact, DRF works with continuous variables that yield more accurate outcomes. (2) DRF requires no preload of a file with the combinatorial solution. In other words, 0-1 KP does not make it possible to refine the load blocks at the user's will. Refinement of load blocks depends on the capacity of the computer. (3) DRF needs no additional execution time. This polynomial time appears when 0-1 KP generates the combinatorial sequence. (4) DRF has the best RI. (5) DRF is easier to implement than 0-1 KP. Finally, some trends are identified for suboptimal planning of DGs, PV generation, EVs, ESSs, and electricity markets.
In future research, the 0-1 KP can be explored in optimization problems whose loads can be grouped and the loads can be represented by discrete variables. Additionally, for future applications, DRF can be further explored for optimization problems without adding loads. That is, the loads are analyzed individually, and a penalty ensures the power supply. In the future, the DRF should be analyzed with other percentages of load reduction and in real SMGs that host residential loads.