function to create planar split graph