normalize edges from two direction.