This paper proposes an improved approach to our previous work [meng2012stackelberg]. [meng2012stackelberg] uses Stackelberg game to model the interactions between electricity retailer and its customers and genetic algorithms are used to obtain the Stackelberg Equilibrium (SE). In this paper, we propose a bi-level programming model by considering benefits of the electricity retailer (utility company) and its customer. In the upper level model, the electricity retailer determines the real-time retail prices with the aim to maximize its profit. The customer reacts to the prices announced by the retailer aiming to minimize their electricity bills in the lower level model. In order to make it more tractable, we convert the hierarchical bi-level programming problem into one single level problem by replacing the lower lever's problem with his Karush–Kuhn–Tucker (KKT) conditions. A branch and bound algorithm is chosen to solve the resulting single level problem. Experimental results show that both the bi-level programming model and the solution method are feasible. Compared with the genetic algorithm approach proposed in work [meng2012stackelberg], the branch and bound algorithm in this paper is more efficient in finding the optimal solution.