An efficient distribution network must be able to supply power with good voltage profile. The main objective of the proposed work is to allocate losses of the unbalanced distribution network by the firefly algorithm in regulated and deregulated environments before and after loss minimization. Reconfiguration is one of the methods for loss reduction of unbalanced distribution network. Further, optimal placement of distributed generation and capacitor in the reconfigured unbalanced distribution network can further reduce the loss. The results of reconfigured unbalanced distribution network in regulated environment have already been reported. In this paper reconfiguration of an unbalanced distribution network in a deregulated environment is also carried out using an established Fuzzy Firefly algorithm. Loss sensitivity factor of unbalanced distribution networks is used to get the appropriate location of distributed generation and capacitor to be placed in the unbalanced distribution network. Their ratings have been found out by using bacteria foraging optimization algorithm (BFOA). The suggested loss allocation method using Firefly algorithm is implemented at first on 13 node unbalanced distribution network to check the performance of the proposed loss allocation method when compared to other available method. Finally the proposed method has been implemented on 25 node unbalanced distribution network. Both of the implementations are carried out under MATLAB environment.