This just the game of <a href="https://en.wikipedia.org/wiki/Dots_and_Boxes">Dots and Boxes</a>. There is a huge literature on this game. In particular, Berklekamp's book referenced in the above link shows how difficult this game is.