split_graph function

split graph