あるノードから別のノードまでの相対的なノード距離を取得するにはどうすればよいでしょうか?

あるノードから別のノードまでの相対的なノード距離を取得するにはどうすればよいでしょうか?

下の図のように、大きなブロックの外側にあるが大きなブロックに密着している、いくつかの小さなブロックを含む大きなブロックを描画したいと考えています。大きなブロックの幅と高さに基づいて「ノード距離」を相対的に設定する方法がわかりません。その点について助けてください。

私の出力:

ここに画像の説明を入力してください

私の期待: 2 つのブロックが同じ地平線レベルにあり、小さい方のブロックが大きい方のブロックに付着することを望んでいます。

ここに画像の説明を入力してください

\documentclass{article}
\usepackage[a4paper,landscape]{geometry}
\usepackage{fontspec}
\setmainfont[Scale=0.9]{Verdana}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\begin{document}
\pagestyle{empty}

\tikzstyle{big} = [rectangle,draw,fill=blue!20,text width = 5em,text centered,minimum width=6em,minimum height=8em]
\tikzstyle{small} = [rectangle,draw,fill=green!40,text width=0.8em, text centered,minimum height = 1em]

\begin{tikzpicture}
  \node [big] (in1) {1st instance};
  \node [small, above right of=in1] (port1) {1};
\end{tikzpicture}

\end{document}

答え1

使用できる\node [small, anchor=north west, at=(in1.north east)] (port1) {1};

関連情報