## 3 Methodology
### Multi-Task Loss Functions  
The proposed model focuses on predicting two types of links between nodes, with the goal of generating multiple bubble diagrams that have a reasonable overall structure and local links. To train the model, a multi-task loss function that comprehensively considers global information, local information, and regularization is designed. The loss function is defined as follows:  
\[\mathcal{L}=\mathcal{L}_{\mathrm{W}}+\mathcal{L}_{D}+\mathcal{L}_{DS}+\mathcal{ L}_{CS}+\mathcal{L}_{V} \tag{10}\]  
where \(\mathcal{L}_{W}\) is the wall link prediction loss; \(\mathcal{L}_{D}\) is the door link prediction loss; \(\mathcal{L}_{DS}\) is the link prediction loss of the subgraph without central node; \(\mathcal{L}_{CS}\) is the link prediction loss of the subgraph with central node; and \(\mathcal{L}_{V}\) is the distance loss between the latent variable, \(z\), distribution and the normal distribution.  
The bubble diagram should have a reasonable global topological structure. Specifically, for all input nodes, both wall links and door links should be established accurately. The link prediction problem is a binary classification problem, so we use binary cross-entropy loss function. The wall link prediction loss, \(\mathcal{L}_{W}\), and the door link prediction loss \(\mathcal{L}_{D}\) can be defined as follows:  
\[\mathcal{L}_{W}=-\underset{i}{\sum}y_{i}^{wall}log\hat{y}_{i}^{wall}+\Big{(} 1-y_{i}^{wall}\Big{)}log\Big{(}1-\hat{y}_{i}^{wall}\Big{)} \tag{11}\]  
\[\mathcal{L}_{D}=-\underset{i}{\sum}y_{i}^{door}log\hat{y}_{i}^{door}+\Big{(} 1-y_{i}^{door}\Big{)}log\Big{(}1-\hat{y}_{i}^{door}\Big{)} \tag{12}\]  
where \(y_{i}\) is the true label, and \(\hat{y}_{i}\) is the prediction value.  
The link between two nodes should be consistent with the actual situation; for example, the living room node and bedroom node cannot be connected solely by wall links. We sample from the bubble diagram to obtain subgraphs with a central node and subgraphs without a central node for model training. We use the model to predict the links between these subgraphs, calculate the cumulative error loss, and use it to update the model parameters. Suppose there are \(k\) subgraphs, and \(\mathcal{L}_{CS}\) and \(\mathcal{L}_{DS}\) can be calculated as follows:  
\[\mathcal{L}_{CS}=\sum_{k}\mathcal{L}_{CS\_wall}^{k}+\mathcal{L}_{CS\_door}^{k} \tag{13}\]  
\[\mathcal{L}_{DS}=\sum_{k}\mathcal{L}_{DS\_wall}^{k}+\mathcal{L}_{DS\_door}^{k} \tag{14}\]  
where \(\mathcal{L}_{CS\_wall}^{k}\) is the wall link prediction loss of the subgraph with central node, \(\mathcal{L}_{CS\_door}^{k}\) is the door link prediction loss of the subgraph with central node, \(\mathcal{L}_{DS\_wall}^{k}\) is the wall link prediction loss of the subgraph without central node, and \(\mathcal{L}_{DS\_door}^{k}\) is the door link prediction loss of the subgraph without central node.  
The regularization loss \(\mathcal{L}_{V}\), is used to regularize the latent space. The distribution of latent variable \(z\), encoded by VGAE is enforced to normal distribution. \(\mathcal{L}_{V}\) is expressed as the Kulback-Leibler (KL) divergence between these two distributions, which can be calculated as follows:  
\[\mathcal{L}_{V}=KL[q(Z|X,A)||p(Z)] \tag{15}\]  
\[KL=\sum_{i}p(i)\text{log}\bigg{(}\frac{p(i)}{q(i)}\bigg{)} \tag{16}\]  
where \(q(Z|X,A)\) is the latent variable distribution, and \(p(Z)\) is the normal distribution.