# Vectorization of Floor Plans Based on EdgeGAN
## 3 Methods
### Criteria for Connective Inspection  
The set of subspaces extracted from a vector graph is denoted as \(\mathcal{S}=\{s_{1},s_{2},\cdots,s_{n-1},s_{n}\}\), where \(s_{i},i=1,2,\cdots,n-1\) are the internal subspaces, and \(s_{n}\) is the subspace outside the external contour, as shown in Figures 6 and 7. As the regions annotated with \"AC\" in Figure 6 are the spaces for air conditioners out of the door, they are ignored in Figures 7 and 8. The undirected graph of \(\mathcal{S}\) can be written as \(\mathcal{H}=\{\mathcal{S},\mathcal{D},\mathcal{W}\}\), where \(\mathcal{D}=\{(i,j)\in\mathcal{S}\times\mathcal{S}:i\sim j\}\), and \(\mathcal{W}=\{(i,j)\in\mathcal{S}\times\mathcal{S}:i\sim j\}\). \((i,j)\in\mathcal{D}\) and \((j,i)\in\mathcal{D}\) if subspace \(i\) and \(j\) are connected with a door; moreover, \((i,j)\in\mathcal{W}\) and \((j,i)\in\mathcal{W}\) if subspace \(i\) and \(j\) are connected with a window. Denote the adjacency matrix as \(M^{\mathcal{H}}\in\mathbb{R}^{n\times n}\). The elements \(m^{\mathcal{H}}_{ij}\), \(0\leq i,j\leq n\), of \(M^{\mathcal{H}}\) has the following properties:  
1. \(m^{\mathcal{H}}_{ij}=1\) if \((i,j)\in\mathcal{D}\); \(m^{\mathcal{H}}_{ij}=0.5\) if \((i,j)\in\mathcal{W}\); otherwise \(m_{ij}=0\);
2. \(m^{\mathcal{H}}_{ii}=1\);
3. \(m^{\mathcal{H}}_{ij}=m^{\mathcal{H}}_{ji}\), that is, \(M^{\mathcal{H}}\) is symmetrical.  
The subgraph without windows and its adjacency matrix are denoted as \(\mathcal{G}=\{\mathcal{S},\mathcal{D}\}\) and \(M^{\mathcal{G}}\in\mathbb{R}^{n\times n}\) respectively. The elements \(m^{\mathcal{G}}_{ij}=1\) if \(m^{\mathcal{H}}_{ij}=1\), otherwise \(m^{\mathcal{G}}_{ij}=0\). The Laplacian matrix of \(\mathcal{G}\) is defined as \(L_{\mathcal{G}}=diag\Big{\{}\sum_{j=1,j\
eq i}^{n}m_{ij}\Big{\}}-M_{\mathcal{G}}\), and its eigenvalues are denoted as \(\lambda_{1}(L_{\mathcal{G}})\leq\lambda_{2}(L_{\mathcal{G}})\leq\cdots\leq \lambda_{n}(L_{\mathcal{G}})\). If \(\lambda_{2}(L_{\mathcal{G}})>0\), then \(\mathcal{G}\) is a connected graph.  
Figure 8: The curve of loss.  
Figure 7: Subspace connective graph.  
The degree of internal and external connectivity of each subspace are denoted as \(C_{i}^{inner}=\sum_{j=1}^{n-1}m_{ij}\) and \(C_{i}^{external}=m_{in}\) respectively. The criteria for inspection of connectivity include the following:  
1. There is a door on the external door at least, i.e., \(\sum_{i=1}^{n-1}C_{i}^{external}\geq 1\);
2. The number of doors on the external doors is often less than 2, i.e., \(\sum_{i=1}^{n-1}C_{i}^{external}\leq 2\);
3. Each subspace except those with special architectural functionality (for example, the regions for air condition and pipe) has at least one door, that is, \(C_{i}^{inner}\geq 1\) and \(\min\limits_{i=1,2,\cdots,n-1}\left\{\max\limits_{j=1,2,\cdots,n-1}\left\{m_{ ij}\right\}\right\}\geq 1\), where \(i,j=1,2,\cdots,n-1\);
4. \(\mathcal{G}\) is a connected graph, that is, \(\lambda_{2}\big{(}L_{g}\big{)}>0\). All those four criteria are sufficient conditions for a fully connected graph. Furthermore, Criterion (4) is the sufficient condition of Criteria (1)-(3), but its computation is much complicated than other criteria.