1. A computer-implemented method of a computer system comprising a processor, wherein the space comprises a plurality of objects and the processor executes steps for calculating connectivity of a space using, the steps comprising: establishing a character matrix comprising a plurality of elements, wherein coordinates of the plurality of elements in the matrix respectively refer to the positions of the plurality of objects of the space, and values of the plurality of elements respectively refer to characters of the plurality of objects; establishing a label matrix, wherein dimension of the label matrix is equal to dimension of the character matrix; dividing the character matrix into a plurality of blocks having corresponding elements therein; calculating connectivity of the corresponding elements of the plurality of blocks using the processor, based on the values of the plurality of elements, and the corresponding elements are grouped into at least one region in accordance with the connectivity of the corresponding elements; labeling each of the at least one region with a label, wherein the plurality of blocks having the at least one region are inputted to corresponding coordinates of the label matrix; enhancing the labels of the plurality of blocks of the label matrix to differentiate the labels between the plurality of blocks; and calculating connectivity of the at least one region of an adjacent plurality of blocks, using the processor, based on the values of the plurality of elements of the adjacent plurality of blocks, and the at least one region of the adjacent plurality of blocks are grouped into at least one larger region in accordance with the connectivity of the at least one region of the adjacent plurality of blocks.