Planar graphs with loops and applications to territorial problems