A loop-less connected arrangement, in other words
a tree
has an edge fewer than
vertices.
As each T-pipe has 1 vertex and 1.5 edges there is an excess of edges which can only be mitigated at the boundaries: Each half-edge pointing outside can be ignored, at most
2n+2m
in an mxn rectangle. For the maximum to be attained every boundary tile must have a half-edge pointing out and each corner tile two half-edges. Then, regarding the difference of the numbers of vertices and edges (which must be one) each boundary tile is neutral, each inner tile adds half an edge and each corner removes half an edge. To end up with one more vertex than edges there must be exactly
2
inner tiles and the rectangle must be
3x4.
Arrangement:
┻┫┣┻
┳┫┣┳
┫┣┫┣
Bonus:
Because of the requirement that corner tiles have two half edges point outwards each has only two possible orientations:
**** ****
**** ****
┫*** ┳***
Further note that this forces the orientation of the non connected neighbour:
**** ****
**** ┻***
┫┣** ┳***
We can now rule out two of the three (up to symmetry) configurations of two corner tiles sharing a short side of the rectangle:
┫*** ┻***
┫*** !***
┫*** ┳***
The left configuration cannot connect to the rest of the rectangle and the right one can not legally fit a boundary tile between the two corners.
That leaves:
┫┣**
┻***
┳***
and up to symmetry two ways of orienting all four corners:
┻**┻ ┫┣*┻
┳**┳ ┻**┳
┫┣┫┣ ┳*┫┣
Either has a unique extension to a legal rectangle:
┻┫┣┻ ┫┣┻┻
┳┫┣┳ ┻┻┳┳
┫┣┫┣ ┳┳┫┣