The question is how to determine a function which would decide if a pair of persons can communicate with each other, where communication is possible only if the distance between two individuals are less than $k$ units apart. For example:

> 
> If following are the coordinates in which the people reside on the
>  $x$-axis:
> 
> 
> $10$, $13$, $18$, $15$, $33$, and value of $k$ is $3$.
> 
> 
> 

Then $10$ and $13$ can communicate, and $13$ and $18$ can't communicate directly but $13$ to $15$ and $15$ to $18$ is possible, hence $13$ and $18$ can communicate. But, $33$ can't communicate with any person. 

How would one design a function which determines if communication is possible between a pair of persons?