Topic: Algorithm of creation a straight line

Day kind!
Prompt please algorithm of creation  to a line for communication of two and more units (, as on circuits)
a simple variant of 2 points
an average variant between two
and it is absolutely difficult when on  more than two objects and all ways (do not transit under units and are not intersected)
In advance thanks, the first variant not a question and as with remaining yet I do not understand.