added disconnected or cut edges to solve_grid_linear_simple3()