State Estimation of Power Flows for Smart Grids via Belief Propagation