The answer to the first puzzle is that it's not possible to use only 4 lines to intersect all 9 nodes. It needs 5 lines, but 8 nodes is possible with 4 lines.
The second puzzle needs 7 lines to intersect all nodes. The formula is Y=2(root X)-1 where Y is the lowest number of lines and X is the number of nodes arranged in a square grid.