The space complexity is the extra amount of space excluding the input array or space. We are comparing the nature of algorithm in different situations. So we does not take input space into consideration as all the algorithm will be needing that as compulsary.
the extra space for bfs will be n as the queue may be maximum size of all the nodes .