Question:hard

Consider the following arrangement of pixels P, P1, P2, P3 and P4 as shown in the figure. Assume that P, P2 and P4 have a value of 1, and P1 and P3 have a value of 0. If we consider adjacency of pixels as \(V=\{1\}\), what is the length of the shortest m-path between P and P4?

Show Hint

Plot the pixel positions on a grid, note that P1 and P3 both equal 0 so they cannot be used, and check whether P-P2 and P2-P4 each satisfy the no-common-V-neighbour condition for m-adjacency.
Updated On: Jul 20, 2026
  • 2
  • 1
  • 3
  • 4
Show Solution

The Correct Option is A

Solution and Explanation

Step 1: List all pairwise spatial relationships among the V-valued pixels. The pixels with value 1 are $P(2,0)$, $P_2(1,1)$ and $P_4(0,2)$, using (row, column) grid coordinates. $P_1(1,0)$ and $P_3(0,1)$ both have value 0, so they cannot serve as stepping stones for a path defined on $V=\{1\}$.
Step 2: Check if P and P4 can be connected without going through P2. $P(2,0)$ and $P_4(0,2)$ are two rows and two columns apart, so they are not even 8-adjacent (8-adjacency only covers immediate neighbours, at most one row and one column apart); a direct single-step path is impossible. Any path must pass through an intermediate V-valued pixel, and the only one positioned between them is $P_2(1,1)$.
Step 3: Verify the P-P2 and P2-P4 links qualify as m-adjacency. Both pairs are diagonal neighbours. For m-adjacency, the shared 4-neighbours of each diagonal pair must contain no pixel of value 1. For P and $P_2$, the shared 4-neighbours are $P_1$ (value 0) and the empty cell at $(2,1)$ (value 0): clear, so m-adjacent. For $P_2$ and $P_4$, the shared 4-neighbours are $P_3$ (value 0) and the empty cell at $(1,2)$ (value 0): also clear, so m-adjacent. Both links are valid single m-adjacency steps.
Step 4: Count the steps in the only available path. The path $P \to P_2 \to P_4$ therefore consists of exactly two m-adjacency links, and since no shorter route exists (Step 2), this is the shortest m-path.
Step 5: Final answer. \[ \boxed{2} \]
Was this answer helpful?
0