Algorithm To Check If Graph Is Planar