Added negative edges in input prepare