An undirected graph with $n$ nodes could be referred to as an adjacency matrix $A$. $A=[a_{ij}]_{n×n}$ with $a_{ij}=a_{ji}=1$ standing for there being an edge between node $i$ and node $j$, and no edges when it is $0$.
Shortest distance matrix: A shortest distance matrix of an undirected graph with $n$ nodes is $B=[b_{ij}]_{n×n}$ where $b_{ij}=b_{ji}$ stands for the shortest distance between node $i$ and node $j$.
There are already many algorithms to obtain the shortest distance in a graph, such as Dijkstra's Shortest Path Algorithm or Floyd–Warshall algorithm.
My Question How to restructure $A$ from $B$, where $B$ is given by $$B=\begin{bmatrix} T&\star\\ \star&\star \end{bmatrix}.$$ Here, $T$ is a $m\times m$ submatrix of $B$ which is a given, and can be regarded as the shortest distances between any two of the first $m(m<n)$ nodes in the graph. The $\star$ is a wildcard standing for matrixes with nonnegative integers.
How to find a $A$ such that from $A$ we can get $B$. There are many $A$’s satisfy with the conditions above. For simplicity(Maybe), we can can some constraint condition on $A$. we can assume that the number of $1$ in $A$ is minimal. It is also welcome not to minimize the number of $1$ in $A$. The only thing I want is the method of find $A$ s.t. $B=\begin{bmatrix} T&\star\\ \star&\star \end{bmatrix}$.Thanks in advance!